Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:centos:8:lcf900:l703 [2022/05/20 16:22] adminelearning:workbooks:centos:8:lcf900:l703 [2024/11/30 10:56] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version - **2022.01**+Version - **2024.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-====== LCF803 - Rôles, Gabarits, Variables et Facts======+====== LDF903 - Rôles, Gabarits, Variables et Facts======
  
 =====Contenu du Module===== =====Contenu du Module=====
  
-  * **LCF803 - Rôles, Gabarits, Variables et Facts**+  * **LDF903 - Rôles, Gabarits, Variables et Facts**
     * Contenu du Module     * Contenu du Module
     * LAB #1 - Dépendances de Rôles     * LAB #1 - Dépendances de Rôles
Ligne 42: Ligne 42:
  
 <code> <code>
-[trainee@centos8 ~]$ mkdir /home/trainee/.ansible/roles/exemple01.java/ +trainee@debian11:~$ mkdir /home/trainee/.ansible/roles/exemple01.java/ 
-[trainee@centos8 ~]$ cd /home/trainee/.ansible/roles/exemple01.java/ +trainee@debian11:~$ cd /home/trainee/.ansible/roles/exemple01.java/ 
-[trainee@centos8 exemple01.java]$ mkdir defaults tasks templates +trainee@debian11:~/.ansible/roles/exemple01.java$ mkdir defaults tasks templates 
-[trainee@centos8 exemple01.java]+trainee@debian11:~/.ansible/roles/exemple01.java$ 
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que dans ce Rôle nous n'avons besoin que des répertoires **defaults**, **tasks** et **templates**. **Important** : Notez que dans ce Rôle nous n'avons besoin que des répertoires **defaults**, **tasks** et **templates**.
 </WRAP> </WRAP>
Ligne 55: Ligne 55:
  
 <code> <code>
-[trainee@centos8 exemple01.java]$ vi /home/trainee/.ansible/roles/exemple01.java/tasks/main.yaml +trainee@debian11:~/.ansible/roles/exemple01.java$ vi /home/trainee/.ansible/roles/exemple01.java/tasks/main.yaml 
-[trainee@centos8 exemple01.java]$ cat /home/trainee/.ansible/roles/exemple01.java/tasks/main.yaml+trainee@debian11:~/.ansible/roles/exemple01.java$ cat /home/trainee/.ansible/roles/exemple01.java/tasks/main.yaml
 --- ---
 - name: install jre - name: install jre
Ligne 70: Ligne 70:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le paquet à installer n'est pas explicitement déclaré. Le paquet est référencé par le contenu de la variable **java_package**, elle-même déclarée dans le fichier **main.yaml** du sous-répertoire **defaults** du Rôle. Notez aussi l'utilisation d'un gabarit, appelé **template**, qui fournit le fichier **java.sh** qui doit être copié à l'emplacement **/etc/profile.d/** à partir du sous-répertoire **templates** du Rôle. **Important** : Notez que le paquet à installer n'est pas explicitement déclaré. Le paquet est référencé par le contenu de la variable **java_package**, elle-même déclarée dans le fichier **main.yaml** du sous-répertoire **defaults** du Rôle. Notez aussi l'utilisation d'un gabarit, appelé **template**, qui fournit le fichier **java.sh** qui doit être copié à l'emplacement **/etc/profile.d/** à partir du sous-répertoire **templates** du Rôle.
 </WRAP> </WRAP>
Ligne 77: Ligne 77:
  
 <code> <code>
-[trainee@centos8 exemple01.java]$ vi /home/trainee/.ansible/roles/exemple01.java/defaults/main.yaml +trainee@debian11:~/.ansible/roles/exemple01.java$ vi /home/trainee/.ansible/roles/exemple01.java/defaults/main.yaml 
-[trainee@centos8 exemple01.java]$ cat /home/trainee/.ansible/roles/exemple01.java/defaults/main.yaml+trainee@debian11:~/.ansible/roles/exemple01.java$ cat /home/trainee/.ansible/roles/exemple01.java/defaults/main.yaml
 --- ---
 java_home: /usr/lib/jvm/java-8-openjdk-amd64/jre java_home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Ligne 84: Ligne 84:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez qu'ici sont déclarées deux variables : **java_home** et **java_package**. **Important** : Notez qu'ici sont déclarées deux variables : **java_home** et **java_package**.
 </WRAP> </WRAP>
Ligne 91: Ligne 91:
  
 <code> <code>
-[trainee@centos8 exemple01.java]$ touch /home/trainee/.ansible/roles/exemple01.java/templates/java.sh+trainee@debian11:~/.ansible/roles/exemple01.java$ touch /home/trainee/.ansible/roles/exemple01.java/templates/java.sh
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Ce fichier ne serait pas normalement vide. Par contre dans ce LAB, nous nous concentrons sur Ansible et seule la présence du fichier est nécessaire pour le bon fonctionnement du LAB. **Important** : Ce fichier ne serait pas normalement vide. Par contre dans ce LAB, nous nous concentrons sur Ansible et seule la présence du fichier est nécessaire pour le bon fonctionnement du LAB.
 </WRAP> </WRAP>
Ligne 101: Ligne 101:
  
 <code> <code>
-[trainee@centos8 exemple01.java]$ mkdir /home/trainee/.ansible/roles/tomcat/ +trainee@debian11:~/.ansible/roles/exemple01.java$ mkdir /home/trainee/.ansible/roles/tomcat/ 
-[trainee@centos8 exemple01.java]$ cd /home/trainee/.ansible/roles/tomcat/ +trainee@debian11:~/.ansible/roles/exemple01.java$ cd /home/trainee/.ansible/roles/tomcat/ 
-[trainee@centos8 tomcat]$ mkdir meta tasks+trainee@debian11:~/.ansible/roles/tomcat$ mkdir meta tasks
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que dans ce Rôle nous n'avons besoin que des répertoires **meta** et **tasks**. **Important** : Notez que dans ce Rôle nous n'avons besoin que des répertoires **meta** et **tasks**.
 </WRAP> </WRAP>
Ligne 113: Ligne 113:
  
 <code> <code>
-[trainee@centos8 tomcat]$ vi /home/trainee/.ansible/roles/tomcat/tasks/main.yaml +trainee@debian11:~/.ansible/roles/tomcat$ vi /home/trainee/.ansible/roles/tomcat/tasks/main.yaml 
-[trainee@centos8 tomcat]$ cat /home/trainee/.ansible/roles/tomcat/tasks/main.yaml+trainee@debian11:~/.ansible/roles/tomcat$ cat /home/trainee/.ansible/roles/tomcat/tasks/main.yaml
 --- ---
 - name: install tomcat - name: install tomcat
Ligne 123: Ligne 123:
  
 <code> <code>
-[trainee@centos8 tomcat]$ vi /home/trainee/.ansible/roles/tomcat/meta/main.yaml +trainee@debian11:~/.ansible/roles/tomcat$ vi /home/trainee/.ansible/roles/tomcat/meta/main.yaml 
-[trainee@centos8 tomcat]$ cat /home/trainee/.ansible/roles/tomcat/meta/main.yaml+trainee@debian11:~/.ansible/roles/tomcat$ cat /home/trainee/.ansible/roles/tomcat/meta/main.yaml
 --- ---
 dependencies: dependencies:
Ligne 130: Ligne 130:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Ce fichier informe Ansible que le Rôle **tomcat** dépend du Rôle **exemple01.java**. **Important** : Ce fichier informe Ansible que le Rôle **tomcat** dépend du Rôle **exemple01.java**.
 </WRAP> </WRAP>
Ligne 137: Ligne 137:
  
 <code> <code>
-[trainee@centos8 tomcat]$ vi /home/trainee/.ansible/roles/playbook.yaml +trainee@debian11:~/.ansible/roles/tomcat$ vi /home/trainee/.ansible/roles/playbook.yaml 
-[trainee@centos8 tomcat]$ cat /home/trainee/.ansible/roles/playbook.yaml+trainee@debian11:~/.ansible/roles/tomcat$ cat /home/trainee/.ansible/roles/playbook.yaml
 --- ---
 - hosts: all - hosts: all
Ligne 146: Ligne 146:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que dans le Play Book, nous appelons **uniquement** le Rôle **tomcat**. **Important** : Notez que dans le Play Book, nous appelons **uniquement** le Rôle **tomcat**.
 </WRAP> </WRAP>
Ligne 153: Ligne 153:
  
 <code> <code>
-trainee@ansible:~/.ansible/roles/tomcat$ cd /home/trainee/.ansible/roles/ +trainee@debian11:~/.ansible/roles/tomcat$ cd /home/trainee/.ansible/roles/ 
-trainee@ansible:~/.ansible/roles$ cp ~/inventory .+trainee@debian11:~/.ansible/roles$ cp ~/inventory .
 </code> </code>
  
Ligne 160: Ligne 160:
  
 <code> <code>
-[trainee@centos8 roles]$ tree+trainee@debian11:~/.ansible/roles$ tree
 . .
 ├── exemple01.java ├── exemple01.java
Ligne 190: Ligne 190:
 │       ├── Debian-10.yml │       ├── Debian-10.yml
 │       ├── Debian-11.yml │       ├── Debian-11.yml
 +│       ├── Debian-12.yml
 │       ├── Debian-8.yml │       ├── Debian-8.yml
 │       ├── Debian-9.yml │       ├── Debian-9.yml
Ligne 196: Ligne 197:
 │       ├── RedHat-7.yml │       ├── RedHat-7.yml
 │       ├── RedHat-8.yml │       ├── RedHat-8.yml
 +│       ├── RedHat-9.yml
 │       ├── Ubuntu-12.yml │       ├── Ubuntu-12.yml
 │       ├── Ubuntu-14.yml │       ├── Ubuntu-14.yml
 │       ├── Ubuntu-16.yml │       ├── Ubuntu-16.yml
 │       ├── Ubuntu-18.yml │       ├── Ubuntu-18.yml
-│       ── Ubuntu-20.yml+│       ── Ubuntu-20.yml 
 +│       └── Ubuntu-22.yml
 ├── inventory ├── inventory
 ├── playbook.yaml ├── playbook.yaml
Ligne 209: Ligne 212:
         └── main.yaml         └── main.yaml
  
-15 directories, 31 files+15 directories, 34 files
 </code> </code>
  
Ligne 215: Ligne 218:
    
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l web01+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l web01
  
-PLAY [all] *******************************************************************************************************************************************************************************************************+PLAY [all] ***************************************************************************************************************************************************************************************************
  
-TASK [Gathering Facts] *******************************************************************************************************************************************************************************************+TASK [Gathering Facts] ***************************************************************************************************************************************************************************************
 ok: [web01] ok: [web01]
  
-TASK [exemple01.java : install jre] ******************************************************************************************************************************************************************************+TASK [exemple01.java : install jre] **************************************************************************************************************************************************************************
 ok: [web01] ok: [web01]
  
-TASK [exemple01.java : configure java home] **********************************************************************************************************************************************************************+TASK [exemple01.java : configure java home] ******************************************************************************************************************************************************************
 changed: [web01] changed: [web01]
  
-TASK [tomcat : install tomcat] ***********************************************************************************************************************************************************************************+TASK [tomcat : install tomcat] *******************************************************************************************************************************************************************************
 changed: [web01] changed: [web01]
  
-PLAY RECAP *******************************************************************************************************************************************************************************************************+PLAY RECAP ***************************************************************************************************************************************************************************************************
 web01                      : ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0    web01                      : ok=4    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le Rôle **exemple01.java** est traité **avant** le Rôle **tomcat**. **Important** : Notez que le Rôle **exemple01.java** est traité **avant** le Rôle **tomcat**.
 </WRAP> </WRAP>
Ligne 242: Ligne 245:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh web01+trainee@debian11:~/.ansible/roles$ ssh web01
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux web01.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux web01.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 252: Ligne 255:
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law. permitted by applicable law.
-Last login: Wed Mar  9 13:49:26 2022 from 10.0.2.45+Last login: Sat Sep 23 18:10:50 2023 from 10.0.2.46
 trainee@web01:~$ systemctl status tomcat8 trainee@web01:~$ systemctl status tomcat8
 ● tomcat8.service - LSB: Start Tomcat. ● tomcat8.service - LSB: Start Tomcat.
    Loaded: loaded (/etc/init.d/tomcat8; generated; vendor preset: enabled)    Loaded: loaded (/etc/init.d/tomcat8; generated; vendor preset: enabled)
-   Active: active (running) since Wed 2022-03-09 13:50:11 CET; 1min 13s ago+   Active: active (running) since Sat 2023-09-23 18:11:29 CEST; 1min 7s ago
      Docs: man:systemd-sysv-generator(8)      Docs: man:systemd-sysv-generator(8)
    CGroup: /system.slice/tomcat8.service    CGroup: /system.slice/tomcat8.service
-           └─11904 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headle+           └─25102 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.he
 trainee@web01:~$ exit trainee@web01:~$ exit
 déconnexion déconnexion
 Connection to web01 closed. Connection to web01 closed.
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$ 
 </code> </code>
  
Ligne 269: Ligne 272:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/tomcat/meta/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/tomcat/meta/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/tomcat/meta/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/tomcat/meta/main.yaml
 --- ---
 dependencies: dependencies:
Ligne 276: Ligne 279:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que cette fois-ci, la valeur de la variable **java_package** spécifiée dans le fichier **/home/trainee/.ansible/roles/exemple01.java/defaults/main.yaml** est sur-chargée par la valeur **tree**. **Important** : Notez que cette fois-ci, la valeur de la variable **java_package** spécifiée dans le fichier **/home/trainee/.ansible/roles/exemple01.java/defaults/main.yaml** est sur-chargée par la valeur **tree**.
 </WRAP> </WRAP>
