Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:centos:8:lcf900:l703 [2022/08/31 14:47] – admin | elearning:workbooks:centos:8:lcf900:l703 [2024/11/30 10:56] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version - **2022.01** | + | Version - **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ====== | + | ====== |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF803 | + | * **LDF903 |
* Contenu du Module | * Contenu du Module | ||
* LAB #1 - Dépendances de Rôles | * LAB #1 - Dépendances de Rôles | ||
Ligne 42: | Ligne 42: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ mkdir / |
- | [trainee@centos8 | + | trainee@debian11:~$ cd / |
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que dans ce Rôle nous n' | **Important** : Notez que dans ce Rôle nous n' | ||
</ | </ | ||
Ligne 55: | Ligne 55: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- name: install jre | - name: install jre | ||
Ligne 70: | Ligne 70: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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**, | **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**, | ||
</ | </ | ||
Ligne 77: | Ligne 77: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
java_home: / | java_home: / | ||
Ligne 84: | Ligne 84: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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**. | ||
</ | </ | ||
Ligne 91: | Ligne 91: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 101: | Ligne 101: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que dans ce Rôle nous n' | **Important** : Notez que dans ce Rôle nous n' | ||
</ | </ | ||
Ligne 113: | Ligne 113: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- name: install tomcat | - name: install tomcat | ||
Ligne 123: | Ligne 123: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
dependencies: | dependencies: | ||
Ligne 130: | Ligne 130: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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**. | ||
</ | </ | ||
Ligne 137: | Ligne 137: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- hosts: all | - hosts: all | ||
Ligne 146: | Ligne 146: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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**. | ||
</ | </ | ||
Ligne 153: | Ligne 153: | ||
< | < | ||
- | trainee@centos8: | + | trainee@debian11: |
- | trainee@centos8: | + | trainee@debian11: |
</ | </ | ||
Ligne 160: | Ligne 160: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
. | . | ||
├── exemple01.java | ├── exemple01.java | ||
Ligne 190: | Ligne 190: | ||
│ | │ | ||
│ | │ | ||
+ | │ | ||
│ | │ | ||
│ | │ | ||
Ligne 196: | Ligne 197: | ||
│ | │ | ||
│ | │ | ||
+ | │ | ||
│ | │ | ||
│ | │ | ||
│ | │ | ||
│ | │ | ||
- | │ └── Ubuntu-20.yml | + | │ ├── Ubuntu-20.yml |
+ | │ | ||
├── inventory | ├── inventory | ||
├── playbook.yaml | ├── playbook.yaml | ||
Ligne 209: | Ligne 212: | ||
└── main.yaml | └── main.yaml | ||
- | 15 directories, | + | 15 directories, |
</ | </ | ||
Ligne 215: | Ligne 218: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | 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 | web01 : ok=4 changed=2 | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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**. | ||
</ | </ | ||
Ligne 242: | Ligne 245: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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: | + | Last login: |
trainee@web01: | trainee@web01: | ||
● tomcat8.service - LSB: Start Tomcat. | ● tomcat8.service - LSB: Start Tomcat. | ||
| | ||
- | | + | |
Docs: man: | Docs: man: | ||
| | ||
- | | + | |
trainee@web01: | trainee@web01: | ||
déconnexion | déconnexion | ||
Connection to web01 closed. | Connection to web01 closed. | ||
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
Ligne 269: | Ligne 272: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
dependencies: | dependencies: | ||
Ligne 276: | Ligne 279: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que cette fois-ci, la valeur de la variable **java_package** spécifiée dans le fichier **/ | **Important** : Notez que cette fois-ci, la valeur de la variable **java_package** spécifiée dans le fichier **/ | ||
</ | </ | ||
Ligne 283: | Ligne 286: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | 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 | + | web02 : ok=4 changed=3 |
</ | </ | ||
Ligne 306: | Ligne 309: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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: | + | Last login: |
trainee@web02: | trainee@web02: | ||
/ | / | ||
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 / | + | |
- | + | ||
- | 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: | + | |
- | trainee@web03: | + | |
- | déconnexion | + | |
- | Connection to web03 closed. | + | |
- | [trainee@centos8 | + | |
</ | </ | ||
Ligne 344: | Ligne 332: | ||
====2.1 - Variables==== | ====2.1 - Variables==== | ||
- | Les **Gabarits** ou // | + | Les **Gabarits** ou // |
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La documentation des gabarits se trouvent à cette adresse: **[[https:// | **Important** : La documentation des gabarits se trouvent à cette adresse: **[[https:// | ||
</ | </ | ||
Ligne 355: | Ligne 343: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que dans ce Rôle nous n' | **Important** : Notez que dans ce Rôle nous n' | ||
</ | </ | ||
Ligne 368: | Ligne 356: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- name: install | - name: install | ||
Ligne 387: | Ligne 375: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que l' | **Important** : Notez que l' | ||
</ | </ | ||
Ligne 394: | Ligne 382: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- name: reload haproxy | - name: reload haproxy | ||
Ligne 404: | Ligne 392: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
global | global | ||
log / | log / | ||
Ligne 461: | Ligne 449: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 468: | Ligne 456: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
haproxy_listen_address: | haproxy_listen_address: | ||
Ligne 479: | Ligne 467: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- hosts: all | - hosts: all | ||
Ligne 492: | Ligne 480: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | 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 | + | web04 : ok=5 changed=2 |
</ | </ | ||
Ligne 518: | Ligne 506: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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: | + | Last login: |
trainee@web04: | trainee@web04: | ||
● haproxy.service - HAProxy Load Balancer | ● haproxy.service - HAProxy Load Balancer | ||
| | ||
- | | + | |
Docs: man: | Docs: man: | ||
| | ||
- | Process: | + | Process: |
- | Process: | + | Process: |
- | Main PID: 5394 (haproxy-systemd) | + | Main PID: 2970 (haproxy-systemd) |
Tasks: 3 (limit: 4915) | Tasks: 3 (limit: 4915) | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
trainee@web04: | trainee@web04: | ||
Ligne 603: | Ligne 591: | ||
déconnexion | déconnexion | ||
Connection to web04 closed. | Connection to web04 closed. | ||
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que les valeurs des variables spécifiées dans le fichier **/ | **Important** : Notez que les valeurs des variables spécifiées dans le fichier **/ | ||
</ | </ | ||
Ligne 617: | Ligne 605: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
frontend haproxy | frontend haproxy | ||
bind {{ haproxy_listen_address }}: | bind {{ haproxy_listen_address }}: | ||
Ligne 638: | Ligne 626: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez la condition **%%{% if haproxy_stats %}%%** qui ne tiendra compte des quatre lignes jusqu' | **Important** : Notez la condition **%%{% if haproxy_stats %}%%** qui ne tiendra compte des quatre lignes jusqu' | ||
</ | </ | ||
Ligne 645: | Ligne 633: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
haproxy_listen_address: | haproxy_listen_address: | ||
Ligne 654: | Ligne 642: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez qu' | **Important** : Notez qu' | ||
</ | </ | ||
Ligne 661: | Ligne 649: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | 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 | + | web04 : ok=4 changed=0 |
</ | </ | ||
Ligne 684: | Ligne 672: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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: | trainee@web04: | ||
errorfile 504 / | errorfile 504 / | ||
Ligne 713: | Ligne 702: | ||
server web02 10.0.2.55: | server web02 10.0.2.55: | ||
server web03 10.0.2.56: | server web03 10.0.2.56: | ||
+ | |||
trainee@web04: | trainee@web04: | ||
déconnexion | déconnexion | ||
Connection to web04 closed. | Connection to web04 closed. | ||
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 726: | Ligne 716: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
haproxy_listen_address: | haproxy_listen_address: | ||
Ligne 735: | Ligne 725: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez qu' | **Important** : Notez qu' | ||
</ | </ | ||
Ligne 743: | Ligne 733: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | 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 | + | web04 : ok=5 changed=2 |
</ | </ | ||
Ligne 769: | Ligne 759: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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: | + | Last login: |
trainee@web04: | trainee@web04: | ||
errorfile 408 / | errorfile 408 / | ||
Ligne 798: | Ligne 789: | ||
server web02 10.0.2.55: | server web02 10.0.2.55: | ||
server web03 10.0.2.56: | server web03 10.0.2.56: | ||
+ | |||
trainee@web04: | trainee@web04: | ||
déconnexion | déconnexion | ||
Connection to web04 closed. | Connection to web04 closed. | ||
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 831: | Ligne 823: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
haproxy_listen_address: | haproxy_listen_address: | ||
Ligne 843: | Ligne 835: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que la variable **haproxy_backends** est une liste YAML. | **Important** : Notez que la variable **haproxy_backends** est une liste YAML. | ||
</ | </ | ||
Ligne 850: | Ligne 842: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
stats auth admin:admin | stats auth admin:admin | ||
{% endif %} | {% endif %} | ||
Ligne 867: | Ligne 859: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
haproxy_listen_address: | haproxy_listen_address: | ||
Ligne 884: | Ligne 876: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
stats auth admin:admin | stats auth admin:admin | ||
{% endif %} | {% endif %} | ||
Ligne 903: | Ligne 895: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
{% macro backend(name, | {% macro backend(name, | ||
server {{ name }} {{ ip }}:{{ port }} check | server {{ name }} {{ ip }}:{{ port }} check | ||
Ligne 913: | Ligne 905: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
{% endif %} | {% endif %} | ||
balance roundrobin | balance roundrobin | ||
Ligne 934: | Ligne 926: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
bind {{ haproxy_listen_address }}: | bind {{ haproxy_listen_address }}: | ||
mode http | mode http | ||
Ligne 958: | Ligne 950: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
haproxy_listen_address: | haproxy_listen_address: | ||
Ligne 973: | Ligne 965: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 999: | Ligne 991: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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 | + | trainee@debian11: |
</ | </ | ||
Ligne 1089: | Ligne 1081: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
global | global | ||
log / | log / | ||
Ligne 1116: | Ligne 1108: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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**, | **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**, | ||
</ | </ | ||
Ligne 1125: | Ligne 1117: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
{% extends ' | {% extends ' | ||
{% block globals %} | {% block globals %} | ||
Ligne 1167: | Ligne 1159: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que les **blocs** nommés **globals**, | **Important** : Notez que les **blocs** nommés **globals**, | ||
</ | </ | ||
Ligne 1174: | Ligne 1166: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- name: install | - name: install | ||
Ligne 1196: | Ligne 1188: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1222: | Ligne 1214: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que les **blocs** nommés **globals**, | **Important** : Notez que les **blocs** nommés **globals**, | ||
</ | </ | ||
Ligne 1313: | Ligne 1305: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11:~$ mkdir / |
- | [trainee@centos8 | + | trainee@debian11:~$ mkdir / |
- | [trainee@centos8 | + | trainee@debian11:~$ mkdir / |
- | [trainee@centos8 | + | trainee@debian11:~$ |
</ | </ | ||
Ligne 1323: | Ligne 1315: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ touch / |
- | [trainee@centos8 | + | trainee@debian11:~$ touch / |
- | [trainee@centos8 | + | trainee@debian11:~$ |
</ | </ | ||
Ligne 1331: | Ligne 1323: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ cd .ansible/ |
- | [trainee@centos8 | + | trainee@debian11: |
debug | debug | ||
├── defaults | ├── defaults | ||
Ligne 1345: | Ligne 1337: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
Ligne 1353: | Ligne 1345: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
group_vars/ | group_vars/ | ||
└── all.yaml | └── all.yaml | ||
Ligne 1363: | Ligne 1355: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- debug: | - debug: | ||
Ligne 1373: | Ligne 1365: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- hosts: all | - hosts: all | ||
Ligne 1384: | Ligne 1376: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1418: | Ligne 1410: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
endroit: ' | endroit: ' | ||
Ligne 1427: | Ligne 1419: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1458: | Ligne 1450: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La variable fixée dans **defaults/ | **Important** : La variable fixée dans **defaults/ | ||
</ | </ | ||
Ligne 1465: | Ligne 1457: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
endroit: ' | endroit: ' | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La déclaration de la variable peut être faite dans **roles/ | **Important** : La déclaration de la variable peut être faite dans **roles/ | ||
</ | </ | ||
Ligne 1478: | Ligne 1470: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1509: | Ligne 1501: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La variable fixée dans **group_vars/ | **Important** : La variable fixée dans **group_vars/ | ||
</ | </ | ||
Ligne 1516: | Ligne 1508: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- hosts: all | - hosts: all | ||
Ligne 1527: | Ligne 1519: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1558: | Ligne 1550: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La variable fixée dans **playbook.yaml** surcharge la variable fixée dans **group_vars/ | **Important** : La variable fixée dans **playbook.yaml** surcharge la variable fixée dans **group_vars/ | ||
</ | </ | ||
Ligne 1565: | Ligne 1557: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
endroit: ' | endroit: ' | ||
Ligne 1574: | Ligne 1566: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
# endroit: ' | # endroit: ' | ||
Ligne 1584: | Ligne 1576: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- hosts: all | - hosts: all | ||
Ligne 1595: | Ligne 1587: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
localhost ansible_connection=local | localhost ansible_connection=local | ||
Ligne 1621: | Ligne 1613: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1657: | Ligne 1649: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que la valeur de la variable **endroit** spécifiée dans le fichier **group_vars/ | **Important** : Notez que la valeur de la variable **endroit** spécifiée dans le fichier **group_vars/ | ||
</ | </ | ||
Ligne 1664: | Ligne 1656: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
[group1] | [group1] | ||
localhost ansible_connection=local | localhost ansible_connection=local | ||
Ligne 1691: | Ligne 1683: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1727: | Ligne 1719: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La variable fixée dans **group_vars/ | **Important** : La variable fixée dans **group_vars/ | ||
</ | </ | ||
Ligne 1734: | Ligne 1726: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
endroit: ' | endroit: ' | ||
Ligne 1743: | Ligne 1735: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1779: | Ligne 1771: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : La variable fixée dans **host_vars/ | **Important** : La variable fixée dans **host_vars/ | ||
</ | </ | ||
Ligne 1786: | Ligne 1778: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 1822: | Ligne 1814: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 1836: | Ligne 1828: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
web01 | SUCCESS => { | web01 | SUCCESS => { | ||
" | " | ||
Ligne 1896: | Ligne 1888: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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 ! | ||
</ | </ | ||
Ligne 1933: | Ligne 1925: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
[linux] | [linux] | ||
targeta | targeta | ||
Ligne 1964: | Ligne 1956: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- hosts: all | - hosts: all | ||
Ligne 1973: | Ligne 1965: | ||
</ | </ | ||
- | Connectez-vous à la machine TargetA et supprimez | + | Utilisez |
< | < | ||
- | [trainee@centos8 roles]$ ssh 10.0.2.52 | + | trainee@debian11:~/.ansible/roles$ cd ~ |
- | Debian GNU/Linux 9 | + | trainee@debian11:~$ scp .ssh/ |
- | 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' |
- | + | ||
- | 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 / | + | |
- | + | ||
- | 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: | + | |
- | 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 : | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 | + | |
- | [trainee@centos8 | + | |
- | trainee@10.0.2.53' | + | |
authorized_keys | authorized_keys | ||
- | [trainee@centos8 | + | trainee@debian11:~$ cd - |
/ | / | ||
- | [trainee@centos8 roles]$ | + | trainee@debian11:~/.ansible/roles$ |
- | </ | + | |
- | + | ||
- | Connectez-vous à la machine TargetB et supprimez le paquet **java-1.8.0-openjdk** | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 roles]$ ssh 10.0.2.53 | + | |
- | Last login: Wed Mar 9 16:51:41 2022 from 10.0.2.45 | + | |
- | [trainee@targetb | + | |
- | ... | + | |
- | [trainee@targetb ~]$ exit | + | |
- | logout | + | |
- | Connection to 10.0.2.53 closed. | + | |
- | [trainee@centos8 | + | |
</ | </ | ||
Ligne 2023: | Ligne 1980: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- name: install jre (Debian) | - name: install jre (Debian) | ||
Ligne 2035: | Ligne 1992: | ||
</ | </ | ||
- | Modifiez le fichier **/ | + | Modifiez le fichier **/ |
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
Password: fenestros | Password: fenestros | ||
- | [root@centos8 | + | |
- | [root@centos8 | + | root@debian11:~# vi / |
- | 127.0.0.1 | + | |
- | ::1 | + | root@debian11:~# cat / |
- | 10.0.2.45 centos8.ittraining.loc | + | 127.0.0.1 |
+ | 10.0.2.46 | ||
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 | + | |
+ | # The following lines are desirable for IPv6 capable hosts | ||
+ | ::1 | ||
+ | ff02::1 ip6-allnodes | ||
+ | ff02::2 ip6-allrouters | ||
+ | |||
+ | root@debian11:~# exit | ||
logout | logout | ||
- | [trainee@centos8 | + | |
+ | trainee@debian11: | ||
</ | </ | ||
Ligne 2059: | Ligne 2024: | ||
< | < | ||
- | [trainee@centos8 roles]$ ssh targeta | + | trainee@debian11:~/.ansible/roles$ ssh targeta |
- | The authenticity of host ' | + | |
- | ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. | + | |
- | Are you sure you want to continue connecting (yes/no/ | + | |
- | 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: | ||
+ | </ | ||
+ | |||
+ | Modifiez le contenu du fichier **/ | ||
+ | |||
+ | < | ||
+ | trainee@targeta: | ||
+ | |||
+ | trainee@targeta: | ||
+ | # | ||
+ | |||
+ | # deb cdrom: | ||
+ | |||
+ | #deb cdrom: | ||
+ | |||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | |||
+ | deb http:// | ||
+ | deb-src http:// | ||
trainee@targeta: | trainee@targeta: | ||
- | Réception de:1 http://security.debian.org/ | + | Ign:1 http://archive.debian.org/ |
- | Ign:2 http://ftp.fr.debian.org/ | + | Réception de:2 http://archive.debian.org/ |
- | Réception de:3 http:// | + | Réception de:3 http://archive.debian.org/ |
- | Réception de:4 http://ftp.fr.debian.org/ | + | Réception de:4 http://archive.debian.org/ |
- | Réception de:5 http://ftp.fr.debian.org/ | + | Réception de:5 http://archive.debian.org/ |
- | Réception de:6 http://security.debian.org/ | + | Réception de:6 http://archive.debian.org/ |
- | Réception de:7 http://security.debian.org/ | + | Réception de:7 http://archive.debian.org/ |
- | Réception de:8 http://security.debian.org/ | + | Réception de:8 http://archive.debian.org/ |
- | Réception de:9 http://ftp.fr.debian.org/ | + | Réception de:9 http://archive.debian.org/ |
- | Réception de:10 http://ftp.fr.debian.org/ | + | Réception de:10 http://archive.debian.org/ |
- | Réception de:11 http://ftp.fr.debian.org/ | + | Réception de:11 http:// |
- | 21,0 Mo réceptionnés en 7s (2 753 ko/s) | + | 22,8 Mo réceptionnés en 27s (843 ko/s) |
Lecture des listes de paquets... Fait | Lecture des listes de paquets... Fait | ||
Construction de l' | Construction de l' | ||
Lecture des informations d' | Lecture des informations d' | ||
- | 333 packages can be upgraded. Run 'apt list --upgradable' | + | 353 packages can be upgraded. Run 'apt list --upgradable' |
+ | </ | ||
+ | Supprimez le paquet **openjdk-8-jre** : | ||
+ | |||
+ | < | ||
+ | trainee@targeta: | ||
+ | ... | ||
trainee@targeta: | trainee@targeta: | ||
déconnexion | déconnexion | ||
Ligne 2101: | Ligne 2088: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
The authenticity of host ' | The authenticity of host ' | ||
ECDSA key fingerprint is SHA256: | ECDSA key fingerprint is SHA256: | ||
Are you sure you want to continue connecting (yes/ | Are you sure you want to continue connecting (yes/ | ||
- | Warning: Permanently added ' | + | Warning: Permanently added ' |
- | Last login: | + | trainee@targetb' |
+ | Last login: | ||
[trainee@targetb ~]$ yum clean all | [trainee@targetb ~]$ yum clean all | ||
Loaded plugins: fastestmirror, | Loaded plugins: fastestmirror, | ||
+ | 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/ | (6/6): updates/ | ||
Metadata Cache Created | Metadata Cache Created | ||
+ | </ | ||
+ | Supprimez le paquet **java-1.8.0-openjdk** : | ||
+ | |||
+ | < | ||
+ | [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 | + | trainee@debian11: |
</ | </ | ||
Ligne 2139: | Ligne 2134: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 2177: | Ligne 2172: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
Ligne 2183: | Ligne 2178: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
secret: gardezmoisecret | secret: gardezmoisecret | ||
Ligne 2192: | Ligne 2187: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
- hosts: all | - hosts: all | ||
Ligne 2204: | Ligne 2199: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 2220: | Ligne 2215: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : L' | **Important** : L' | ||
</ | </ | ||
Ligne 2229: | Ligne 2224: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
New Vault password: fenestros | New Vault password: fenestros | ||
Confirm New Vault password: fenestros | Confirm New Vault password: fenestros | ||
Encryption successful | Encryption successful | ||
- | [trainee@centos8 | + | trainee@debian11: |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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 center round important> | + | <WRAP center round important |
**Important** : Notez que le mot de passe est pour la commande **ansible-vault** et non pas uniquement pour l' | **Important** : Notez que le mot de passe est pour la commande **ansible-vault** et non pas uniquement pour l' | ||
</ | </ | ||
Ligne 2247: | Ligne 2242: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
$ANSIBLE_VAULT; | $ANSIBLE_VAULT; | ||
33343664333931323331346338346439613439633633396262393733663463363438663163383761 | 33343664333931323331346338346439613439633633396262393733663463363438663163383761 | ||
Ligne 2259: | Ligne 2254: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
Ligne 2265: | Ligne 2260: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 2272: | Ligne 2267: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
PLAY [all] ******************************************************************************************************************************************************************************************************* | PLAY [all] ******************************************************************************************************************************************************************************************************* | ||
ERROR! Attempting to decrypt but no vault secrets found | ERROR! Attempting to decrypt but no vault secrets found | ||
- | [trainee@centos8 | + | trainee@debian11: |
Vault password: fenestros | Vault password: fenestros | ||
Ligne 2293: | Ligne 2288: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 2302: | Ligne 2297: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
Vault password: fenestros | Vault password: fenestros | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 2345: | Ligne 2340: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
$ANSIBLE_VAULT; | $ANSIBLE_VAULT; | ||
36633861376466313363373336643832646663666334633931663262666361306236386232316461 | 36633861376466313363373336643832646663666334633931663262666361306236386232316461 | ||
Ligne 2357: | Ligne 2352: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
Vault password: fenestros | Vault password: fenestros | ||
Ligne 2374: | Ligne 2369: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 2383: | Ligne 2378: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
Vault password: fenestros | Vault password: fenestros | ||
Decryption successful | Decryption successful | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**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. | ||
</ | </ | ||
Ligne 2395: | Ligne 2390: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
--- | --- | ||
secret: gardezlesecret | secret: gardezlesecret | ||
Ligne 2405: | Ligne 2400: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
+ | trainee@debian11: | ||
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' | ||
+ | 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:// | ||
+ | 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 .../ | ||
+ | Unpacking pwgen (2.08-2) ... | ||
+ | Setting up pwgen (2.08-2) ... | ||
+ | Processing triggers for man-db (2.9.4-2) ... | ||
+ | root@debian11: | ||
+ | logout | ||
- | [root@centos8 ~]# dnf install https:// | + | trainee@debian11:~/.ansible/ |
- | Last metadata expiration check: 1:30:37 ago on Wed 09 Mar 2022 10:10:01 EST. | + | |
- | epel-release-latest-8.noarch.rpm | + | |
- | Dependencies resolved. | + | |
- | ================================================================================================================================================================================================================== | + | |
- | | + | |
- | ================================================================================================================================================================================================================== | + | |
- | Installing: | + | |
- | | + | |
- | + | ||
- | Transaction Summary | + | |
- | ================================================================================================================================================================================================================== | + | |
- | Install | + | |
- | + | ||
- | 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 | + | |
- | Installing | + | |
- | Running scriptlet: epel-release-8-14.el8.noarch | + | |
- | Verifying | + | |
- | Installed products updated. | + | |
- | + | ||
- | Installed: | + | |
- | epel-release-8-14.el8.noarch | + | |
- | + | ||
- | Complete! | + | |
- | + | ||
- | [root@centos8 | + | |
- | Extra Packages for Enterprise Linux 8 - x86_64 | + | |
- | Extra Packages for Enterprise Linux Modular 8 - x86_64 | + | |
- | Last metadata expiration check: 0:00:01 ago on Wed 09 Mar 2022 11:41:14 EST. | + | |
- | Dependencies resolved. | + | |
- | ================================================================================================================================================================================================================== | + | |
- | | + | |
- | ================================================================================================================================================================================================================== | + | |
- | Installing: | + | |
- | | + | |
- | + | ||
- | Transaction Summary | + | |
- | ================================================================================================================================================================================================================== | + | |
- | Install | + | |
- | + | ||
- | Total download size: 31 k | + | |
- | Installed size: 46 k | + | |
- | Is this ok [y/N]: y | + | |
- | + | ||
- | [root@centos8 ~]# exit | + | |
- | logout | + | |
- | [trainee@centos8 | + | |
</ | </ | ||
Ligne 2470: | Ligne 2432: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
di3Be1AiPayeehai | di3Be1AiPayeehai | ||
</ | </ | ||
Ligne 2477: | Ligne 2439: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
- | [trainee@centos8 | + | trainee@debian11: |
backend.j2 | backend.j2 | ||
- | [trainee@centos8 | + | trainee@debian11: |
oo3aeph5PaiVeiBu | oo3aeph5PaiVeiBu | ||
</ | </ | ||
Ligne 2489: | Ligne 2451: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
Encryption successful | Encryption successful | ||
</ | </ | ||
Ligne 2496: | Ligne 2458: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
$ANSIBLE_VAULT; | $ANSIBLE_VAULT; | ||
61326364653334653935643735623863353362333536396638356362376631633732306332316661 | 61326364653334653935643735623863353362333536396638356362376631633732306332316661 | ||
Ligne 2508: | Ligne 2470: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11: |
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**. |
- | + | ||
- | < | + | |
- | trainee@traineeXX: | + | |
- | </ | + | |
====6.1 - Instructions ==== | ====6.1 - Instructions ==== | ||
Ligne 2773: | Ligne 2731: | ||
< | < | ||
- | [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 ' | [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ' | ||
Ligne 2972: | Ligne 2929: | ||
----- | ----- | ||
- | Copyright © 2022 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |