tech:notes_ansible_ansible-navigator
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_ansible-navigator [2025/11/11 16:29] – Jean-Baptiste | tech:notes_ansible_ansible-navigator [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Ansible ansible-navigator | ||
| + | |||
| + | Voir : | ||
| + | * [[Ansible Docker Execution Environment]] | ||
| + | |||
| + | |||
| + | ## Config | ||
| + | |||
| + | `ansible.cfg` | ||
| + | ~~~ini | ||
| + | # Since Ansible 2.12 (core): | ||
| + | # To generate an example config file (a " | ||
| + | # $ ansible-config init --disabled > ansible.cfg | ||
| + | # | ||
| + | # Also you can now have a more complete file by including existing plugins: | ||
| + | # ansible-config init --disabled -t all > ansible.cfg | ||
| + | # | ||
| + | # Voir la configuration : | ||
| + | # ansible-config dump --only-changed -t all | ||
| + | |||
| + | # For previous versions of Ansible you can check for examples in the ' | ||
| + | # Note that this file was always incomplete | ||
| + | |||
| + | # for example, for 2.9: https:// | ||
| + | [galaxy] | ||
| + | server_list = rh-certified_repo, | ||
| + | |||
| + | [galaxy_server.rh-certified_repo] | ||
| + | token=000000000000000 | ||
| + | url=https:// | ||
| + | |||
| + | [galaxy_server.published_repo] | ||
| + | token=000000000000000 | ||
| + | url=https:// | ||
| + | |||
| + | [galaxy_server.community_repo] | ||
| + | token=000000000000000 | ||
| + | url=https:// | ||
| + | |||
| + | [galaxy_server.galaxy] | ||
| + | url=https:// | ||
| + | |||
| + | [galaxy_server.dev-community] | ||
| + | url=https:// | ||
| + | token=000000000000000 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `~/ | ||
| + | ~~~yaml | ||
| + | # # cspell: | ||
| + | --- | ||
| + | |||
| + | ansible-navigator: | ||
| + | ansible: | ||
| + | config: | ||
| + | path: ./ | ||
| + | execution-environment: | ||
| + | container-engine: | ||
| + | enabled: true | ||
| + | image: image-standard: | ||
| + | logging: | ||
| + | level: warning | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Exemple | ||
| + | |||
| + | |||
| + | Lancer un playbook | ||
| + | ~~~bash | ||
| + | ansible-navigator --ee false –m stdout playbook.yml –l server01 | ||
| + | ~~~ | ||
| + | |||
| + | Afficher les infos sur une image | ||
| + | ~~~bash | ||
| + | ansible-navigator --eei ADRESSE_HUB/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Lancer un playbook dans un Execution Environment donné | ||
| + | ~~~bash | ||
| + | podman images | ||
| + | podman login --tls-verify=false aap.acme.local -u jean@acme.local | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ansible-navigator -m stdout run play.yml -i localhost, -c local -vv --eei aap.acme.local/ | ||
| + | ~~~ | ||
| + | |||
| + | `inv.txt` | ||
| + | ~~~ini | ||
| + | localhost ansible_connection=local ansible_python_interpreter=/ | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ansible-navigator -m stdout run -i inv.txt --ee true --eei acme-automationhub-prod.admin.acme.local/ | ||
| + | ~~~ | ||
| + | |||
| + | Lister les images | ||
| + | ~~~bash | ||
| + | ansible-navigator -m stdout images | egrep ' | ||
| + | ~~~ | ||
| + | |||
| + | Avoir les informations sur une image | ||
| + | ~~~bash | ||
| + | ansible-navigator -m stdout --eei localhost/ | ||
| + | ansible-navigator -m stdout --eei localhost/ | ||
| + | ~~~ | ||
| + | |||