Ligne 283: Ligne 286:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l web02+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l web02
  
-PLAY [all] *******************************************************************************************************************************************************************************************************+PLAY [all] ***************************************************************************************************************************************************************************************************
  
-TASK [Gathering Facts] *******************************************************************************************************************************************************************************************+TASK [Gathering Facts] ***************************************************************************************************************************************************************************************
 ok: [web02] ok: [web02]
  
-TASK [exemple01.java : install jre] ******************************************************************************************************************************************************************************+TASK [exemple01.java : install jre] **************************************************************************************************************************************************************************
 changed: [web02] changed: [web02]
  
-TASK [exemple01.java : configure java home] **********************************************************************************************************************************************************************+TASK [exemple01.java : configure java home] ******************************************************************************************************************************************************************
 changed: [web02] changed: [web02]
  
-TASK [tomcat : install tomcat] ***********************************************************************************************************************************************************************************+TASK [tomcat : install tomcat] *******************************************************************************************************************************************************************************
 changed: [web02] changed: [web02]
  
-PLAY RECAP ******************************************************************************************************************************************************************************************************* +PLAY RECAP *************************************************************************************************************************************************************************************************** 
-web02                      : ok=4    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0    +web02                      : ok=4    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0     
 </code> </code>
  
Ligne 306: Ligne 309:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh web02+trainee@debian11:~/.ansible/roles$ ssh web02
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux web02.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux web02.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 316: Ligne 319:
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law. permitted by applicable law.
-Last login: Wed Mar  9 13:53:57 2022 from 10.0.2.45+Last login: Sat Sep 23 18:14:46 2023 from 10.0.2.46
 trainee@web02:~$ which tree trainee@web02:~$ which tree
 /usr/bin/tree /usr/bin/tree
Ligne 322: Ligne 325:
 déconnexion déconnexion
 Connection to web02 closed. Connection to web02 closed.
