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:l702 [2022/05/20 12:09] – admin | elearning:workbooks:centos:8:lcf900:l702 [2024/11/30 10:58] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| - | Version : **2022.02** | + | Version : **2024.01** |
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| - | ====== | + | ====== |
| =====Contenu du Module===== | =====Contenu du Module===== | ||
| - | * **LCF802 | + | * **LDF902 |
| * Contenu du Module | * Contenu du Module | ||
| * LAB #1 - Débuter avec Ansible | * LAB #1 - Débuter avec Ansible | ||
| Ligne 35: | Ligne 35: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ ansible all -i 10.0.2.52, -m ping |
| - | [DEPRECATION WARNING]: | + | [DEPRECATION WARNING]: |
| - | This feature will be removed | + | / |
| + | Ansible releases. A future Ansible release will default | ||
| + | platform python for this host. See | ||
| + | https://docs.ansible.com/ | ||
| + | for more information. This feature will be removed 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 52: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| **Important** : Cette commande indique à Ansible qu' | **Important** : Cette commande indique à Ansible qu' | ||
| </ | </ | ||
| Ligne 54: | Ligne 59: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ 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)]. | + | usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD] [--become-user BECOME_USER] [-K] [-i INVENTORY] [--list-hosts] [-l SUBSET] [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k] |
| - | 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] | + | |
| - | [--become-user BECOME_USER] [-K] [-i INVENTORY] [--list-hosts] | + | [-M MODULE_PATH] [--playbook-dir BASEDIR] [-a MODULE_ARGS] [-m MODULE_NAME] |
| - | [-l SUBSET] [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k] | + | |
| - | | + | |
| - | [-c CONNECTION] [-T TIMEOUT] | + | |
| - | [--ssh-common-args SSH_COMMON_ARGS] | + | |
| - | [--sftp-extra-args SFTP_EXTRA_ARGS] | + | |
| - | [--scp-extra-args SCP_EXTRA_ARGS] | + | |
| - | | + | |
| - | [-e EXTRA_VARS] [--vault-id VAULT_IDS] | + | |
| - | [--ask-vault-password | --vault-password-file VAULT_PASSWORD_FILES] | + | |
| - | [-f FORKS] [-M MODULE_PATH] [--playbook-dir BASEDIR] | + | |
| - | | + | |
| | | ||
| Ligne 80: | Ligne 74: | ||
| --ask-vault-password, | --ask-vault-password, | ||
| ask for vault password | ask for vault password | ||
| - | --list-hosts | + | --list-hosts |
| - | | + | |
| --playbook-dir BASEDIR | --playbook-dir BASEDIR | ||
| - | Since this tool does not use playbooks, use this as a | + | Since this tool does not use playbooks, use this as a substitute playbook directory.This sets the relative path for many features including roles/ group_vars/ etc. |
| - | | + | --syntax-check |
| - | | + | |
| - | | + | |
| - | --syntax-check | + | |
| - | | + | |
| - | --task-timeout TASK_TIMEOUT | + | |
| - | set task timeout limit in seconds, must be positive | + | |
| - | integer. | + | |
| --vault-id VAULT_IDS | --vault-id VAULT_IDS | ||
| --vault-password-file VAULT_PASSWORD_FILES, | --vault-password-file VAULT_PASSWORD_FILES, | ||
| vault password file | vault password file | ||
| - | --version | + | --version |
| - | | + | |
| - | | + | |
| -B SECONDS, --background SECONDS | -B SECONDS, --background SECONDS | ||
| - | run asynchronously, | + | run asynchronously, |
| - | | + | -C, --check |
| - | -C, --check | + | -D, --diff |
| - | | + | |
| - | -D, --diff | + | |
| - | | + | |
| -M MODULE_PATH, | -M MODULE_PATH, | ||
| - | prepend colon-separated path(s) to module library (def | + | prepend colon-separated path(s) to module library (default=~/ |
| - | ault=~/ | + | |
| - | gins/modules) | + | |
| -P POLL_INTERVAL, | -P POLL_INTERVAL, | ||
| set the poll interval if using -B (default=15) | set the poll interval if using -B (default=15) | ||
| -a MODULE_ARGS, | -a MODULE_ARGS, | ||
| - | | + | |
| - | ' | + | |
| -e EXTRA_VARS, --extra-vars EXTRA_VARS | -e EXTRA_VARS, --extra-vars EXTRA_VARS | ||
| - | set additional variables as key=value or YAML/JSON, if | + | set additional variables as key=value or YAML/JSON, if filename prepend with @ |
| - | | + | |
| -f FORKS, --forks FORKS | -f FORKS, --forks FORKS | ||
| - | specify number of parallel processes to use | + | specify number of parallel processes to use (default=5) |
| - | | + | |
| -h, --help | -h, --help | ||
| -i INVENTORY, --inventory INVENTORY, --inventory-file INVENTORY | -i INVENTORY, --inventory INVENTORY, --inventory-file INVENTORY | ||
| - | specify inventory host path or comma separated host | + | specify inventory host path or comma separated host list. --inventory-file is deprecated |
| - | | + | |
| -l SUBSET, --limit SUBSET | -l SUBSET, --limit SUBSET | ||
| further limit selected hosts to an additional pattern | further limit selected hosts to an additional pattern | ||
| -m MODULE_NAME, | -m MODULE_NAME, | ||
| - | | + | |
| -o, --one-line | -o, --one-line | ||
| -t TREE, --tree TREE log output to this directory | -t TREE, --tree TREE log output to this directory | ||
| - | -v, --verbose | + | -v, --verbose |
| - | | + | |
| Privilege Escalation Options: | Privilege Escalation Options: | ||
| Ligne 137: | Ligne 111: | ||
| --become-method BECOME_METHOD | --become-method BECOME_METHOD | ||
| - | privilege escalation method to use (default=sudo), | + | privilege escalation method to use (default=sudo), |
| - | | + | |
| --become-user BECOME_USER | --become-user BECOME_USER | ||
| run operations as this user (default=root) | run operations as this user (default=root) | ||
| -K, --ask-become-pass | -K, --ask-become-pass | ||
| ask for privilege escalation password | ask for privilege escalation password | ||
| - | -b, --become | + | -b, --become |
| - | | + | |
| Connection Options: | Connection Options: | ||
| Ligne 154: | Ligne 126: | ||
| specify extra arguments to pass to scp only (e.g. -l) | specify extra arguments to pass to scp only (e.g. -l) | ||
| --sftp-extra-args SFTP_EXTRA_ARGS | --sftp-extra-args SFTP_EXTRA_ARGS | ||
| - | specify extra arguments to pass to sftp only (e.g. -f, | + | specify extra arguments to pass to sftp only (e.g. -f, -l) |
| - | | + | |
| --ssh-common-args SSH_COMMON_ARGS | --ssh-common-args SSH_COMMON_ARGS | ||
| - | specify common arguments to pass to sftp/ | + | specify common arguments to pass to sftp/ |
| - | | + | |
| --ssh-extra-args SSH_EXTRA_ARGS | --ssh-extra-args SSH_EXTRA_ARGS | ||
| specify extra arguments to pass to ssh only (e.g. -R) | specify extra arguments to pass to ssh only (e.g. -R) | ||
| -T TIMEOUT, --timeout TIMEOUT | -T TIMEOUT, --timeout TIMEOUT | ||
| - | override the connection timeout in seconds | + | override the connection timeout in seconds (default=10) |
| - | | + | |
| -c CONNECTION, --connection CONNECTION | -c CONNECTION, --connection CONNECTION | ||
| connection type to use (default=smart) | connection type to use (default=smart) | ||
| Ligne 170: | Ligne 139: | ||
| connect as this user (default=None) | connect as this user (default=None) | ||
| - | Some actions | + | Some modules |
| </ | </ | ||
| - | Les quatre machines **WebXX** mises à votre disposition sont dans le même réseau que la machine | + | Les quatre machines **WebXX** mises à votre disposition sont dans le même réseau que la machine |
| ^ Machine ^ Nom d' | ^ Machine ^ Nom d' | ||
| Ligne 184: | Ligne 153: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ scp .ssh/ |
| The authenticity of host ' | The authenticity of host ' | ||
| ECDSA key fingerprint is SHA256: | ECDSA key fingerprint is SHA256: | ||
| Ligne 191: | Ligne 160: | ||
| Debian GNU/Linux 9 | Debian GNU/Linux 9 | ||
| trainee@10.0.2.54' | trainee@10.0.2.54' | ||
| - | authorized_keys | + | authorized_keys |
| - | + | trainee@debian11:~$ scp .ssh/ | |
| - | [trainee@centos8 | + | |
| The authenticity of host ' | The authenticity of host ' | ||
| ECDSA key fingerprint is SHA256: | ECDSA key fingerprint is SHA256: | ||
| Ligne 200: | Ligne 168: | ||
| Debian GNU/Linux 9 | Debian GNU/Linux 9 | ||
| trainee@10.0.2.55' | trainee@10.0.2.55' | ||
| - | authorized_keys | + | authorized_keys |
| - | + | trainee@debian11:~$ scp .ssh/ | |
| - | [trainee@centos8 | + | |
| The authenticity of host ' | The authenticity of host ' | ||
| ECDSA key fingerprint is SHA256: | ECDSA key fingerprint is SHA256: | ||
| Ligne 209: | Ligne 176: | ||
| Debian GNU/Linux 9 | Debian GNU/Linux 9 | ||
| trainee@10.0.2.56' | trainee@10.0.2.56' | ||
| - | authorized_keys | + | authorized_keys |
| - | + | trainee@debian11:~$ scp .ssh/ | |
| - | [trainee@centos8 | + | |
| The authenticity of host ' | The authenticity of host ' | ||
| ECDSA key fingerprint is SHA256: | ECDSA key fingerprint is SHA256: | ||
| Ligne 218: | Ligne 184: | ||
| Debian GNU/Linux 9 | Debian GNU/Linux 9 | ||
| trainee@10.0.2.57' | trainee@10.0.2.57' | ||
| - | authorized_keys | + | authorized_keys |
| </ | </ | ||
| - | Modifier le fichier **/ | + | Modifier le fichier **/ |
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ su - |
| Password: fenestros | Password: fenestros | ||
| - | [root@centos8 | + | root@debian11:~# vi / |
| - | [root@centos8 | + | root@debian11:~# cat / |
| - | 127.0.0.1 | + | 127.0.0.1 |
| - | ::1 | + | 10.0.2.46 |
| - | 10.0.2.45 centos8.ittraining.loc | + | |
| 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 | ||
| 10.0.2.56 web03.i2tch.loc web03 | 10.0.2.56 web03.i2tch.loc web03 | ||
| 10.0.2.57 web04.i2tch.loc web04 | 10.0.2.57 web04.i2tch.loc web04 | ||
| - | [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 ~]$ | ||
| </ | </ | ||
| Ligne 243: | Ligne 212: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ ssh -l trainee web01 |
| + | The authenticity of host 'web01 (10.0.2.54)' | ||
| + | ECDSA key fingerprint is SHA256: | ||
| + | Are you sure you want to continue connecting (yes/ | ||
| + | Warning: Permanently added ' | ||
| 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 253: | Ligne 226: | ||
| 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: |
| + | < | ||
| + | |||
| + | Modifiez le contenu du fichier **/ | ||
| + | |||
| + | < | ||
| + | trainee@web01: | ||
| + | |||
| + | trainee@web01: | ||
| + | # | ||
| + | |||
| + | # deb cdrom: | ||
| + | |||
| + | #deb cdrom: | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| trainee@web01: | trainee@web01: | ||
| - | 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://ftp.fr.debian.org/ | + | 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://archive.debian.org/ |
| - | 21,0 Mo réceptionnés en 32s (638 ko/s) | + | 22,8 Mo réceptionnés en 24s (949 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' | ||
| - | 341 packages can be upgraded. Run 'apt list --upgradable' | + | 358 packages can be upgraded. Run 'apt list --upgradable' |
| trainee@web01: | trainee@web01: | ||
| déconnexion | déconnexion | ||
| Connection to web01 closed. | Connection to web01 closed. | ||
| - | [trainee@centos8 | + | </ |
| + | |||
| + | < | ||
| + | trainee@debian11:~$ ssh -l trainee web02 | ||
| + | The authenticity of host 'web02 (10.0.2.55)' | ||
| + | ECDSA key fingerprint is SHA256: | ||
| + | Are you sure you want to continue connecting (yes/ | ||
| + | Warning: Permanently added ' | ||
| 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 284: | Ligne 285: | ||
| 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: |
| + | </ | ||
| + | |||
| + | Modifiez le contenu du fichier **/ | ||
| + | |||
| + | < | ||
| + | trainee@web02: | ||
| + | |||
| + | trainee@web02: | ||
| + | # | ||
| + | |||
| + | # deb cdrom: | ||
| + | |||
| + | #deb cdrom: | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| trainee@web02: | trainee@web02: | ||
| - | 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://ftp.fr.debian.org/ | + | 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://archive.debian.org/ |
| - | 21,0 Mo réceptionnés en 32s (639 ko/s) | + | 22,8 Mo réceptionnés en 24s (949 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' | ||
| - | 341 packages can be upgraded. Run 'apt list --upgradable' | + | 358 packages can be upgraded. Run 'apt list --upgradable' |
| trainee@web02: | trainee@web02: | ||
| déconnexion | déconnexion | ||
| Connection to web02 closed. | Connection to web02 closed. | ||
| - | [trainee@centos8 | + | </ |
| + | |||
| + | < | ||
| + | trainee@debian11:~$ ssh -l trainee web03 | ||
| + | The authenticity of host 'web03 (10.0.2.56)' | ||
| + | ECDSA key fingerprint is SHA256: | ||
| + | Are you sure you want to continue connecting (yes/ | ||
| + | Warning: Permanently added ' | ||
| Debian GNU/Linux 9 | 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 | Linux web03.i2tch.loc 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 | ||
| Ligne 315: | Ligne 344: | ||
| 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: |
| + | </ | ||
| + | |||
| + | Modifiez le contenu du fichier **/ | ||
| + | |||
| + | < | ||
| + | trainee@web03: | ||
| + | |||
| + | trainee@web03: | ||
| + | # | ||
| + | |||
| + | # deb cdrom: | ||
| + | |||
| + | #deb cdrom: | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| trainee@web03: | trainee@web03: | ||
| - | 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://ftp.fr.debian.org/ | + | 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://archive.debian.org/ |
| - | 21,0 Mo réceptionnés en 40s (524 ko/s) | + | 22,8 Mo réceptionnés en 24s (949 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' | ||
| - | 341 packages can be upgraded. Run 'apt list --upgradable' | + | 358 packages can be upgraded. Run 'apt list --upgradable' |
| trainee@web03: | trainee@web03: | ||
| déconnexion | déconnexion | ||
| Connection to web03 closed. | Connection to web03 closed. | ||
| - | [trainee@centos8 | + | </ |
| + | |||
| + | < | ||
| + | trainee@debian11:~$ ssh -l trainee web04 | ||
| + | The authenticity of host 'web04 (10.0.2.57)' | ||
| + | ECDSA key fingerprint is SHA256: | ||
| + | Are you sure you want to continue connecting (yes/ | ||
| + | Warning: Permanently added ' | ||
| 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 346: | Ligne 403: | ||
| 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: |
| + | </ | ||
| + | |||
| + | Modifiez le contenu du fichier **/ | ||
| + | |||
| + | < | ||
| + | trainee@web04: | ||
| + | |||
| + | trainee@web04: | ||
| + | # | ||
| + | |||
| + | # deb cdrom: | ||
| + | |||
| + | #deb cdrom: | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| trainee@web04: | trainee@web04: | ||
| - | 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://ftp.fr.debian.org/ | + | 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://ftp.fr.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://security.debian.org/ | + | Réception de:10 http://archive.debian.org/ |
| - | Réception de:11 http://ftp.fr.debian.org/ | + | Réception de:11 http://archive.debian.org/ |
| - | 21,0 Mo réceptionnés en 39s (535 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' | ||
| - | 341 packages can be upgraded. Run 'apt list --upgradable' | + | 358 packages can be upgraded. Run 'apt list --upgradable' |
| trainee@web04: | trainee@web04: | ||
| déconnexion | déconnexion | ||
| Connection to web04 closed. | Connection to web04 closed. | ||
| - | [trainee@centos8 ~]$ | ||
| </ | </ | ||
| Ligne 373: | Ligne 450: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ ansible all -i 10.0.2.54, -m ping |
| - | [DEPRECATION WARNING]: | + | [DEPRECATION WARNING]: |
| - | This feature will be removed | + | will default |
| + | removed 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 383: | Ligne 461: | ||
| " | " | ||
| } | } | ||
| - | [trainee@centos8 | + | |
| - | [DEPRECATION WARNING]: | + | trainee@debian11:~$ ansible all -i 10.0.2.55, -m ping |
| - | This feature will be removed | + | [DEPRECATION WARNING]: |
| + | will default | ||
| + | removed 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 393: | Ligne 473: | ||
| " | " | ||
| } | } | ||
| - | </ | ||
| - | Utilisez de nouveau la commande **ansible** afin de vérifier le statut des machines | + | trainee@debian11: |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host 10.0.2.56 should use / | ||
| + | will default to using the discovered platform python for this host. See https:// | ||
| + | removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| + | 10.0.2.56 | SUCCESS => { | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | } | ||
| - | < | + | trainee@debian11:~$ ansible all -i 10.0.2.57, -m ping |
| - | [trainee@centos8 | + | [DEPRECATION WARNING]: |
| - | [DEPRECATION WARNING]: | + | will default |
| - | This feature will be removed | + | removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. |
| - | web02 | SUCCESS => { | + | 10.0.2.57 |
| " | " | ||
| " | " | ||
| Ligne 408: | Ligne 497: | ||
| " | " | ||
| } | } | ||
| + | |||
| + | trainee@debian11: | ||
| + | </ | ||
| + | |||
| + | Utilisez de nouveau la commande **ansible** afin de vérifier le statut des machines : | ||
| + | |||
| + | < | ||
| + | trainee@debian11: | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web01 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| web01 | SUCCESS => { | web01 | SUCCESS => { | ||
| " | " | ||
| Ligne 415: | Ligne 515: | ||
| " | " | ||
| } | } | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web03 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| web03 | SUCCESS => { | web03 | SUCCESS => { | ||
| " | " | ||
| Ligne 422: | Ligne 525: | ||
| " | " | ||
| } | } | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web04 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| web04 | SUCCESS => { | web04 | SUCCESS => { | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web02 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| + | web02 | SUCCESS => { | ||
| " | " | ||
| " | " | ||
| Ligne 431: | Ligne 547: | ||
| </ | </ | ||
| - | <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 438: | Ligne 554: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ ansible all -i web01, |
| - | [DEPRECATION WARNING]: | + | [DEPRECATION WARNING]: |
| - | This feature will be removed | + | default to using the discovered platform python for this host. See https:// |
| + | in version | ||
| + | web01 | CHANGED | rc=0 >> | ||
| + | | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web02 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | 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 >> | ||
| - | 11:40:49 up 18:26, 1 user, load average: 0,24, 0,11, 0,03 | + | 14:40:05 up 21 min, 1 user, load average: 0,01, 0,08, 0,19 |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web03 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| web03 | CHANGED | rc=0 >> | web03 | CHANGED | rc=0 >> | ||
| - | 11:40:49 up 18:26, 1 user, load average: 0,10, 0,03, 0,01 | + | 14:40:05 up 21 min, 1 user, load average: 0,13, 0,10, 0,21 |
| - | web01 | CHANGED | rc=0 >> | + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web04 should use / |
| - | 11:40:49 up 18:26, 1 user, load average: 0,00, 0,00, 0,00 | + | default to using the discovered platform python for this host. See https:// |
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| web04 | CHANGED | rc=0 >> | web04 | CHANGED | rc=0 >> | ||
| - | 11:40:49 up 18:26, 1 user, load average: 0,00, 0,00, 0,00 | + | 14:40:05 up 21 min, 1 user, load average: 0,00, 0,08, 0,22 |
| </ | </ | ||
| Ligne 552: | Ligne 678: | ||
| * 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 862: | ||
| 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' | ||
| </ | </ | ||
| - | Dans la machine virtuelle **centos8**, créez le fichier Inventory File suivant : | + | Dans la machine virtuelle **debian11**, créez le fichier Inventory File suivant : |
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ vi inventory |
| - | [trainee@centos8 | + | trainee@debian11:~$ cat inventory |
| [basededonnees] | [basededonnees] | ||
| web01 | web01 | ||
| Ligne 767: | Ligne 893: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ vi playbook.yaml |
| - | [trainee@centos8 | + | trainee@debian11:~$ cat playbook.yaml |
| --- | --- | ||
| - hosts: basededonnees | - hosts: basededonnees | ||
| Ligne 796: | Ligne 922: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ 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] ***************************************************************************************************************************************************************************************** |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web01 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web01] | ok: [web01] | ||
| - | TASK [install] *************************************************************************************************************************************************************************************************** | + | TASK [install] *********************************************************************************************************************************************************************************************** |
| + | [WARNING]: Updating cache and auto-installing missing dependency: python-apt | ||
| changed: [web01] | changed: [web01] | ||
| - | TASK [service] | + | TASK [service] *********************************************************************************************************************************************************************************************** |
| ok: [web01] | ok: [web01] | ||
| - | PLAY [dotcms] **************************************************************************************************************************************************************************************************** | + | PLAY [dotcms] ************************************************************************************************************************************************************************************************ |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | |
| + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web02 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web02] | ok: [web02] | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web03 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web03] | ok: [web03] | ||
| - | TASK [install jre] *********************************************************************************************************************************************************************************************** | + | TASK [install jre] ******************************************************************************************************************************************************************************************* |
| - | ok: [web03] | + | |
| ok: [web02] | ok: [web02] | ||
| + | ok: [web03] | ||
| - | PLAY [equilibrage] | + | PLAY [equilibrage] ******************************************************************************************************************************************************************************************* |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web04 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web04] | ok: [web04] | ||
| - | TASK [install] | + | TASK [install] *********************************************************************************************************************************************************************************************** |
| changed: [web04] | changed: [web04] | ||
| - | TASK [service] | + | TASK [service] *********************************************************************************************************************************************************************************************** |
| ok: [web04] | ok: [web04] | ||
| - | PLAY RECAP ******************************************************************************************************************************************************************************************************* | + | PLAY RECAP *************************************************************************************************************************************************************************************************** |
| web01 : ok=3 changed=1 | web01 : ok=3 changed=1 | ||
| web02 : ok=2 changed=0 | web02 : ok=2 changed=0 | ||
| Ligne 841: | Ligne 979: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ 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] ***************************************************************************************************************************************************************************************** |
| skipping: no hosts matched | skipping: no hosts matched | ||
| - | PLAY [dotcms] | + | PLAY [dotcms] ************************************************************************************************************************************************************************************************ |
| skipping: no hosts matched | skipping: no hosts matched | ||
| - | PLAY [equilibrage] | + | PLAY [equilibrage] ******************************************************************************************************************************************************************************************* |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web04 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web04] | ok: [web04] | ||
| - | TASK [install] | + | TASK [install] *********************************************************************************************************************************************************************************************** |
| ok: [web04] | ok: [web04] | ||
| - | TASK [service] | + | TASK [service] *********************************************************************************************************************************************************************************************** |
| ok: [web04] | ok: [web04] | ||
| - | PLAY RECAP ******************************************************************************************************************************************************************************************************* | + | PLAY RECAP *************************************************************************************************************************************************************************************************** |
| web04 : ok=3 changed=0 | web04 : ok=3 changed=0 | ||
| </ | </ | ||
| Ligne 869: | Ligne 1008: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ 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] ***************************************************************************************************************************************************************************************** |
| skipping: no hosts matched | skipping: no hosts matched | ||
| - | PLAY [dotcms] | + | PLAY [dotcms] ************************************************************************************************************************************************************************************************ |
| skipping: no hosts matched | skipping: no hosts matched | ||
| - | PLAY [equilibrage] | + | PLAY [equilibrage] ******************************************************************************************************************************************************************************************* |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web04 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web04] | ok: [web04] | ||
| - | TASK [install] | + | TASK [install] *********************************************************************************************************************************************************************************************** |
| ok: [web04] | ok: [web04] | ||
| - | TASK [service] | + | TASK [service] *********************************************************************************************************************************************************************************************** |
| ok: [web04] | ok: [web04] | ||
| - | PLAY RECAP ******************************************************************************************************************************************************************************************************* | + | PLAY RECAP *************************************************************************************************************************************************************************************************** |
| - | web04 : ok=3 changed=0 | + | web04 : ok=3 changed=0 |
| </ | </ | ||
| Ligne 910: | Ligne 1050: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ 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] ***************************************************************************************************************************************************************************************** |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web01 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web01] | ok: [web01] | ||
| - | TASK [service] | + | TASK [service] *********************************************************************************************************************************************************************************************** |
| ok: [web01] | ok: [web01] | ||
| - | PLAY [dotcms] | + | PLAY [dotcms] ************************************************************************************************************************************************************************************************ |
| - | TASK [Gathering Facts] | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| - | ok: [web02] | + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web03 should use / |
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web03] | ok: [web03] | ||
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web02 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| + | ok: [web02] | ||
| - | PLAY [equilibrage] | + | PLAY [equilibrage] ******************************************************************************************************************************************************************************************* |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web04 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web04] | ok: [web04] | ||
| - | TASK [service] | + | TASK [service] *********************************************************************************************************************************************************************************************** |
| ok: [web04] | ok: [web04] | ||
| - | PLAY RECAP ******************************************************************************************************************************************************************************************************* | + | PLAY RECAP *************************************************************************************************************************************************************************************************** |
| web01 : ok=2 changed=0 | web01 : ok=2 changed=0 | ||
| web02 : ok=1 changed=0 | web02 : ok=1 changed=0 | ||
| Ligne 946: | Ligne 1096: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ 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] ***************************************************************************************************************************************************************************************** |
| skipping: no hosts matched | skipping: no hosts matched | ||
| - | PLAY [dotcms] | + | PLAY [dotcms] ************************************************************************************************************************************************************************************************ |
| skipping: no hosts matched | skipping: no hosts matched | ||
| - | PLAY [equilibrage] | + | PLAY [equilibrage] ******************************************************************************************************************************************************************************************* |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| + | [DEPRECATION WARNING]: Distribution debian 9.7 on host web04 should use / | ||
| + | default to using the discovered platform python for this host. See https:// | ||
| + | in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. | ||
| ok: [web04] | ok: [web04] | ||
| - | TASK [service] | + | TASK [service] *********************************************************************************************************************************************************************************************** |
| ok: [web04] | ok: [web04] | ||
| - | PLAY RECAP ******************************************************************************************************************************************************************************************************* | + | PLAY RECAP *************************************************************************************************************************************************************************************************** |
| - | web04 : ok=2 changed=0 | + | web04 : ok=2 changed=0 |
| </ | </ | ||
| Ligne 993: | Ligne 1144: | ||
| * 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 1226: | ||
| {{ : | {{ : | ||
| - | <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 // | ||
| </ | </ | ||
| - | Dans la machine **centos8**, collez la commande copiée et exécutez-la : | + | Dans la machine **debian11**, collez la commande copiée et exécutez-la : |
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ 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 ' | ||
| - | - downloading role from https:// | + | - downloading role from https:// |
| - extracting geerlingguy.java to / | - extracting geerlingguy.java to / | ||
| - | - geerlingguy.java (2.0.1) was installed successfully | + | - geerlingguy.java (2.3.1) was installed successfully |
| </ | </ | ||
| Ligne 1095: | Ligne 1244: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ su - |
| - | Password: | + | Password: |
| - | [root@centos8 | + | |
| - | /usr/bin/tree | + | root@debian11:~# which tree |
| - | [root@centos8 | + | |
| + | root@debian11: | ||
| + | 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: | ||
| + | tree | ||
| + | 0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded. | ||
| + | Need to get 49.6 kB of archives. | ||
| + | After this operation, 118 kB of additional disk space will be used. | ||
| + | Get:1 http://deb.debian.org/debian bullseye/ | ||
| + | Fetched 49.6 kB in 0s (3,346 kB/s) | ||
| + | Selecting previously unselected package tree. | ||
| + | (Reading database ... 206553 files and directories currently installed.) | ||
| + | Preparing to unpack .../ | ||
| + | Unpacking tree (1.8.0-1+b1) ... | ||
| + | Setting up tree (1.8.0-1+b1) ... | ||
| + | Processing triggers for man-db (2.9.4-2) ... | ||
| + | |||
| + | root@debian11:~# exit | ||
| logout | logout | ||
| - | [trainee@centos8 | + | |
| + | trainee@debian11:~$ tree / | ||
| / | / | ||
| ├── defaults | ├── defaults | ||
| Ligne 1123: | Ligne 1295: | ||
| ├── 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 1129: | Ligne 1302: | ||
| ├── 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-22.yml | ||
| - | 7 directories, | + | 7 directories, |
| </ | </ | ||
| - | <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 1145: | Ligne 1320: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ vi playbook_java.yaml |
| - | [trainee@centos8 | + | trainee@debian11:~$ cat playbook_java.yaml |
| --- | --- | ||
| - hosts: all | - hosts: all | ||
| Ligne 1157: | Ligne 1332: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ vi .ansible.cfg |
| - | [trainee@centos8 | + | trainee@debian11:~$ cat .ansible.cfg |
| [defaults] | [defaults] | ||
| deprecation_warnings=False | deprecation_warnings=False | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| **Important** : Le comportement d' | **Important** : Le comportement d' | ||
| </ | </ | ||
| Ligne 1170: | Ligne 1345: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ ansible-config list | more |
| ACTION_WARNINGS: | ACTION_WARNINGS: | ||
| default: true | default: true | ||
| - | description: | + | description: |
| - | | + | - By default Ansible will issue a warning when received from a task action (module |
| - | | + | |
| + | - These warnings can be silenced by adjusting this setting to False. | ||
| env: | env: | ||
| - | - {name: ANSIBLE_ACTION_WARNINGS} | + | - name: ANSIBLE_ACTION_WARNINGS |
| ini: | ini: | ||
| - | - {key: action_warnings, section: defaults} | + | - key: action_warnings |
| + | | ||
| name: Toggle action warnings | name: Toggle action warnings | ||
| type: boolean | type: boolean | ||
| Ligne 1188: | Ligne 1365: | ||
| the command line supplied become method | the command line supplied become method | ||
| env: | env: | ||
| - | - {name: ANSIBLE_AGNOSTIC_BECOME_PROMPT} | + | - name: ANSIBLE_AGNOSTIC_BECOME_PROMPT |
| ini: | ini: | ||
| - | - {key: agnostic_become_prompt, section: privilege_escalation} | + | - key: agnostic_become_prompt |
| + | | ||
| name: Display an agnostic become prompt | name: Display an agnostic become prompt | ||
| type: boolean | type: boolean | ||
| version_added: | version_added: | ||
| - | yaml: {key: privilege_escalation.agnostic_become_prompt} | + | yaml: |
| + | | ||
| ALLOW_WORLD_READABLE_TMPFILES: | ALLOW_WORLD_READABLE_TMPFILES: | ||
| default: false | default: false | ||
| - | deprecated: | + | deprecated: |
| - | version: ' | + | |
| - | description: | + | itself and not using the general constant. |
| - | | + | |
| - | still accepted with the shell plugin adding additional options, like variables.', | + | version: ' |
| - | | + | |
| + | description: | ||
| + | - This makes the temporary files created on the machine world-readable and will | ||
| + | issue a warning instead of failing the task. | ||
| + | - It is useful when becoming an unprivileged user. | ||
| + | env: [] | ||
| + | ini: | ||
| + | - key: allow_world_readable_tmpfiles | ||
| + | | ||
| name: Allow world-readable temporary files | name: Allow world-readable temporary files | ||
| type: boolean | type: boolean | ||
| + | version_added: | ||
| + | yaml: | ||
| + | key: defaults.allow_world_readable_tmpfiles | ||
| ANSIBLE_CONNECTION_PATH: | ANSIBLE_CONNECTION_PATH: | ||
| default: null | default: null | ||
| - | description: | + | description: |
| - | | + | - Specify where to look for the ansible-connection script. This location will be |
| - | | + | |
| - | env: | + | - If null, ansible will start with the same directory as the ansible script. |
| - | - {name: ANSIBLE_CONNECTION_PATH} | + | |
| - | ini: | + | |
| - | - {key: ansible_connection_path, | + | |
| - | name: Path of ansible-connection script | + | |
| - | type: path | + | |
| - | version_added: | + | |
| - | yaml: {key: persistent_connection.ansible_connection_path} | + | |
| - | ANSIBLE_COW_ACCEPTLIST: | + | |
| - | default: [bud-frogs, bunny, cheese, daemon, default, dragon, elephant-in-snake, | + | |
| - | elephant, eyes, hellokitty, kitty, luke-koala, meow, milk, moofasa, moose, ren, | + | |
| - | sheep, small, stegosaurus, | + | |
| - | udder, vader-koala, | + | |
| - | description: | + | |
| - | list if you want to enable all installed templates. | + | |
| - | env: | + | |
| - | - deprecated: {alternatives: | + | |
| --More-- | --More-- | ||
| </ | </ | ||
| Ligne 1233: | Ligne 1407: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ ansible-playbook -i inventory playbook_java.yaml |
| - | PLAY [all] ******************************************************************************************************************************************************************************************************* | + | PLAY [all] *************************************************************************************************************************************************************************************************** |
| - | TASK [Gathering Facts] ******************************************************************************************************************************************************************************************* | + | TASK [Gathering Facts] *************************************************************************************************************************************************************************************** |
| - | ok: [web04] | + | |
| ok: [web01] | ok: [web01] | ||
| + | ok: [web02] | ||
| ok: [web03] | ok: [web03] | ||
| - | ok: [web02] | + | ok: [web04] |
| - | TASK [geerlingguy.java : Include OS-specific variables for Fedora or FreeBSD.] | + | TASK [geerlingguy.java : Include OS-specific variables for Fedora or FreeBSD.] ******************************************************************************************************************************* |
| skipping: [web01] | skipping: [web01] | ||
| skipping: [web02] | skipping: [web02] | ||
| Ligne 1249: | Ligne 1423: | ||
| skipping: [web04] | skipping: [web04] | ||
| - | TASK [geerlingguy.java : Include version-specific variables for CentOS/ | + | TASK [geerlingguy.java : Include version-specific variables for CentOS/ |
| skipping: [web01] | skipping: [web01] | ||
| skipping: [web02] | skipping: [web02] | ||
| Ligne 1255: | Ligne 1429: | ||
| skipping: [web04] | skipping: [web04] | ||
| - | TASK [geerlingguy.java : Include version-specific variables for Ubuntu.] | + | TASK [geerlingguy.java : Include version-specific variables for Ubuntu.] ************************************************************************************************************************************* |
| skipping: [web01] | skipping: [web01] | ||
| skipping: [web02] | skipping: [web02] | ||
| Ligne 1261: | Ligne 1435: | ||
| skipping: [web04] | skipping: [web04] | ||
| - | TASK [geerlingguy.java : Include version-specific variables for Debian.] ***************************************************************************************************************************************** | + | TASK [geerlingguy.java : Include version-specific variables for Debian.] ************************************************************************************************************************************* |
| + | ok: [web01] | ||
| ok: [web02] | ok: [web02] | ||
| ok: [web03] | ok: [web03] | ||
| - | ok: [web01] | ||
| ok: [web04] | ok: [web04] | ||
| - | TASK [geerlingguy.java : Define java_packages.] | + | TASK [geerlingguy.java : Define java_packages.] ************************************************************************************************************************************************************** |
| ok: [web01] | ok: [web01] | ||
| ok: [web02] | ok: [web02] | ||
| Ligne 1273: | Ligne 1447: | ||
| ok: [web04] | ok: [web04] | ||
| - | TASK [geerlingguy.java : include_tasks] | + | TASK [geerlingguy.java : include_tasks] ********************************************************************************************************************************************************************** |
| skipping: [web01] | skipping: [web01] | ||
| skipping: [web02] | skipping: [web02] | ||
| Ligne 1279: | Ligne 1453: | ||
| skipping: [web04] | skipping: [web04] | ||
| - | TASK [geerlingguy.java : include_tasks] | + | TASK [geerlingguy.java : include_tasks] ********************************************************************************************************************************************************************** |
| included: / | included: / | ||
| - | TASK [geerlingguy.java : Ensure ' | + | TASK [geerlingguy.java : Ensure ' |
| skipping: [web01] | skipping: [web01] | ||
| skipping: [web02] | skipping: [web02] | ||
| Ligne 1288: | Ligne 1462: | ||
| skipping: [web04] | skipping: [web04] | ||
| - | TASK [geerlingguy.java : Ensure Java is installed.] ************************************************************************************************************************************************************** | + | TASK [geerlingguy.java : Ensure Java is installed.] ********************************************************************************************************************************************************** |
| - | changed: [web04] | + | |
| changed: [web03] | changed: [web03] | ||
| + | changed: [web04] | ||
| changed: [web02] | changed: [web02] | ||
| changed: [web01] | changed: [web01] | ||
| - | TASK [geerlingguy.java : include_tasks] | + | TASK [geerlingguy.java : include_tasks] ********************************************************************************************************************************************************************** |
| skipping: [web01] | skipping: [web01] | ||
| skipping: [web02] | skipping: [web02] | ||
| Ligne 1300: | Ligne 1474: | ||
| skipping: [web04] | skipping: [web04] | ||
| - | TASK [geerlingguy.java : Set JAVA_HOME if configured.] | + | TASK [geerlingguy.java : Set JAVA_HOME if configured.] ******************************************************************************************************************************************************* |
| skipping: [web01] | skipping: [web01] | ||
| skipping: [web02] | skipping: [web02] | ||
| Ligne 1306: | Ligne 1480: | ||
| skipping: [web04] | skipping: [web04] | ||
| - | PLAY RECAP ******************************************************************************************************************************************************************************************************* | + | PLAY RECAP *************************************************************************************************************************************************************************************************** |
| web01 : ok=5 changed=1 | web01 : ok=5 changed=1 | ||
| web02 : ok=5 changed=1 | web02 : ok=5 changed=1 | ||
| Ligne 1316: | Ligne 1490: | ||
| < | < | ||
| - | [trainee@centos8 | + | trainee@debian11:~$ ansible-config dump |grep ROLES_PATH |
| DEFAULT_ROLES_PATH(default) = ['/ | DEFAULT_ROLES_PATH(default) = ['/ | ||
| </ | </ | ||
| Ligne 1368: | Ligne 1542: | ||
| ----- | ----- | ||
| - | Copyright © 2022 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |