tech:notes_ansible
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 | ||
| tech:notes_ansible [2025/11/03 13:30] – Jean-Baptiste | tech:notes_ansible [2026/06/29 14:38] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Ansible | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * [Booster vos pratiques DEVOPS avec Ansible AWX](https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | |||
| + | Liste des modules Ansible par catégorie : https:// | ||
| + | |||
| + | Glossary | ||
| + | * https:// | ||
| + | |||
| + | Voir mode pull : | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * https:// | ||
| + | |||
| + | Exemples cool : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | A lire | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## Install et config | ||
| + | |||
| + | ### Install avec PIP | ||
| + | |||
| + | |||
| + | `https:// | ||
| + | ~~~bash | ||
| + | #!/bin/bash | ||
| + | sudo apt-get update | ||
| + | sudo apt-get install -y git python-pip python-dev | ||
| + | sudo pip install jinja2 | ||
| + | sudo pip install ansible | ||
| + | sudo ansible-galaxy install -r / | ||
| + | ansible-playbook -i " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Doc | ||
| + | |||
| + | Voir ansible-doc. Exemple : | ||
| + | ~~~bash | ||
| + | ansible-doc -t keyword -l | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Inventaire | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | " | ||
| + | ~~~bash | ||
| + | ansible -m ping all -i ' | ||
| + | ~~~ | ||
| + | |||
| + | lister toutes les nœuds | ||
| + | ~~~bash | ||
| + | ansible-inventory --list -y | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## config | ||
| + | |||
| + | ~~~bash | ||
| + | cp / | ||
| + | mkdir ~/.ansible | ||
| + | cp / | ||
| + | |||
| + | sed -i -e ' | ||
| + | sed -i -e ' | ||
| + | |||
| + | sed -i -e ' | ||
| + | |||
| + | echo " | ||
| + | ~~~ | ||
| + | |||
| + | Ou | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [defaults] | ||
| + | host_key_checking = False | ||
| + | timeout = 60 | ||
| + | vault_password_file = / | ||
| + | ansible_managed = Ansible managed file, do not edit directly | ||
| + | filter_plugins = / | ||
| + | lookup_plugins = / | ||
| + | library = / | ||
| + | remote_tmp = / | ||
| + | local_tmp = / | ||
| + | # | ||
| + | |||
| + | [ssh_connection] | ||
| + | pipelining = True | ||
| + | ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o UserKnownHostsFile=/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | export ANSIBLE_CONFIG=$HOME/ | ||
| + | ansible -i ~/ | ||
| + | ~~~ | ||
| + | |||
| + | La connexion via SSH doit être configurée via ~/ | ||
| + | Si besion : | ||
| + | ~~~bash | ||
| + | ssh-agent -k | ||
| + | eval $(ssh-agent -s) | ||
| + | ssh-add | ||
| + | ~~~ | ||
| + | |||
| + | Exemple de conf par variables | ||
| + | ~~~bash | ||
| + | export ANSIBLE_ALLOW_EMBEDDED_TEMPLATES=false | ||
| + | export ANSIBLE_NOCOWS=true | ||
| + | export BECOME_ALLOW_SAME_USER=false | ||
| + | export ANSIBLE_PRIVATE_ROLE_VARS=true | ||
| + | export ANSIBLE_DISPLAY_ARGS_TO_STDOUT=true | ||
| + | export ANSIBLE_DISPLAY_TRACEBACK=always | ||
| + | export ANSIBLE_DUPLICATE_YAML_DICT_KEY=error | ||
| + | # export ANSIBLE_ENABLE_TASK_DEBUGGER=true | ||
| + | export ANSIBLE_HOST_PATTERN_MISMATCH=error | ||
| + | export ANSIBLE_INVENTORY_ANY_UNPARSED_IS_FAILED=true | ||
| + | export ANSIBLE_INVENTORY_UNPARSED_FAILED=true | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Usage | ||
| + | |||
| + | Sudo / become | ||
| + | |||
| + | ~~~bash | ||
| + | ansible-playbook -u user -kKb playbook.yml | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## Sur les serveurs distants | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install python-minimal libpython-stdlib sudo | ||
| + | ~~~ | ||
| + | |||
| + | ## Traitements parallèles | ||
| + | |||
| + | Voir : | ||
| + | * [[Ansible - Accélérer Ansible grâce au module Mitogen]] | ||
| + | * [[Notes commande xargs]] | ||
| + | |||
| + | Exemple 1 | ||
| + | |||
| + | `ansible.cfg` | ||
| + | ~~~ini | ||
| + | [defaults] | ||
| + | strategy = free | ||
| + | ~~~ | ||
| + | |||
| + | Exemple 2 | ||
| + | ~~~bash | ||
| + | ansible -e serial_number=50 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Connexions | ||
| + | |||
| + | ~~~ini | ||
| + | [arista] | ||
| + | eos ansible_host=192.168.2.10 ansible_connection=network_cli ansible_network_os=eos | ||
| + | |||
| + | [juniper] | ||
| + | junos ansible_host=192.168.2.20 ansible_connection=netconf ansible_network_os=junos | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | Lancer une commande | ||
| + | ~~~bash | ||
| + | ansible all -a "free -m" | ||
| + | ~~~ | ||
| + | |||
| + | Lancer une commande bash (utilisation Pipe vars etc...) | ||
| + | ~~~bash | ||
| + | ansible all -m shell -a " | ||
| + | ~~~ | ||
| + | |||
| + | Connaître toutes les variables et les valeurs associées (Nom machine, mémoire, Version noyaux ...) | ||
| + | ~~~bash | ||
| + | ansible all -m setup | ||
| + | ~~~ | ||
| + | |||
| + | Lancer une commande simultanément sur plusieurs serveurs par lots de 2 machines | ||
| + | **-s** pour **sudo** | ||
| + | ~~~bash | ||
| + | ansible webservers -m service -a " | ||
| + | ~~~ | ||
| + | |||
| + | Mode " | ||
| + | |||
| + | ** --check** \ | ||
| + | ou **--check--diff --limit foo.example.com** | ||
| + | |||
| + | `always_run: | ||
| + | |||
| + | lineinfile | ||
| + | |||
| + | A la place de **lineinfile** il existe aussi **replace** | ||
| + | |||
| + | ### Dépendance de rôles | ||
| + | |||
| + | Quand un rôle dépend d'un autre. \\ | ||
| + | Ici **foo** dépend de **bar** | ||
| + | |||
| + | |||
| + | `roles/ | ||
| + | ~~~yaml | ||
| + | --- | ||
| + | allow_duplicates: | ||
| + | dependencies: | ||
| + | - role: bar | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Exemple | ||
| + | |||
| + | Exemple | ||
| + | * Découpage " | ||
| + | * "when when" | ||
| + | * **Include** dans un **role** | ||
| + | * Action si fichier n' | ||
| + | ** Si `/ | ||
| + | *** `systemctl add-wants multi-user.target rpcbind.service` | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~yaml | ||
| + | --- | ||
| + | - name: Include tasks | ||
| + | ansible.builtin.include_tasks: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~yaml | ||
| + | --- | ||
| + | - name: Ubuntu lancer rpcbind avant NIS | ||
| + | stat: path='/ | ||
| + | register: systemdwants | ||
| + | |||
| + | - name: DEBUG | ||
| + | debug: msg=" | ||
| + | |||
| + | - name: Ubuntu lancer rpcbind avant NIS 2 | ||
| + | command: systemctl add-wants multi-user.target rpcbind.service | ||
| + | # when: systemdwants.stat.exists == False | ||
| + | when: not systemdwants.stat.exists | ||
| + | notify: | ||
| + | - restart nis | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ### Vérifier si un paquet deb est déjà installé | ||
| + | |||
| + | Source : http:// | ||
| + | |||
| + | ~~~yaml | ||
| + | --- | ||
| + | |||
| + | - name: Check if my_package is installed | ||
| + | command: dpkg-query -W my_package | ||
| + | register: my_package_check_deb | ||
| + | failed_when: | ||
| + | changed_when: | ||
| + | check_mode: false | ||
| + | |||
| + | - name: copie du paquet my_package | ||
| + | copy: src=my_package_linux.ubuntu14.04_x86-64.deb dest=/ | ||
| + | changed_when: | ||
| + | |||
| + | - name: installation des dépendances | ||
| + | apt: name=libacl1 state=present | ||
| + | changed_when: | ||
| + | |||
| + | - name: install du paquet | ||
| + | apt: deb=/ | ||
| + | changed_when: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Exemple de find shell | ||
| + | |||
| + | ~~~yaml | ||
| + | - name: /var/log/* readable by user process - find | ||
| + | shell: 'find /var/log/ -not \( -perm /o=r -o -user process \) -a -not \( -wholename "/ | ||
| + | changed_when: | ||
| + | always_run: True | ||
| + | register: list_files_var_log_notreadable | ||
| + | |||
| + | - name: /var/log/* readable by user process - set | ||
| + | file: mode=" | ||
| + | #file: mode=" | ||
| + | with_items: | ||
| + | - "{{ list_files_var_log_notreadable.stdout.split(' | ||
| + | when: list_files_var_log_notreadable.stdout != "" | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Exemples include role conditionnel | ||
| + | |||
| + | Exemple 1 | ||
| + | ~~~yaml | ||
| + | - hosts: webservers | ||
| + | roles: | ||
| + | - { role: debian_stock_config, | ||
| + | ~~~ | ||
| + | |||
| + | Exemple 2 | ||
| + | ~~~yaml | ||
| + | - name: Enable local cache DNS | ||
| + | include_role: | ||
| + | name: acme.dns.enable_local_cache_dns | ||
| + | vars: | ||
| + | EVAR_BACKUP_NAME: | ||
| + | host_func_excluded: | ||
| + | - FOO | ||
| + | # trigramme_appli: | ||
| + | trigramme_appli: | ||
| + | when: not trigramme_appli | lower in host_func_excluded | lower | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Notes Ansible | ||
| + | |||
| + | ### Lancer l' | ||
| + | |||
| + | always_run is deprecated. Use check_mode = no instead | ||
| + | |||
| + | ~~~yaml | ||
| + | # | ||
| + | check_mode: false | ||
| + | ~~~ | ||
| + | |||
| + | Parfois il est préférable de trouver une solution plus élégante. Par exemple : | ||
| + | ~~~yaml | ||
| + | - name: mkdir /san/label | ||
| + | file: dest='/ | ||
| + | with_items: | ||
| + | #- '{{ list_label_ext4devs.stdout_lines }}' | ||
| + | #- '{{ list_label_xfsdevs.stdout_lines }}' | ||
| + | - '{{ list_label_ext4devs.stdout_lines | default() }}' | ||
| + | - '{{ list_label_xfsdevs.stdout_lines | ||
| + | ~~~ | ||
| + | |||
| + | Ici nous utilisons `default()` pour éviter une erreur à cause d'un champ vide | ||
| + | |||
| + | ~~~ | ||
| + | fatal: [plop1]: FAILED! => {" | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Ignorer si mode check (ne pas tester) | ||
| + | |||
| + | `when: not ansible_check_mode` | ||
| + | |||
| + | ~~~bash | ||
| + | - name: activation service sysstat 1 | ||
| + | lineinfile: dest=/ | ||
| + | when: not ansible_check_mode | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Exemple module command ne lancer qu'une seule fois une commande. | ||
| + | |||
| + | ~~~yaml | ||
| + | - name: newer autolock screen - do conf | ||
| + | command: dbus-launch gsettings set org.gnome.desktop.lockdown disable-lock-screen true | ||
| + | become: '{{ autologin_user }}' | ||
| + | args: | ||
| + | creates: / | ||
| + | |||
| + | - name: newer autolock screen - jalon exist ? | ||
| + | stat: path=/ | ||
| + | register: p | ||
| + | |||
| + | - name: newer autolock screen - jalon touch | ||
| + | file: path=/ | ||
| + | # when: p.stat.exists == False | ||
| + | when: not p.stat.exists | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Gather_fact partiel | ||
| + | |||
| + | Grâce à `gather_subset` | ||
| + | |||
| + | `play.yml` | ||
| + | ~~~yaml | ||
| + | - name: Test | ||
| + | hosts: all | ||
| + | gather_subset: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Copie de fichiers | ||
| + | |||
| + | Une alternative à M(copy) | ||
| + | ~~~yaml | ||
| + | - name: Download file from a file path | ||
| + | # ansible.builtin.copy: | ||
| + | ansible.builtin.get_url: | ||
| + | url: file:/// | ||
| + | dest: / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ### becoming-an-unprivileged-user Err Failed to set permissions on the temporary...Not owner\nchown | ||
| + | |||
| + | Lors de l’exécution d’un playbook Ansible avec un sudo (become) faisant appel à un utilisateur non privilégié (ici « oracle ») | ||
| + | |||
| + | ~~~bash | ||
| + | ansible -m ping -u user01 -i srv1, all --become-user=oracle -b | ||
| + | ~~~ | ||
| + | |||
| + | Nous avons l’erreur suivante : | ||
| + | |||
| + | ~~~ | ||
| + | srv1 | FAILED! => { | ||
| + | " | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | Apparemment cela concernerait que AIX. | ||
| + | |||
| + | Solution | ||
| + | |||
| + | La solution de contournement la plus simple à mettre en place est de définir à True la variable `ansible_shell_allow_world_readable_temp` | ||
| + | |||
| + | `play1.yml` | ||
| + | ~~~yaml | ||
| + | # | ||
| + | |||
| + | # | ||
| + | # ./play1.yml -u user01 -i srv1, | ||
| + | |||
| + | --- | ||
| + | |||
| + | - name: test sudo oracle | ||
| + | hosts: all | ||
| + | gather_facts: | ||
| + | become: true | ||
| + | become_user: | ||
| + | vars: | ||
| + | ansible_shell_allow_world_readable_temp: | ||
| + | |||
| + | tasks: | ||
| + | - name: command id | ||
| + | command: id | ||
| + | changed_when: | ||
| + | register: cmd_id | ||
| + | |||
| + | - name: echo id | ||
| + | debug: | ||
| + | var: cmd_id | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ### Remote copy does not support recursive copy of directory | ||
| + | |||
| + | Le module **copy** ne supporte pas les copies de répertoire (mode récursif). \\ | ||
| + | Le module **synchronize** est plus approprié. | ||
| + | Dans notre exemple nous voulons copier srv1:/ | ||
| + | |||
| + | Note : peut-être que cela marche avec ' | ||
| + | |||
| + | ~~~yaml | ||
| + | - name: push omniplanar installer | ||
| + | copy: | ||
| + | src: /mnt/plop/ | ||
| + | dest: /tmp | ||
| + | remote_src: True | ||
| + | # | ||
| + | ~~~ | ||
| + | |||
| + | Solution | ||
| + | ~~~yaml | ||
| + | - name: push plop | ||
| + | synchronize: | ||
| + | src: / | ||
| + | dest: / | ||
| + | rsync_opts: | ||
| + | - " | ||
| + | - " | ||
| + | # | ||
| + | use_ssh_args: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user | ||
| + | |||
| + | Erreur | ||
| + | ~~~ | ||
| + | fatal: [aws-zbx1]: FAILED! => {" | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Solution | ||
| + | |||
| + | `~/ | ||
| + | ~~~ini | ||
| + | [defaults] | ||
| + | allow_world_readable_tmpfiles = true | ||
| + | ~~~ | ||
| + | |||
| + | ou | ||
| + | |||
| + | ~~~yaml | ||
| + | vars: | ||
| + | ansible_shell_allow_world_readable_temp: | ||
| + | ~~~ | ||
| + | |||
| + | Voir https:// | ||
| + | |||
| + | ### sudo: no tty present and no askpass program specified | ||
| + | |||
| + | Solution de contournement (workaround) | ||
| + | Source: https:// | ||
| + | |||
| + | ~~~yaml | ||
| + | lineinfile: | ||
| + | path: / | ||
| + | state: present | ||
| + | insertafter: | ||
| + | line: '{{ ansible_user }} ALL=NOPASSWD:/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | Solution 2 | ||
| + | Source : https:// | ||
| + | |||
| + | Applique la perte de l' | ||
| + | |||
| + | Ajouter `rsync_path: | ||
| + | ~~~yaml | ||
| + | tasks: | ||
| + | - name: Synchronization of src on the control machine to dest on the remote hosts | ||
| + | synchronize: | ||
| + | src: / | ||
| + | dest: /home/user | ||
| + | rsync_path: / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Pb No module named ' | ||
| + | |||
| + | ~~~ | ||
| + | $ ansible --version | ||
| + | Traceback (most recent call last): | ||
| + | File "/ | ||
| + | from ansible import context | ||
| + | ModuleNotFoundError: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | #### Solution | ||
| + | |||
| + | Test | ||
| + | ~~~bash | ||
| + | env PYTHONPATH=/ | ||
| + | ~~~ | ||
| + | |||
| + | Solution si test OK | ||
| + | |||
| + | `~/.bashrc` | ||
| + | ~~~bash | ||
| + | # Fix bug Ansible : No module named ' | ||
| + | export PYTHONPATH=$PYTHONPATH:/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Err template error while templating string: Could not load \" | ||
| + | |||
| + | ~~~ | ||
| + | TASK [dns_update_resolv_conf : Remove immutable attribute] ************************************************************************************************** | ||
| + | fatal: [localhost]: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | #### Solution | ||
| + | |||
| + | Change | ||
| + | ~~~yaml | ||
| + | when: | ||
| + | - result | failed | ||
| + | ~~~ | ||
| + | |||
| + | By | ||
| + | ~~~yaml | ||
| + | when: | ||
| + | - result is failed | ||
| + | ~~~ | ||
| + | |||
| + | Example : | ||
| + | ~~~yaml | ||
| + | - name: Remove immutable attribute | ||
| + | become: true | ||
| + | ansible.builtin.file: | ||
| + | path: "{{ resolv_filepath }}" | ||
| + | attributes: " | ||
| + | # when: stat_resolv_conf.stat.attr_flags | search(" | ||
| + | when: stat_resolv_conf.stat.attr_flags is search(" | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ### Pb passer un boolean ou des listes en extravars à Ansible | ||
| + | |||
| + | |||
| + | #### Solution | ||
| + | |||
| + | Passer par du JSON | ||
| + | |||
| + | ~~~ | ||
| + | --extra-vars ' | ||
| + | |||
| + | --extra-vars ' | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Test | ||
| + | |||
| + | Voir : | ||
| + | * [Monkeyble: Framework de test bout en bout pour Ansible](https:// | ||
| + | * ansible-test | ||
| + | * Molecule | ||
| + | * bats | ||
| + | * [Test Kitchen](https:// | ||
| + | * https:// | ||
| + | |||
| + | ~~~bash | ||
| + | ansible-test sanity --list-tests | ||
| + | ansible-test sanity --docker | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Molecule | ||
| + | |||
| + | [Introducing Ansible Molecule with Ansible Automation Platform]([https:// | ||
| + | |||
| + | |||
| + | ## Debug | ||
| + | |||
| + | ~~~ | ||
| + | env ANSIBLE_NOCOLOR=1 ansible-playbook -vvvvv | ||
| + | ~~~ | ||
| + | |||
| + | Voir le module debug | ||
| + | |||
| + | |||
| + | ~~~ | ||
| + | env ANSIBLE_DEBUG=1 ansible-playbook | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ### Ansible-lint | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * [Ansible-lint un vérificateur de syntaxe yaml playbook / rôle](https:// | ||
| + | |||
| + | `.ansible-lint` | ||
| + | ~~~yaml | ||
| + | --- | ||
| + | |||
| + | profile: null | ||
| + | exclude_paths: | ||
| + | - test/ | ||
| + | ~~~ | ||
| + | |||
| + | ~~~yaml | ||
| + | --- | ||
| + | # Offline mode disables installation of requirements.yml and schema refreshing | ||
| + | offline: true | ||
| + | |||
| + | profile: production | ||
| + | exclude_paths: | ||
| + | - .git/ | ||
| + | - .github/ | ||
| + | - .gitlab/ | ||
| + | - .cache/ | ||
| + | warn_list: | ||
| + | - var_naming | ||
| + | - idiom | ||
| + | skip_list: | ||
| + | - var-naming[no-role-prefix] | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `.ansible-lint-ignore` | ||
| + | ~~~python | ||
| + | roles/ | ||
| + | ~~~ | ||
| + | |||
| + | Exeption : | ||
| + | |||
| + | Utiliser **skip_ansible_lint** | ||
| + | |||
| + | Exemple : | ||
| + | |||
| + | ~~~yaml | ||
| + | - name: Kustomize get image | ||
| + | become: true | ||
| + | become_user: | ||
| + | ansible.builtin.shell: | ||
| + | chdir: "{{ myhome }}/ | ||
| + | cmd: "{{ myhome }}/ | ||
| + | changed_when: | ||
| + | register: reg_image | ||
| + | tags: skip_ansible_lint | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Syntax | ||
| + | |||
| + | Voir : | ||
| + | * `ansible-playbook --syntax-check` | ||
| + | * Ansible-lint | ||
| + | |||
| + | |||
| + | ### Callback plugin | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | ~~~python | ||
| + | ansible_python_interpreter=/ | ||
| + | ~~~ | ||
| + | |||