-[trainee@centos8 roles]$ ssh web03 +trainee@debian11:~/.ansible/roles$
-Debian GNU/Linux 9 +
-Linux web03.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 +
- +
-The programs included with the Debian GNU/Linux system are free software; +
-the exact distribution terms for each program are described in the +
-individual files in /usr/share/doc/*/copyright. +
- +
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent +
-permitted by applicable law. +
-Last login: Wed Mar  9 12:12:51 2022 from 10.0.2.45 +
-trainee@web03:~$ which tree +
-trainee@web03:~$ exit +
-déconnexion +
-Connection to web03 closed. +
-[trainee@centos8 roles]+
 </code> </code>
  
Ligne 344: Ligne 332:
 ====2.1 - Variables==== ====2.1 - Variables====
  
-Les **Gabarits** ou //Templates// d'Ansible utilisent une bibliothèque Python qui s'appelle **[[http://jinja.pocoo..org/|Jinja2]]**.+Les **Gabarits** ou //Templates// d'Ansible utilisent une bibliothèque Python qui s'appelle **[[http://jinja.pocoo.org/|Jinja2]]**.
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La documentation des gabarits se trouvent à cette adresse: **[[https://docs.ansible.com/ansible/latest/modules/template_module.html]]**. **Important** : La documentation des gabarits se trouvent à cette adresse: **[[https://docs.ansible.com/ansible/latest/modules/template_module.html]]**.
 </WRAP> </WRAP>
Ligne 355: Ligne 343:
  
 <code> <code>
-[trainee@centos8 roles]$ mkdir /home/trainee/.ansible/roles/haproxy/ +trainee@debian11:~/.ansible/roles$ mkdir /home/trainee/.ansible/roles/haproxy/ 
-[trainee@centos8 roles]$ cd /home/trainee/.ansible/roles/haproxy/ +trainee@debian11:~/.ansible/roles$ cd /home/trainee/.ansible/roles/haproxy/ 
-[trainee@centos8 haproxy]$ mkdir defaults handlers tasks templates +trainee@debian11:~/.ansible/roles/haproxy$ mkdir defaults handlers tasks templates 
-[trainee@centos8 haproxy]$+trainee@debian11:~/.ansible/roles/haproxy$
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que dans ce Rôle nous n'avons besoin que des répertoires **defaults**, **handlers**, **tasks** et **templates**. **Important** : Notez que dans ce Rôle nous n'avons besoin que des répertoires **defaults**, **handlers**, **tasks** et **templates**.
 </WRAP> </WRAP>
Ligne 368: Ligne 356:
  
 <code> <code>
-[trainee@centos8 haproxy]$ vi /home/trainee/.ansible/roles/haproxy/tasks/main.yaml +trainee@debian11:~/.ansible/roles/haproxy$ vi /home/trainee/.ansible/roles/haproxy/tasks/main.yaml 
-[trainee@centos8 haproxy]$ cat /home/trainee/.ansible/roles/haproxy/tasks/main.yaml+trainee@debian11:~/.ansible/roles/haproxy$ cat /home/trainee/.ansible/roles/haproxy/tasks/main.yaml
 ---  --- 
 - name: install - name: install
Ligne 387: Ligne 375:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que l'installation fait appel à un gabarit suivi par un **Handler** qui s'appelle **reload haproxy**. **Important** : Notez que l'installation fait appel à un gabarit suivi par un **Handler** qui s'appelle **reload haproxy**.
 </WRAP> </WRAP>
Ligne 394: Ligne 382:
  
 <code> <code>
-[trainee@centos8 haproxy]$ vi /home/trainee/.ansible/roles/haproxy/handlers/main.yaml +trainee@debian11:~/.ansible/roles/haproxy$ vi /home/trainee/.ansible/roles/haproxy/handlers/main.yaml 
-[trainee@centos8 haproxy]$ cat /home/trainee/.ansible/roles/haproxy/handlers/main.yaml+trainee@debian11:~/.ansible/roles/haproxy$ cat /home/trainee/.ansible/roles/haproxy/handlers/main.yaml
 --- ---
 - name: reload haproxy - name: reload haproxy
Ligne 404: Ligne 392:
  
 <code> <code>
-[trainee@centos8 haproxy]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg +trainee@debian11:~/.ansible/roles/haproxy$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg 
-[trainee@centos8 haproxy]$ cat /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg+trainee@debian11:~/.ansible/roles/haproxy$ cat /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg
 global global
         log /dev/log    local0         log /dev/log    local0
Ligne 461: Ligne 449:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez l'utilisation de deux variables Ansible dans ce fichier - **%%{{ haproxy_listen_address }}%%** et **%%{{haproxy_listen_port}}%%**. **Important** : Notez l'utilisation de deux variables Ansible dans ce fichier - **%%{{ haproxy_listen_address }}%%** et **%%{{haproxy_listen_port}}%%**.
 </WRAP> </WRAP>
Ligne 468: Ligne 456:
  
 <code> <code>
-[trainee@centos8 haproxy]$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml +trainee@debian11:~/.ansible/roles/haproxy$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml 
-[trainee@centos8 haproxy]$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml+trainee@debian11:~/.ansible/roles/haproxy$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml
 --- ---
 haproxy_listen_address: 0.0.0.0 haproxy_listen_address: 0.0.0.0
Ligne 479: Ligne 467:
  
 <code> <code>
-[trainee@centos8 haproxy]$ cd .. +trainee@debian11:~/.ansible/roles/haproxy$ cd .. 
-[trainee@centos8 roles]$ vi playbook.yaml +trainee@debian11:~/.ansible/roles$ vi playbook.yaml 
-[trainee@centos8 roles]$ cat playbook.yaml+trainee@debian11:~/.ansible/roles$ cat playbook.yaml
 --- ---
 - hosts: all - hosts: all
Ligne 492: Ligne 480:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l equilibrage+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l equilibrage
  
-PLAY [all] *******************************************************************************************************************************************************************************************************+PLAY [all] ***************************************************************************************************************************************************************************************************
  
-TASK [Gathering Facts] *******************************************************************************************************************************************************************************************+TASK [Gathering Facts] ***************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-TASK [haproxy : install] *****************************************************************************************************************************************************************************************+TASK [haproxy : install] *************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-TASK [haproxy : configure] ***************************************************************************************************************************************************************************************+TASK [haproxy : configure] ***********************************************************************************************************************************************************************************
 changed: [web04] changed: [web04]
  
-TASK [haproxy : service] *****************************************************************************************************************************************************************************************+TASK [haproxy : service] *************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-RUNNING HANDLER [haproxy : reload haproxy] ***********************************************************************************************************************************************************************+RUNNING HANDLER [haproxy : reload haproxy] *******************************************************************************************************************************************************************
 changed: [web04] changed: [web04]
  
-PLAY RECAP ******************************************************************************************************************************************************************************************************* +PLAY RECAP *************************************************************************************************************************************************************************************************** 
-web04                      : ok=5    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   +web04                      : ok=5    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0    
 </code> </code>
  
Ligne 518: Ligne 506:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh web04+trainee@debian11:~/.ansible/roles$ ssh web04
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 528: Ligne 516:
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law. permitted by applicable law.
-Last login: Wed Mar  9 15:23:48 2022 from 10.0.2.45+Last login: Sat Sep 23 18:24:17 2023 from 10.0.2.46
  
 trainee@web04:~$ systemctl status haproxy trainee@web04:~$ systemctl status haproxy
 ● haproxy.service - HAProxy Load Balancer ● haproxy.service - HAProxy Load Balancer
    Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)    Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
-   Active: active (running) since Wed 2022-03-09 12:03:47 CET3h 20min ago+   Active: active (running) since Wed 2023-09-20 15:39:42 CEST3 days ago
      Docs: man:haproxy(1)      Docs: man:haproxy(1)
            file:/usr/share/doc/haproxy/configuration.txt.gz            file:/usr/share/doc/haproxy/configuration.txt.gz
-  Process: 9089 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS) +  Process: 16494 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS) 
-  Process: 9087 ExecReload=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=0/SUCCESS) +  Process: 16492 ExecReload=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=0/SUCCESS) 
- Main PID: 5394 (haproxy-systemd)+ Main PID: 2970 (haproxy-systemd)
     Tasks: 3 (limit: 4915)     Tasks: 3 (limit: 4915)
    CGroup: /system.slice/haproxy.service    CGroup: /system.slice/haproxy.service
-           ├─5394 /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid +           ├─ 2970 /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid 
-           ├─9091 /usr/sbin/haproxy-master +           ├─16500 /usr/sbin/haproxy-master 
-           └─9093 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds -sf 5400+           └─16501 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds -sf 2975
  
 trainee@web04:~$ cat /etc/haproxy/haproxy.cfg trainee@web04:~$ cat /etc/haproxy/haproxy.cfg
Ligne 603: Ligne 591:
 déconnexion déconnexion
 Connection to web04 closed. Connection to web04 closed.
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$ 
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que les valeurs des variables spécifiées dans le fichier **/home/trainee/.ansible/roles/haproxy/defaults/main.yaml** ont été injectées à la place des variables **%%{{ haproxy_listen_address }}%%** et **%%{{haproxy_listen_port}}%%**. **Important** : Notez que les valeurs des variables spécifiées dans le fichier **/home/trainee/.ansible/roles/haproxy/defaults/main.yaml** ont été injectées à la place des variables **%%{{ haproxy_listen_address }}%%** et **%%{{haproxy_listen_port}}%%**.
 </WRAP> </WRAP>
Ligne 617: Ligne 605:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg 
-[trainee@centos8 roles]$ tail -n 17 /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg+trainee@debian11:~/.ansible/roles$ tail -n 17 /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg
 frontend haproxy frontend haproxy
     bind {{ haproxy_listen_address }}:{{haproxy_listen_port}}     bind {{ haproxy_listen_address }}:{{haproxy_listen_port}}
Ligne 638: Ligne 626:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez la condition **%%{% if haproxy_stats %}%%** qui ne tiendra compte des quatre lignes jusqu'à la ligne **%%{% endif %}%%** que dans le cas où la valeur de la variable **haproxy_stats** est **True**. **Important** : Notez la condition **%%{% if haproxy_stats %}%%** qui ne tiendra compte des quatre lignes jusqu'à la ligne **%%{% endif %}%%** que dans le cas où la valeur de la variable **haproxy_stats** est **True**.
 </WRAP> </WRAP>
Ligne 645: Ligne 633:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml
 --- ---
 haproxy_listen_address: 0.0.0.0 haproxy_listen_address: 0.0.0.0
