... | ... | @@ -57,7 +57,9 @@ Voici quelques exemples de commandes Ad hoc pour vérifier la connexion entre le |
|
|
```
|
|
|
Une commande ad hoc pour installer httpd et le rendre actif sur web01
|
|
|
|
|
|
```ansible -i inventory -m service -a "name=httpd state=started enabled=yes" web01 --become
|
|
|
```
|
|
|
ansible -i inventory -m service -a "name=httpd state=started enabled=yes" web01 --become
|
|
|
|
|
|
```
|
|
|
|
|
|
## Playbooks
|
... | ... | @@ -113,7 +115,10 @@ Sur Ansible, il y a un système de variable bien spécifique, voici un schéma q |
|
|
|
|
|
Il y a aussi les ```fact variables``` qui permettent de renvoyer un JSON avec les informations des machines virtuelles spécifiques, on peut y accéder grâce à cette commande :
|
|
|
|
|
|
```ansible all -i inventory -m setup -u {nom_machine}```
|
|
|
|
|
|
```
|
|
|
ansible all -i inventory -m setup -u {nom_machine}
|
|
|
```
|
|
|
|
|
|
|
|
|
## Boucles, condition et les Handlers
|
... | ... | |