Skip to content
Snippets Groups Projects
Verified Commit 35428f83 authored by iliya.saroukha's avatar iliya.saroukha :first_quarter_moon:
Browse files

wip: end of part 1A

parent 89c23bb6
No related branches found
No related tags found
No related merge requests found
......@@ -16,3 +16,58 @@ répondre à la question.
- `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 -m command -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.
H2 | CHANGED | rc=0 >>
08:47:28 up 46 min, 2 users, load average: 0.00, 0.00, 0.00
[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 >>
08:47:29 up 46 min, 2 users, load average: 0.00, 0.00, 0.00
[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 >>
08:47:29 up 46 min, 2 users, load average: 0.00, 0.00, 0.00
[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 >>
08:47:29 up 46 min, 2 users, load average: 0.00, 0.00, 0.00
```
- 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
sur la machine distante
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment