fqcn
This commit is contained in:
10
Readme.md
10
Readme.md
@@ -22,25 +22,25 @@ ansible centos -m service -a 'name=crond state=restarted'
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
ansible localhost -m openssh_keypair -a 'path=/home/formation/.ssh/id_rsa owner=formation group=formation' -u formation
|
ansible localhost -m community.crypto.openssh_keypair -a 'path=/home/formation/.ssh/id_rsa owner=formation group=formation' -u formation
|
||||||
|
|
||||||
#l'inversion des quotes permet l'utilisation du ! dans le mot de passe
|
#l'inversion des quotes permet l'utilisation du ! dans le mot de passe
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible cibles -u formation -k -m user -a 'user=ansible password={{ "123Soleil!"| password_hash( "sha512", 65534 | random(seed=inventory_hostname) | string) }} create_home=yes home=/home/ansible'
|
ansible cibles -m ansible.builtin.user -a 'user=ansible password={{ "123Soleil!"| password_hash( "sha512", 65534 | random(seed=inventory_hostname) | string) }} create_home=yes home=/home/ansible'
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible cibles -u formation -k -m lineinfile -a 'path=/etc/sudoers.d/ansible state=present create=yes line="ansible ALL=(ALL) NOPASSWD: ALL" validate="/usr/sbin/visudo -cf %s"'
|
ansible cibles -m ansible.builtin.lineinfile -a 'path=/etc/sudoers.d/ansible state=present create=yes line="ansible ALL=(ALL) NOPASSWD: ALL" validate="/usr/sbin/visudo -cf %s"'
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible cibles -u formation -k -m copy -a 'dest=/etc/sudoers.d/ansible content="ansible ALL=(ALL) NOPASSWD: ALL" validate="/usr/sbin/visudo -cf %s"'
|
ansible cibles -m ansible.builtin.copy -a 'dest=/etc/sudoers.d/ansible content="ansible ALL=(ALL) NOPASSWD: ALL" validate="/usr/sbin/visudo -cf %s"'
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
ansible cibles -o -m community.general.sudoers -a 'name="ansible" user=ansible commands=ALL nopassword=true'
|
ansible cibles -o -m community.general.sudoers -a 'name="ansible" user=ansible commands=ALL nopassword=true'
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible cibles -u formation -k -m authorized_key -a 'key={{ lookup( "file", "~/.ssh/id_rsa.pub") }} user=ansible'
|
ansible cibles -u formation -k -m ansible.posix.authorized_key -a 'key={{ lookup( "file", "~/.ssh/id_rsa.pub") }} user=ansible'
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user