Ligne 654: Ligne 642:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez qu'Ansible teste si la variable est définie. Par conséquent la variable peut contenir la valeur **True**, **true** voire toute autre chaîne telle que **toto**. **Important** : Notez qu'Ansible teste si la variable est définie. Par conséquent la variable peut contenir la valeur **True**, **true** voire toute autre chaîne telle que **toto**.
 </WRAP> </WRAP>
Ligne 661: Ligne 649:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l equilibrage+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l equilibrage
  
-PLAY [all] *******************************************************************************************************************************************************************************************************+PLAY [all] ***************************************************************************************************************************************************************************************************
  
-TASK [Gathering Facts] *******************************************************************************************************************************************************************************************+TASK [Gathering Facts] ***************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-TASK [haproxy : install] *****************************************************************************************************************************************************************************************+TASK [haproxy : install] *************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-TASK [haproxy : configure] ***************************************************************************************************************************************************************************************+TASK [haproxy : configure] ***********************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-TASK [haproxy : service] *****************************************************************************************************************************************************************************************+TASK [haproxy : service] *************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-PLAY RECAP ******************************************************************************************************************************************************************************************************* +PLAY RECAP *************************************************************************************************************************************************************************************************** 
-web04                      : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0  +web04                      : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
 </code> </code>
  
Ligne 684: Ligne 672:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh web04+trainee@debian11:~/.ansible/roles$ ssh web04
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 695: Ligne 683:
 permitted by applicable law. permitted by applicable law.
 Last login: Wed Mar  9 15:29:27 2022 from 10.0.2.45 Last login: Wed Mar  9 15:29:27 2022 from 10.0.2.45
 +
 trainee@web04:~$ tail -n 17 /etc/haproxy/haproxy.cfg trainee@web04:~$ tail -n 17 /etc/haproxy/haproxy.cfg
         errorfile 504 /etc/haproxy/errors/504.http         errorfile 504 /etc/haproxy/errors/504.http
Ligne 713: Ligne 702:
     server web02 10.0.2.55:8080 check     server web02 10.0.2.55:8080 check
     server web03 10.0.2.56:8080 check     server web03 10.0.2.56:8080 check
 +
 trainee@web04:~$ exit trainee@web04:~$ exit
 déconnexion déconnexion
 Connection to web04 closed. Connection to web04 closed.
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$ 
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que les quatre lignes concernant les statistiques ont été incluses dans le fichier. **Important** : Notez que les quatre lignes concernant les statistiques ont été incluses dans le fichier.
 </WRAP> </WRAP>
Ligne 726: Ligne 716:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml
 --- ---
 haproxy_listen_address: 0.0.0.0 haproxy_listen_address: 0.0.0.0
Ligne 735: Ligne 725:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez qu'Ansible teste si la variable n'est pas définie ou définie avec la valeur de **False** ou **false**. La valeur donc **haproxy_stats:** seule est considérée comme étant fausse.  **Important** : Notez qu'Ansible teste si la variable n'est pas définie ou définie avec la valeur de **False** ou **false**. La valeur donc **haproxy_stats:** seule est considérée comme étant fausse. 
 </WRAP> </WRAP>
Ligne 743: Ligne 733:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l equilibrage+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l equilibrage
  
-PLAY [all] *******************************************************************************************************************************************************************************************************+PLAY [all] ***************************************************************************************************************************************************************************************************
  
-TASK [Gathering Facts] *******************************************************************************************************************************************************************************************+TASK [Gathering Facts] ***************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-TASK [haproxy : install] *****************************************************************************************************************************************************************************************+TASK [haproxy : install] *************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-TASK [haproxy : configure] ***************************************************************************************************************************************************************************************+TASK [haproxy : configure] ***********************************************************************************************************************************************************************************
 changed: [web04] changed: [web04]
  
-TASK [haproxy : service] *****************************************************************************************************************************************************************************************+TASK [haproxy : service] *************************************************************************************************************************************************************************************
 ok: [web04] ok: [web04]
  
-RUNNING HANDLER [haproxy : reload haproxy] ***********************************************************************************************************************************************************************+RUNNING HANDLER [haproxy : reload haproxy] *******************************************************************************************************************************************************************
 changed: [web04] changed: [web04]
  
-PLAY RECAP ******************************************************************************************************************************************************************************************************* +PLAY RECAP *************************************************************************************************************************************************************************************************** 
-web04                      : ok=5    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 +web04                      : ok=5    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
 </code> </code>
  
Ligne 769: Ligne 759:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh web04+trainee@debian11:~/.ansible/roles$ ssh web04
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 779: Ligne 769:
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law. permitted by applicable law.
-Last login: Wed Mar  9 15:32:20 2022 from 10.0.2.45+Last login: Sat Sep 23 18:31:28 2023 from 10.0.2.46 
 trainee@web04:~$ tail -n 17 /etc/haproxy/haproxy.cfg trainee@web04:~$ tail -n 17 /etc/haproxy/haproxy.cfg
         errorfile 408 /etc/haproxy/errors/408.http         errorfile 408 /etc/haproxy/errors/408.http
Ligne 798: Ligne 789:
     server web02 10.0.2.55:8080 check     server web02 10.0.2.55:8080 check
     server web03 10.0.2.56:8080 check     server web03 10.0.2.56:8080 check
 +
 trainee@web04:~$ exit trainee@web04:~$ exit
 déconnexion déconnexion
 Connection to web04 closed. Connection to web04 closed.
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que les quatre lignes concernant les statistiques n'ont pas été incluses dans le fichier. **Important** : Notez que les quatre lignes concernant les statistiques n'ont pas été incluses dans le fichier.
 </WRAP> </WRAP>
Ligne 831: Ligne 823:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml
 --- ---
 haproxy_listen_address: 0.0.0.0 haproxy_listen_address: 0.0.0.0
Ligne 843: Ligne 835:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que la variable **haproxy_backends** est une liste YAML. **Important** : Notez que la variable **haproxy_backends** est une liste YAML.
 </WRAP> </WRAP>
Ligne 850: Ligne 842:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg 
-[trainee@centos8 roles]$ tail /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg+trainee@debian11:~/.ansible/roles$ tail /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg
     stats auth admin:admin     stats auth admin:admin
 {% endif %} {% endif %}
Ligne 867: Ligne 859:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml
 --- ---
 haproxy_listen_address: 0.0.0.0 haproxy_listen_address: 0.0.0.0
Ligne 884: Ligne 876:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg 
-[trainee@centos8 roles]$ tail /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg+trainee@debian11:~/.ansible/roles$ tail /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg
     stats auth admin:admin     stats auth admin:admin
 {% endif %} {% endif %}
Ligne 903: Ligne 895:
  
 <code> <code>
-[trainee@centos8 roles]$ vi backend.j2 +trainee@debian11:~/.ansible/roles$ vi backend.j2 
-[trainee@centos8 roles]$ cat backend.j2+trainee@debian11:~/.ansible/roles$ cat backend.j2
 {% macro backend(name, ip, port=8080) -%} {% macro backend(name, ip, port=8080) -%}
     server {{ name }} {{ ip }}:{{ port }} check     server {{ name }} {{ ip }}:{{ port }} check
Ligne 913: Ligne 905:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg 
-[trainee@centos8 roles]$ tail /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg+trainee@debian11:~/.ansible/roles$ tail /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg
 {% endif %} {% endif %}
     balance roundrobin     balance roundrobin
Ligne 934: Ligne 926:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg 
-[trainee@centos8 roles]$ tail -n 17 /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg+trainee@debian11:~/.ansible/roles$ tail -n 17 /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg
     bind {{ haproxy_listen_address }}:{{haproxy_listen_port|default('80') }}     bind {{ haproxy_listen_address }}:{{haproxy_listen_port|default('80') }}
     mode http     mode http
Ligne 958: Ligne 950:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/defaults/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/defaults/main.yaml
 --- ---
 haproxy_listen_address: 0.0.0.0 haproxy_listen_address: 0.0.0.0
Ligne 973: Ligne 965:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l equilibrage+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l equilibrage
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 999: Ligne 991:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh web04+trainee@debian11:~/.ansible/roles$ ssh web04
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 1031: Ligne 1023:
 déconnexion déconnexion
 Connection to web04 closed. Connection to web04 closed.
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$ 
 </code> </code>
  
Ligne 1089: Ligne 1081:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/templates/haproxy.cfg
 global global
         log /dev/log    local0         log /dev/log    local0
Ligne 1116: Ligne 1108:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Ce gabarit ne contient que des directives générales. Les directives spécifiques au protocole http ont été remplacées par des **blocs** nommés **globals**, **defaults** et **server**. **Important** : Ce gabarit ne contient que des directives générales. Les directives spécifiques au protocole http ont été remplacées par des **blocs** nommés **globals**, **defaults** et **server**.
 </WRAP> </WRAP>
