-`all` $\rightarrow$ permet de spécifier sur quelles machines de
l'inventaire le module sera appliqué, en l'occurrence on l'appliquera sur
toutes les machines de l'inventaire donc H1, H2, R1, R2
- Donner la commande _ad-hoc_ qui permet d’afficher l’uptime de toutes les
machines, sans écrire de fichier inventaire. Démontrez que cette commande est
correcte en l’exécutant sur la topologie
```bash
ansible -a"uptime"-i"H1,H2,R1,R2" all
ansible -mcommand-a"uptime"-i"H1,H2,R1,R2" all
```
```bash
[WARNING]: Platform linux on host H2 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
[WARNING]: Platform linux on host R1 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
[WARNING]: Platform linux on host R2 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
[WARNING]: Platform linux on host H1 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
- Donner la commande _ad-hoc_ qui va créer le fichier `/tmp/hello.txt` sur toutes
les machines. Montrez sa sortie par une capture d’écran.
```bash
ansible -a"touch /tmp/hello.txt"-i"H1,H2,R1,R2" all
```
```bash
[WARNING]: Platform linux on host H1 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
H1 | CHANGED | rc=0 >>
[WARNING]: Platform linux on host R1 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
R1 | CHANGED | rc=0 >>
[WARNING]: Platform linux on host H2 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
H2 | CHANGED | rc=0 >>
[WARNING]: Platform linux on host R2 is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the
meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more information.
R2 | CHANGED | rc=0 >>
```
- Quelle est la différente entre les modules `command`, `shell` et `raw` ?
Expliquez et donner des exemples.
-`command` $\rightarrow$
-`shell` $\rightarrow$
-`raw` $\rightarrow$ ce module est différent des deux autres dans la mesure
où il ne transfère pas de code `python` sur l'hôte distant. La commande
spécifié sera exécuté par le daemon `sshd` en créant un processus enfant