instructions indempotence
This commit is contained in:
25
Readme.md
Normal file
25
Readme.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Indempotence.
|
||||
|
||||
## Automatisation via un shell
|
||||
|
||||
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 -o ~/.ssh/authorized_keys
|
||||
```
|
||||
|
||||
Identifier tous les problèmes que peut rencontrer ce script lors de son exécution.
|
||||
|
||||
## Exécuter les commandes suivantes:
|
||||
|
||||
Identifier lesquelles sont _indempotentes_
|
||||
|
||||
```bash
|
||||
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 -u root -k -m debug -a 'msg="{{ 1234 | random( seed='1234') }}"' -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