Ligne 1125: Ligne 1117:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.http.cfg +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/templates/haproxy.http.cfg 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/templates/haproxy.http.cfg+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/templates/haproxy.http.cfg
 {% extends 'haproxy.cfg' %} {% extends 'haproxy.cfg' %}
 {% block globals %} {% block globals %}
Ligne 1167: Ligne 1159:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que les **blocs** nommés **globals**, **defaults** et **server** contiennent les directives qui seront injectées dans le fichier **haproxy.cfg** aux emplacements des trois blocs respectifs. **Important** : Notez que les **blocs** nommés **globals**, **defaults** et **server** contiennent les directives qui seront injectées dans le fichier **haproxy.cfg** aux emplacements des trois blocs respectifs.
 </WRAP> </WRAP>
Ligne 1174: Ligne 1166:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/haproxy/tasks/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/haproxy/tasks/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/haproxy/tasks/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/haproxy/tasks/main.yaml
 --- ---
 - name: install - name: install
Ligne 1196: Ligne 1188:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l equilibrage+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l equilibrage
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1222: Ligne 1214:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh web04+trainee@debian11:~/.ansible/roles$ ssh web04
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux web04.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 1282: Ligne 1274:
 déconnexion déconnexion
 Connection to web04 closed. Connection to web04 closed.
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$ 
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que les **blocs** nommés **globals**, **defaults** et **server** ont été renseignés. **Important** : Notez que les **blocs** nommés **globals**, **defaults** et **server** ont été renseignés.
 </WRAP> </WRAP>
Ligne 1313: Ligne 1305:
  
 <code> <code>
-[trainee@centos8 roles]$ cd ../../ +trainee@debian11:~/.ansible/roles$ cd ../../ 
-[trainee@centos8 ~]$ mkdir /home/trainee/.ansible/roles/debug +trainee@debian11:~$ mkdir /home/trainee/.ansible/roles/debug 
-[trainee@centos8 ~]$ mkdir /home/trainee/.ansible/roles/debug/defaults +trainee@debian11:~$ mkdir /home/trainee/.ansible/roles/debug/defaults 
-[trainee@centos8 ~]$ mkdir /home/trainee/.ansible/roles/debug/tasks +trainee@debian11:~$ mkdir /home/trainee/.ansible/roles/debug/tasks 
-[trainee@centos8 ~]+trainee@debian11:~$ 
 </code> </code>
  
Ligne 1323: Ligne 1315:
  
 <code> <code>
-[trainee@centos8 ~]$ touch /home/trainee/.ansible/roles/debug/defaults/main.yaml +trainee@debian11:~$ touch /home/trainee/.ansible/roles/debug/defaults/main.yaml 
-[trainee@centos8 ~]$ touch  /home/trainee/.ansible/roles/debug/tasks/main.yaml +trainee@debian11:~$ touch  /home/trainee/.ansible/roles/debug/tasks/main.yaml 
-[trainee@centos8 ~]+trainee@debian11:~$ 
 </code> </code>
  
Ligne 1331: Ligne 1323:
  
 <code> <code>
-[trainee@centos8 ~]$ cd .ansible/roles/ +trainee@debian11:~$ cd .ansible/roles/ 
-[trainee@centos8 roles]$ tree debug+trainee@debian11:~/.ansible/roles$ tree debug
 debug debug
 ├── defaults ├── defaults
Ligne 1345: Ligne 1337:
  
 <code> <code>
-[trainee@centos8 roles]$ mkdir /home/trainee/.ansible/roles/group_vars +trainee@debian11:~/.ansible/roles$ mkdir /home/trainee/.ansible/roles/group_vars 
-[trainee@centos8 roles]$ touch /home/trainee/.ansible/roles/group_vars/all.yaml +trainee@debian11:~/.ansible/roles$ touch /home/trainee/.ansible/roles/group_vars/all.yaml 
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$ 
 </code> </code>
  
Ligne 1353: Ligne 1345:
  
 <code> <code>
-[trainee@centos8 roles]$ tree group_vars/+trainee@debian11:~/.ansible/roles$ tree group_vars/
 group_vars/ group_vars/
 └── all.yaml └── all.yaml
Ligne 1363: Ligne 1355:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/debug/tasks/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/debug/tasks/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/debug/tasks/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/debug/tasks/main.yaml
 --- ---
 - debug: - debug:
Ligne 1373: Ligne 1365:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/playbook.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/playbook.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/playbook.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/playbook.yaml
 --- ---
 - hosts: all - hosts: all
Ligne 1384: Ligne 1376:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1418: Ligne 1410:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/debug/defaults/main.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/debug/defaults/main.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/debug/defaults/main.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/debug/defaults/main.yaml
 --- ---
 endroit: 'roles/debug/defaults/main.yaml' endroit: 'roles/debug/defaults/main.yaml'
Ligne 1427: Ligne 1419:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1458: Ligne 1450:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La variable fixée dans **defaults/main.yaml** surcharge la variable fixée dans **tasks/main.yaml**. **Important** : La variable fixée dans **defaults/main.yaml** surcharge la variable fixée dans **tasks/main.yaml**.
 </WRAP> </WRAP>
Ligne 1465: Ligne 1457:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/group_vars/all.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/group_vars/all.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/group_vars/all.yaml
 --- ---
 endroit: 'roles/group_vars/all.yaml' endroit: 'roles/group_vars/all.yaml'
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La déclaration de la variable peut être faite dans **roles/group_vars/all** ou dans **roles/group_vars/all.yaml** ou dans un fichier *.yaml dans le répertoire **roles/group_vars/all/**. **Important** : La déclaration de la variable peut être faite dans **roles/group_vars/all** ou dans **roles/group_vars/all.yaml** ou dans un fichier *.yaml dans le répertoire **roles/group_vars/all/**.
 </WRAP> </WRAP>
Ligne 1478: Ligne 1470:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1509: Ligne 1501:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La variable fixée dans **group_vars/all.yaml** surcharge la variable fixée dans **defaults/main.yaml** qui surcharge la variable fixée dans **tasks/main.yaml**. **Important** : La variable fixée dans **group_vars/all.yaml** surcharge la variable fixée dans **defaults/main.yaml** qui surcharge la variable fixée dans **tasks/main.yaml**.
 </WRAP> </WRAP>
Ligne 1516: Ligne 1508:
  
 <code> <code>
-[trainee@centos8 roles]$ vi playbook.yaml +trainee@debian11:~/.ansible/roles$ vi playbook.yaml 
-[trainee@centos8 roles]$ cat playbook.yaml+trainee@debian11:~/.ansible/roles$ cat playbook.yaml
 --- ---
 - hosts: all - hosts: all
Ligne 1527: Ligne 1519:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1558: Ligne 1550:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La variable fixée dans **playbook.yaml** surcharge la variable fixée dans **group_vars/all.yaml** qui surcharge la variable fixée dans **defaults/main.yaml** qui surcharge la variable fixée dans **tasks/main.yaml**. **Important** : La variable fixée dans **playbook.yaml** surcharge la variable fixée dans **group_vars/all.yaml** qui surcharge la variable fixée dans **defaults/main.yaml** qui surcharge la variable fixée dans **tasks/main.yaml**.
 </WRAP> </WRAP>
Ligne 1565: Ligne 1557:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/group_vars/group1.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/group_vars/group1.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/group_vars/group1.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/group_vars/group1.yaml
 --- ---
 endroit: 'group_vars/group1.yaml' endroit: 'group_vars/group1.yaml'
Ligne 1574: Ligne 1566:
  
 <code> <code>
-[trainee@centos8 roles]$ mkdir /home/trainee/.ansible/roles/host_vars +trainee@debian11:~/.ansible/roles$ mkdir /home/trainee/.ansible/roles/host_vars 
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/host_vars/localhost.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/host_vars/localhost.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/host_vars/localhost.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/host_vars/localhost.yaml
 --- ---
 # endroit: 'host_vars/localhost.yaml' # endroit: 'host_vars/localhost.yaml'
Ligne 1584: Ligne 1576:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/playbook.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/playbook.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/playbook.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/playbook.yaml
 --- ---
 - hosts: all - hosts: all
Ligne 1595: Ligne 1587:
  
 <code> <code>
-[trainee@centos8 roles]$ vi inventory +trainee@debian11:~/.ansible/roles$ vi inventory 
-[trainee@centos8 roles]$ cat inventory+trainee@debian11:~/.ansible/roles$ cat inventory
 localhost ansible_connection=local localhost ansible_connection=local
  
Ligne 1621: Ligne 1613:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1657: Ligne 1649:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que la valeur de la variable **endroit** spécifiée dans le fichier **group_vars/all.yaml** s'applique à tous les groupes **et** à tous les hôtes. **Important** : Notez que la valeur de la variable **endroit** spécifiée dans le fichier **group_vars/all.yaml** s'applique à tous les groupes **et** à tous les hôtes.
 </WRAP> </WRAP>
Ligne 1664: Ligne 1656:
  
 <code> <code>
-[trainee@centos8 roles]$ vi inventory +trainee@debian11:~/.ansible/roles$ vi inventory 
-[trainee@centos8 roles]$ cat inventory+trainee@debian11:~/.ansible/roles$ cat inventory
 [group1] [group1]
 localhost ansible_connection=local localhost ansible_connection=local
Ligne 1691: Ligne 1683:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1727: Ligne 1719:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La variable fixée dans **group_vars/group1.yaml** surcharge la variable fixée dans **group_vars/all.yaml**. **Important** : La variable fixée dans **group_vars/group1.yaml** surcharge la variable fixée dans **group_vars/all.yaml**.
 </WRAP> </WRAP>
Ligne 1734: Ligne 1726:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/host_vars/localhost.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/host_vars/localhost.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/host_vars/localhost.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/host_vars/localhost.yaml
 --- ---
 endroit: 'host_vars/localhost.yaml' endroit: 'host_vars/localhost.yaml'
Ligne 1743: Ligne 1735:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1779: Ligne 1771:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La variable fixée dans **host_vars/localhost.yaml** surcharge la variable fixée dans **group_vars/group1.yaml** qui surcharge la variable fixée dans **group_vars/all.yaml**. **Important** : La variable fixée dans **host_vars/localhost.yaml** surcharge la variable fixée dans **group_vars/group1.yaml** qui surcharge la variable fixée dans **group_vars/all.yaml**.
 </WRAP> </WRAP>
Ligne 1786: Ligne 1778:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -e 'endroit="la ligne de commande"'+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -e 'endroit="la ligne de commande"'
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 1822: Ligne 1814:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : La variable fixée dans sur la **ligne de commande** surcharge toutes les autres variables. **Important** : La variable fixée dans sur la **ligne de commande** surcharge toutes les autres variables.
 </WRAP> </WRAP>
Ligne 1836: Ligne 1828:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible all -i web01, -m setup | more+trainee@debian11:~/.ansible/roles$ ansible all -i web01, -m setup | more
 web01 | SUCCESS => { web01 | SUCCESS => {
     "ansible_facts": {     "ansible_facts": {
Ligne 1896: Ligne 1888:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le nom de chaque **Fact** commence par **ansible_**. Évitez donc de créer des variables commençant var cette valeur ! **Important** : Notez que le nom de chaque **Fact** commence par **ansible_**. Évitez donc de créer des variables commençant var cette valeur !
 </WRAP> </WRAP>
Ligne 1933: Ligne 1925:
  
 <code> <code>
-[trainee@centos8 roles]$ vi inventory +trainee@debian11:~/.ansible/roles$ vi inventory 
-[trainee@centos8 roles]$ cat inventory+trainee@debian11:~/.ansible/roles$ cat inventory
 [linux] [linux]
 targeta targeta
Ligne 1964: Ligne 1956:
  
 <code> <code>
-[trainee@centos8 roles]$ vi playbook.yaml +trainee@debian11:~/.ansible/roles$ vi playbook.yaml 
-[trainee@centos8 roles]$ cat playbook.yaml+trainee@debian11:~/.ansible/roles$ cat playbook.yaml
 --- ---
 - hosts: all - hosts: all
Ligne 1973: Ligne 1965:
 </code> </code>
  
-Connectez-vous à la machine TargetA et supprimez le paquet **openjdk-8-jre** :+Utilisez la commande scp pour copier le fichier authorized_keys de la machine virtuelle debian11 vers la machine virtuelle targetb :
  
 <code> <code>
-[trainee@centos8 roles]$ ssh 10.0.2.52 +trainee@debian11:~/.ansible/roles$ cd ~ 
-Debian GNU/Linux 9 +trainee@debian11:~$ scp .ssh/authorized_keys trainee@10.0.2.53:/home/trainee/.ssh/authorized_keys 
-Linux targeta.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 +trainee@10.0.2.53's password: trainee
- +
-The programs included with the Debian GNU/Linux system are free software; +
-the exact distribution terms for each program are described in the +
-individual files in /usr/share/doc/*/copyright. +
- +
-Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent +
-permitted by applicable law. +
-Last login: Wed Mar  9 11:29:25 2022 from 10.0.2.45 +
-trainee@targeta:~$ sudo apt-get -y remove openjdk-8-jre +
-... +
-trainee@targeta:~$ exit +
-déconnexion +
-Connection to 10.0.2.52 closed. +
-[trainee@centos8 roles]$ +
-</code> +
- +
-Utilisez la commande scp pour copier le fichier authorized_keys de la machine virtuelle centos8 vers la machine virtuelle targetb : +
- +
-<code> +
-[trainee@centos8 roles]$ cd ~ +
-[trainee@centos8 ~]$ scp .ssh/authorized_keys trainee@10.0.2.53:/home/trainee/.ssh/authorized_keys +
-trainee@10.0.2.53's password: +
 authorized_keys                                                                                                                                                                 100%  888     8.9KB/  00:00     authorized_keys                                                                                                                                                                 100%  888     8.9KB/  00:00    
-[trainee@centos8 ~]$ cd -+trainee@debian11:~$ cd -
 /home/trainee/.ansible/roles /home/trainee/.ansible/roles
-[trainee@centos8 roles]$  +trainee@debian11:~/.ansible/roles$ 
-</code> +
- +
-Connectez-vous à la machine TargetB et supprimez le paquet **java-1.8.0-openjdk** : +
- +
-<code> +
-[trainee@centos8 roles]$ ssh 10.0.2.53 +
-Last login: Wed Mar  9 16:51:41 2022 from 10.0.2.45 +
-[trainee@targetb ~]$ sudo yum -y remove java-1.8.0-openjdk +
-... +
-[trainee@targetb ~]$ exit +
-logout +
-Connection to 10.0.2.53 closed. +
-[trainee@centos8 roles]+
 </code> </code>
  
Ligne 2023: Ligne 1980:
  
 <code> <code>
-[trainee@centos8 roles]$ vi exemple01.java/tasks/main.yaml +trainee@debian11:~/.ansible/roles$ vi exemple01.java/tasks/main.yaml 
-[trainee@centos8 roles]$ cat exemple01.java/tasks/main.yaml+trainee@debian11:~/.ansible/roles$ cat exemple01.java/tasks/main.yaml
 --- ---
 - name: install jre (Debian) - name: install jre (Debian)
Ligne 2035: Ligne 1992:
 </code> </code>
  
-Modifiez le fichier **/etc/hosts** de la machine **centos8** :+Modifiez le fichier **/etc/hosts** de la machine **debian11** :
  
 <code> <code>
-[trainee@centos8 roles]$ su -+trainee@debian11:~/.ansible/roles$ su -
 Password: fenestros Password: fenestros
-[root@centos8 ~]# vi /etc/hosts + 
-[root@centos8 ~]# cat /etc/hosts +root@debian11:~# vi /etc/hosts 
-127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 + 
-::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 +root@debian11:~# cat /etc/hosts 
-10.0.2.45 centos8.ittraining.loc centos8+127.0.0.1       localhost 
 +10.0.2.46       debian11.ittraining.loc debian11
 10.0.2.54 web01.i2tch.loc web01 10.0.2.54 web01.i2tch.loc web01
 10.0.2.55 web02.i2tch.loc web02 10.0.2.55 web02.i2tch.loc web02
Ligne 2051: Ligne 2009:
 10.0.2.52 targeta.i2tch.loc targeta  10.0.2.52 targeta.i2tch.loc targeta 
 10.0.2.53 targetb.i2tch.loc targetb 10.0.2.53 targetb.i2tch.loc targetb
-[root@centos8 ~]# exit+ 
 +# The following lines are desirable for IPv6 capable hosts 
 +::1     localhost ip6-localhost ip6-loopback 
 +ff02::1 ip6-allnodes 
 +ff02::2 ip6-allrouters 
 + 
 +root@debian11:~# exit
 logout logout
-[trainee@centos8 roles]$+ 
 +trainee@debian11:~/.ansible/roles$
 </code> </code>
  
Ligne 2059: Ligne 2024:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh targeta +trainee@debian11:~/.ansible/roles$ ssh targeta
-The authenticity of host 'targeta (10.0.2.52)' can't be established. +
-ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. +
-Are you sure you want to continue connecting (yes/no/[fingerprint])? yes +
-Warning: Permanently added 'targeta' (ECDSA) to the list of known hosts.+
 Debian GNU/Linux 9 Debian GNU/Linux 9
 Linux targeta.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 Linux targeta.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
