Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b03ed46b1 |
18
Readme.md
18
Readme.md
@@ -5,21 +5,27 @@
|
||||
La commande suivante automatise (en shell) le déploiement de ma clé ssh sur une machine distante.
|
||||
|
||||
```bash
|
||||
ssh cible "curl https://infra.opendoor.fr/id_rsa.pub >> ~/.ssh/authorized_keys"
|
||||
ssh cible curl https://infra.opendoor.fr/id_rsa.pub >> ~/.ssh/authorized_keys
|
||||
```
|
||||
|
||||
Identifier tous les problèmes que peut rencontrer ce script lors de son exécution.
|
||||
|
||||
|
||||
1. le répertoire ~/.ssh n'existe pas
|
||||
2. pb de permissions sur .ssh et/ou authorized_keys
|
||||
3. la clé est déjà dans le fichier authorized_keys
|
||||
|
||||
|
||||
## Exécuter les commandes suivantes:
|
||||
|
||||
Identifier lesquelles sont _indempotentes_
|
||||
|
||||
```bash
|
||||
ansible all -m debug -a 'msg="{{ 42 | random() }}"' -o
|
||||
ansible all -m debug -a 'msg="{{ 42 | random() }}"' -o
|
||||
ansible all -u root -k -m debug -a 'msg="{{ 42 | random() }}"' -o
|
||||
ansible all -u root -k -m debug -a 'msg="{{ 42 | random() }}"' -o
|
||||
|
||||
ansible all -m debug -a 'msg="{{ 1234 | random( seed='1234') }}"' -o
|
||||
ansible all -u root -k -m debug -a 'msg="{{ 1234 | random( seed='1234') }}"' -o
|
||||
|
||||
ansible all -m debug -a 'msg="{{ 1234 | random( seed=inventory_hostname ) }}"' -o
|
||||
ansible all -m debug -a 'msg="{{ 1234 | random( seed=inventory_hostname ) }}"' -o
|
||||
ansible all -u root -k -m debug -a 'msg="{{ 1234 | random( seed=inventory_hostname ) }}"' -o
|
||||
ansible all -u root -k -m debug -a 'msg="{{ 1234 | random( seed=inventory_hostname ) }}"' -o
|
||||
```
|
||||
Reference in New Issue
Block a user