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:debian:6:avance:l130:part2 [2022/03/09 18:44] – admin | elearning:workbooks:debian:6:avance:l130:part2 [2023/08/25 01:28] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| - | Version : **2022.02** | + | Version : **2023.02** |
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| - | ====== | + | ====== |
| =====Contenu du Module===== | =====Contenu du Module===== | ||
| - | * **DOF502 | + | * **LCF802 |
| * Contenu du Module | * Contenu du Module | ||
| * LAB #1 - Débuter avec Ansible | * LAB #1 - Débuter avec Ansible | ||
| Ligne 36: | Ligne 36: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible all -i 10.0.2.52, -m ping | [trainee@centos8 ~]$ ansible all -i 10.0.2.52, -m ping | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| 10.0.2.52 | SUCCESS => { | 10.0.2.52 | SUCCESS => { | ||
| " | " | ||
| Ligne 47: | Ligne 45: | ||
| </ | </ | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Cette commande indique à Ansible qu' | **Important** : Cette commande indique à Ansible qu' | ||
| </ | </ | ||
| Ligne 55: | Ligne 53: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible --help | [trainee@centos8 ~]$ ansible --help | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD] | usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD] | ||
| | | ||
| Ligne 374: | Ligne 370: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible all -i 10.0.2.54, -m ping | [trainee@centos8 ~]$ ansible all -i 10.0.2.54, -m ping | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| 10.0.2.54 | SUCCESS => { | 10.0.2.54 | SUCCESS => { | ||
| " | " | ||
| Ligne 384: | Ligne 378: | ||
| } | } | ||
| [trainee@centos8 ~]$ ansible all -i 10.0.2.55, -m ping | [trainee@centos8 ~]$ ansible all -i 10.0.2.55, -m ping | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| 10.0.2.55 | SUCCESS => { | 10.0.2.55 | SUCCESS => { | ||
| " | " | ||
| Ligne 399: | Ligne 391: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible all -i web01, | [trainee@centos8 ~]$ ansible all -i web01, | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| web02 | SUCCESS => { | web02 | SUCCESS => { | ||
| " | " | ||
| Ligne 431: | Ligne 421: | ||
| </ | </ | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Notez que les résultats ne sont pas retournés dans un ordre séquentiel par rapport à la commande exécutée. En effet, ansible a paralléliser l' | **Important** : Notez que les résultats ne sont pas retournés dans un ordre séquentiel par rapport à la commande exécutée. En effet, ansible a paralléliser l' | ||
| </ | </ | ||
| Ligne 439: | Ligne 429: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible all -i web01, | [trainee@centos8 ~]$ ansible all -i web01, | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| web02 | CHANGED | rc=0 >> | web02 | CHANGED | rc=0 >> | ||
| | | ||
| Ligne 552: | Ligne 540: | ||
| * Dans le cas contraire, le handler n'est pas appelé. | * Dans le cas contraire, le handler n'est pas appelé. | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Notez que les handlers sont appelés **après** l' | **Important** : Notez que les handlers sont appelés **après** l' | ||
| </ | </ | ||
| Ligne 736: | Ligne 724: | ||
| Dans cet exemple, la valeur du mot clef **hosts:** est le nom d'un groupe. | Dans cet exemple, la valeur du mot clef **hosts:** est le nom d'un groupe. | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Notez qu'il existe un groupe spécial appelé **all**. Ce groupe n'a pas besoin d' | **Important** : Notez qu'il existe un groupe spécial appelé **all**. Ce groupe n'a pas besoin d' | ||
| </ | </ | ||
| Ligne 797: | Ligne 785: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml | [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | ||
| Ligne 842: | Ligne 828: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml -l equilibrage | [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml -l equilibrage | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | ||
| Ligne 870: | Ligne 854: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml -l web04 | [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml -l web04 | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | ||
| Ligne 911: | Ligne 893: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml --tags service | [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml --tags service | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | ||
| Ligne 947: | Ligne 927: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml --tags service -l equilibrage | [trainee@centos8 ~]$ ansible-playbook -i inventory playbook.yaml --tags service -l equilibrage | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | PLAY [basededonnees] ********************************************************************************************************************************************************************************************* | ||
| Ligne 993: | Ligne 971: | ||
| * contient des variables de configuration de haute priorité, difficilement sur-chargées par des variables ailleurs. | * contient des variables de configuration de haute priorité, difficilement sur-chargées par des variables ailleurs. | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Notez que seul le répertoire **tasks** est obligatoire. | **Important** : Notez que seul le répertoire **tasks** est obligatoire. | ||
| </ | </ | ||
| Ligne 1075: | Ligne 1053: | ||
| {{ : | {{ : | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Notez que la convention utilisée pour les noms est // | **Important** : Notez que la convention utilisée pour les noms est // | ||
| </ | </ | ||
| Ligne 1083: | Ligne 1061: | ||
| < | < | ||
| [trainee@centos8 ~]$ ansible-galaxy install geerlingguy.java | [trainee@centos8 ~]$ ansible-galaxy install geerlingguy.java | ||
| - | [DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. | ||
| - | This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| Starting galaxy role install process | Starting galaxy role install process | ||
| - downloading role ' | - downloading role ' | ||
| Ligne 1138: | Ligne 1114: | ||
| </ | </ | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Notez que dans ce cas il n'y a pas eu de dépendances. Par contre la commande **ansible-galaxy** sait résoudre et gérer les dépendances. | **Important** : Notez que dans ce cas il n'y a pas eu de dépendances. Par contre la commande **ansible-galaxy** sait résoudre et gérer les dépendances. | ||
| </ | </ | ||
| Ligne 1154: | Ligne 1130: | ||
| </ | </ | ||
| - | Avant d' | + | Avant d’exécuter |
| < | < | ||
| Ligne 1161: | Ligne 1137: | ||
| [defaults] | [defaults] | ||
| deprecation_warnings=False | deprecation_warnings=False | ||
| + | log_path = ./ | ||
| </ | </ | ||
| - | <WRAP center round important | + | <WRAP center round important> |
| **Important** : Le comportement d' | **Important** : Le comportement d' | ||
| </ | </ | ||
| Ligne 1368: | Ligne 1345: | ||
| ----- | ----- | ||
| - | Copyright © 2022 Hugh Norris. | + | Copyright © 2023 Hugh Norris. |