Ligne 2073: Ligne 2034:
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law. permitted by applicable law.
-Last login: Wed Mar  9 16:52:16 2022 from 10.0.2.45+Last login: Wed Sep 20 16:16:07 2023 from 10.0.2.46 
 +trainee@targeta:~$ 
 +</code> 
 + 
 +Modifiez le contenu du fichier **/etc/apt/sources.list** : 
 + 
 +<code> 
 +trainee@targeta:~$ sudo vi /etc/apt/sources.list 
 + 
 +trainee@targeta:~$ cat /etc/apt/sources.list 
 +#  
 + 
 +# deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main 
 + 
 +#deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main 
 + 
 +deb http://archive.debian.org/debian/ stretch main 
 +deb-src http://archive.debian.org/debian/ stretch main 
 + 
 +deb http://archive.debian.org/debian-security stretch/updates main 
 +deb-src http://archive.debian.org/debian-security stretch/updates main
  
 trainee@targeta:~$ sudo apt update trainee@targeta:~$ sudo apt update
-Réception de:1 http://security.debian.org/debian-security stretch/updates InRelease [53,0 kB] +Ign:1 http://archive.debian.org/debian stretch InRelease 
-Ign:2 http://ftp.fr.debian.org/debian stretch InRelease                +Réception de:2 http://archive.debian.org/debian-security stretch/updates InRelease [59,kB] 
-Réception de:3 http://ftp.fr.debian.org/debian stretch-updates InRelease [93,kB] +Réception de:http://archive.debian.org/debian stretch Release [118 kB] 
-Réception de:http://ftp.fr.debian.org/debian stretch Release [118 kB] +Réception de:http://archive.debian.org/debian stretch Release.gpg [3 177 B] 
-Réception de:http://ftp.fr.debian.org/debian stretch Release.gpg [3 177 B] +Réception de:http://archive.debian.org/debian-security stretch/updates/main Sources [413 kB] 
-Réception de:http://security.debian.org/debian-security stretch/updates/main Sources [396 kB] +Réception de:http://archive.debian.org/debian-security stretch/updates/main amd64 Packages [782 kB] 
-Réception de:http://security.debian.org/debian-security stretch/updates/main amd64 Packages [759 kB] +Réception de:http://archive.debian.org/debian-security stretch/updates/main Translation-en [368 kB] 
-Réception de:http://security.debian.org/debian-security stretch/updates/main Translation-en [354 kB] +Réception de:http://archive.debian.org/debian stretch/main Sources [6 736 kB] 
-Réception de:http://ftp.fr.debian.org/debian stretch/main Sources [6 736 kB]        +Réception de:http://archive.debian.org/debian stretch/main amd64 Packages [7 080 kB] 
-Réception de:10 http://ftp.fr.debian.org/debian stretch/main amd64 Packages [7 080 kB] +Réception de:10 http://archive.debian.org/debian stretch/main Translation-fr [1 894 kB] 
-Réception de:11 http://ftp.fr.debian.org/debian stretch/main Translation-en [5 377 kB] +Réception de:11 http://archive.debian.org/debian stretch/main Translation-en [5 377 kB] 
-21,Mo réceptionnés en 7s (2 753 ko/s)                                                                                                                                                                          +22,Mo réceptionnés en 27s (843 ko/s)                                                                                                                                                                       
 Lecture des listes de paquets... Fait Lecture des listes de paquets... Fait
 Construction de l'arbre des dépendances        Construction de l'arbre des dépendances       
 Lecture des informations d'état... Fait Lecture des informations d'état... Fait
-333 packages can be upgraded. Run 'apt list --upgradable' to see them.+353 packages can be upgraded. Run 'apt list --upgradable' to see them. 
 +</code>
  
 +Supprimez le paquet **openjdk-8-jre** :
 +
 +<code>
 +trainee@targeta:~$ sudo apt-get -y remove openjdk-8-jre
 +...
 trainee@targeta:~$ exit trainee@targeta:~$ exit
 déconnexion déconnexion
Ligne 2101: Ligne 2088:
  
 <code> <code>
-[trainee@centos8 roles]$ ssh targetb+trainee@debian11:~/.ansible/roles$ ssh targetb
 The authenticity of host 'targetb (10.0.2.53)' can't be established. The authenticity of host 'targetb (10.0.2.53)' can't be established.
 ECDSA key fingerprint is SHA256:RgOsp/XI7JHNq+oIfHKw+jkHdtTnBIh+Dd7kVmHRxtU. ECDSA key fingerprint is SHA256:RgOsp/XI7JHNq+oIfHKw+jkHdtTnBIh+Dd7kVmHRxtU.
 Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
-Warning: Permanently added 'targetb' (ECDSA) to the list of known hosts. +Warning: Permanently added 'targetb,10.0.2.53' (ECDSA) to the list of known hosts. 
-Last login: Wed Mar  9 16:56:33 2022 from 10.0.2.45+trainee@targetb's password:  
 +Last login: Sun Mar 21 08:53:18 2021 from 10.0.2.10
  
 [trainee@targetb ~]$ yum clean all [trainee@targetb ~]$ yum clean all
 Loaded plugins: fastestmirror, langpacks Loaded plugins: fastestmirror, langpacks
 +Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
 Cleaning repos: base extras updates Cleaning repos: base extras updates
-Other repos take up 190 M of disk space (use --verbose for details)+Other repos take up 119 M of disk space (use --verbose for details)
  
 [trainee@targetb ~]$ sudo yum -y makecache [trainee@targetb ~]$ sudo yum -y makecache
Ligne 2129: Ligne 2118:
 (6/6): updates/7/x86_64/filelists_db                                                                                                                                                       | 7.8 MB  00:00:00      (6/6): updates/7/x86_64/filelists_db                                                                                                                                                       | 7.8 MB  00:00:00     
 Metadata Cache Created Metadata Cache Created
 +</code>
  
 +Supprimez le paquet **java-1.8.0-openjdk** :
 +
 +<code>
 +[trainee@targetb ~]$ sudo yum -y remove java-1.8.0-openjdk
 +...
 [trainee@targetb ~]$ exit [trainee@targetb ~]$ exit
 logout logout
 Connection to targetb closed. Connection to targetb closed.
-[trainee@centos8 roles]$+trainee@debian11:~/.ansible/roles$
 </code> </code>
  
Ligne 2139: Ligne 2134:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l linux+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l linux
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 2177: Ligne 2172:
  
 <code> <code>
-[trainee@centos8 roles]$ mkdir vault+trainee@debian11:~/.ansible/roles$ mkdir vault
 </code> </code>
  
Ligne 2183: Ligne 2178:
  
 <code> <code>
-[trainee@centos8 roles]$ vi /home/trainee/.ansible/roles/group_vars/all.yaml +trainee@debian11:~/.ansible/roles$ vi /home/trainee/.ansible/roles/group_vars/all.yaml 
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/group_vars/all.yaml
 --- ---
 secret: gardezmoisecret secret: gardezmoisecret
Ligne 2192: Ligne 2187:
  
 <code> <code>
-[trainee@centos8 roles]$ vi playbook.yaml +trainee@debian11:~/.ansible/roles$ vi playbook.yaml 
-[trainee@centos8 roles]$ cat playbook.yaml+trainee@debian11:~/.ansible/roles$ cat playbook.yaml
 --- ---
 - hosts: all - hosts: all
Ligne 2204: Ligne 2199:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l localhost+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l localhost
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 2220: Ligne 2215:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : L'exécution démontre que la variable **secret** est bien lue. **Important** : L'exécution démontre que la variable **secret** est bien lue.
 </WRAP> </WRAP>
Ligne 2229: Ligne 2224:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-vault encrypt group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ ansible-vault encrypt group_vars/all.yaml
 New Vault password: fenestros New Vault password: fenestros
 Confirm New Vault password: fenestros Confirm New Vault password: fenestros
 Encryption successful Encryption successful
-[trainee@centos8 roles]+trainee@debian11:~/.ansible/roles$ 
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair. **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair.
 </WRAP> </WRAP>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le mot de passe est pour la commande **ansible-vault** et non pas uniquement pour l'action de cryptage en cours. **Important** : Notez que le mot de passe est pour la commande **ansible-vault** et non pas uniquement pour l'action de cryptage en cours.
 </WRAP> </WRAP>
Ligne 2247: Ligne 2242:
  
 <code> <code>
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/group_vars/all.yaml
 $ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
 33343664333931323331346338346439613439633633396262393733663463363438663163383761 33343664333931323331346338346439613439633633396262393733663463363438663163383761
Ligne 2259: Ligne 2254:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l localhost+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l localhost
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 2265: Ligne 2260:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez l'erreur due au fait que le fichier a été crypté. **Important** : Notez l'erreur due au fait que le fichier a été crypté.
 </WRAP> </WRAP>
Ligne 2272: Ligne 2267:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l localhost+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l localhost
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
 ERROR! Attempting to decrypt but no vault secrets found ERROR! Attempting to decrypt but no vault secrets found
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l localhost --ask-vault-pass+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l localhost --ask-vault-pass
 Vault password: fenestros Vault password: fenestros
  
Ligne 2293: Ligne 2288:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair. **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair.
 </WRAP> </WRAP>
Ligne 2302: Ligne 2297:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-vault edit group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ ansible-vault edit group_vars/all.yaml
 Vault password: fenestros Vault password: fenestros
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair. **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair.
 </WRAP> </WRAP>
Ligne 2345: Ligne 2340:
  
 <code> <code>
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/group_vars/all.yaml
 $ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
 36633861376466313363373336643832646663666334633931663262666361306236386232316461 36633861376466313363373336643832646663666334633931663262666361306236386232316461
Ligne 2357: Ligne 2352:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l localhost --ask-vault-pass+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l localhost --ask-vault-pass
 Vault password: fenestros Vault password: fenestros
  
Ligne 2374: Ligne 2369:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair. **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair.
 </WRAP> </WRAP>
Ligne 2383: Ligne 2378:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-vault decrypt group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ ansible-vault decrypt group_vars/all.yaml
 Vault password: fenestros Vault password: fenestros
 Decryption successful Decryption successful
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair. **Important** : Notez que le mot de passe **fenestros** ne sera pas en clair.
 </WRAP> </WRAP>
Ligne 2395: Ligne 2390:
  
 <code> <code>
-[trainee@centos8 roles]$ cat /home/trainee/.ansible/roles/group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ cat /home/trainee/.ansible/roles/group_vars/all.yaml
 --- ---
 secret: gardezlesecret secret: gardezlesecret
Ligne 2405: Ligne 2400:
  
 <code> <code>
-[trainee@centos8 roles]$ su -+trainee@debian11:~/.ansible/roles$ which pwgen 
 +trainee@debian11:~/.ansible/roles$ su -
 Password: fenestros Password: fenestros
-[root@centos8 ~]#+root@debian11:~# apt install pwgen 
 +Reading package lists... Done 
 +Building dependency tree... Done 
 +Reading state information... Done 
 +The following packages were automatically installed and are no longer required: 
 +  libopengl0 linux-headers-5.10.0-15-amd64 linux-headers-5.10.0-15-common 
 +Use 'apt autoremove' to remove them. 
 +The following NEW packages will be installed: 
 +  pwgen 
 +0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded. 
 +Need to get 19.6 kB of archives. 
 +After this operation, 52.2 kB of additional disk space will be used. 
 +Get:1 http://deb.debian.org/debian bullseye/main amd64 pwgen amd64 2.08-2 [19.6 kB] 
 +Fetched 19.6 kB in 0s (749 kB/s)  
 +Selecting previously unselected package pwgen. 
 +(Reading database ... 206562 files and directories currently installed.) 
 +Preparing to unpack .../pwgen_2.08-2_amd64.deb ... 
 +Unpacking pwgen (2.08-2) ... 
 +Setting up pwgen (2.08-2) ... 
 +Processing triggers for man-db (2.9.4-2) ... 
 +root@debian11:~exit 
 +logout
  
-[root@centos8 ~]# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +trainee@debian11:~/.ansible/roles$ 
-Last metadata expiration check: 1:30:37 ago on Wed 09 Mar 2022 10:10:01 EST. +
-epel-release-latest-8.noarch.rpm                                                                                                                                                   47 kB/s |  22 kB     00:00     +
-Dependencies resolved. +
-================================================================================================================================================================================================================== +
- Package                                              Architecture                                   Version                                           Repository                                            Size +
-================================================================================================================================================================================================================== +
-Installing: +
- epel-release                                         noarch                                         8-14.el8                                          @commandline                                          22 k +
- +
-Transaction Summary +
-================================================================================================================================================================================================================== +
-Install  1 Package +
- +
-Total size: 22 k +
-Installed size: 32 k +
-Is this ok [y/N]: y +
-Downloading Packages: +
-Running transaction check +
-Transaction check succeeded. +
-Running transaction test +
-Transaction test succeeded. +
-Running transaction +
-  Preparing        :                                                                                                                                                                                          1/1  +
-  Installing       : epel-release-8-14.el8.noarch                                                                                                                                                             1/1  +
-  Running scriptlet: epel-release-8-14.el8.noarch                                                                                                                                                             1/1  +
-  Verifying        : epel-release-8-14.el8.noarch                                                                                                                                                             1/1  +
-Installed products updated. +
- +
-Installed: +
-  epel-release-8-14.el8.noarch                                                                                                                                                                                     +
- +
-Complete! +
- +
-[root@centos8 ~]# dnf install pwgen +
-Extra Packages for Enterprise Linux 8 - x86_64                                                                                                                                    1.1 MB/s |  11 MB     00:09     +
-Extra Packages for Enterprise Linux Modular 8 - x86_64                                                                                                                            530 kB/s | 979 kB     00:01     +
-Last metadata expiration check: 0:00:01 ago on Wed 09 Mar 2022 11:41:14 EST. +
-Dependencies resolved. +
-================================================================================================================================================================================================================== +
- Package                                          Architecture                                      Version                                                 Repository                                       Size +
-================================================================================================================================================================================================================== +
-Installing: +
- pwgen                                            x86_64                                            2.08-3.el8                                              epel                                             31 k +
- +
-Transaction Summary +
-================================================================================================================================================================================================================== +
-Install  1 Package +
- +
-Total download size: 31 k +
-Installed size: 46 k +
-Is this ok [y/N]: y +
- +
-[root@centos8 ~]# exit +
-logout +
-[trainee@centos8 roles]+
 </code> </code>
  
Ligne 2470: Ligne 2432:
  
 <code> <code>
-[trainee@centos8 roles]$ pwgen 16 1+trainee@debian11:~/.ansible/roles$ pwgen 16 1
 di3Be1AiPayeehai di3Be1AiPayeehai
 </code> </code>
Ligne 2477: Ligne 2439:
  
 <code> <code>
-[trainee@centos8 roles]$ pwgen 16 1 > vault-password+trainee@debian11:~/.ansible/roles$ pwgen 16 1 > vault-password
  
-[trainee@centos8 roles]$ ls+trainee@debian11:~/.ansible/roles$ ls
 backend.j2  debug  exemple01.java  geerlingguy.java  group_vars  haproxy  host_vars  inventory  playbook.yaml  tomcat  vault  vault-password backend.j2  debug  exemple01.java  geerlingguy.java  group_vars  haproxy  host_vars  inventory  playbook.yaml  tomcat  vault  vault-password
  
-[trainee@centos8 roles]$ cat vault-password+trainee@debian11:~/.ansible/roles$ cat vault-password
 oo3aeph5PaiVeiBu oo3aeph5PaiVeiBu
 </code> </code>
Ligne 2489: Ligne 2451:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-vault encrypt group_vars/all.yaml --vault-password-file vault-password+trainee@debian11:~/.ansible/roles$ ansible-vault encrypt group_vars/all.yaml --vault-password-file vault-password
 Encryption successful Encryption successful
 </code> </code>
Ligne 2496: Ligne 2458:
  
 <code> <code>
-[trainee@centos8 roles]$ cat group_vars/all.yaml+trainee@debian11:~/.ansible/roles$ cat group_vars/all.yaml
 $ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
 61326364653334653935643735623863353362333536396638356362376631633732306332316661 61326364653334653935643735623863353362333536396638356362376631633732306332316661
Ligne 2508: Ligne 2470:
  
 <code> <code>
-[trainee@centos8 roles]$ ansible-playbook -i inventory playbook.yaml -l localhost --vault-password-file vault-password+trainee@debian11:~/.ansible/roles$ ansible-playbook -i inventory playbook.yaml -l localhost --vault-password-file vault-password
  
 PLAY [all] ******************************************************************************************************************************************************************************************************* PLAY [all] *******************************************************************************************************************************************************************************************************
Ligne 2526: Ligne 2488:
 =====LAB #6 - Ansible par la Pratique===== =====LAB #6 - Ansible par la Pratique=====
  
-Connectez-vous à la machine virtuelle **CentOS_7** +Connectez-vous à la machine virtuelle **CentOS7_10.0.2.51_SSH**.
- +
-<code> +
-trainee@traineeXX:~$ ssh -l trainee centos7 +
-</code>+
  
 ====6.1 - Instructions ==== ====6.1 - Instructions ====
Ligne 2773: Ligne 2731:
  
 <code> <code>
-[root@centos7 ~]# mv user.yml users.yml  
 [root@centos7 ~]# ansible-playbook vsftpd.yml [root@centos7 ~]# ansible-playbook vsftpd.yml
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Ligne 2972: Ligne 2929:
 ----- -----
  
-Copyright © 2022 Hugh Norris.+Copyright © 2024 Hugh Norris.
Menu