tech:notes_ansible_tower_-_ansible_automation_platform
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_tower_-_ansible_automation_platform [2025/09/10 15:32] – Jean-Baptiste | tech:notes_ansible_tower_-_ansible_automation_platform [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Ansible Tower - Ansible Automation Platform | ||
| + | |||
| + | Voir aussi : | ||
| + | * event-driven platform for runbook automation / IFTTT (if this, then that) | ||
| + | * [StackStorm](https:// | ||
| + | * https:// | ||
| + | |||
| + | Vocabulaire / Concepts | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Cycle de vie : | ||
| + | * https:// | ||
| + | |||
| + | Recherche doc RedHat : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ### Ansible Engine | ||
| + | |||
| + | Correspond à Ansible et est installé par : | ||
| + | ~~~bash | ||
| + | sudo yum install ansible | ||
| + | ~~~ | ||
| + | |||
| + | ### Control node | ||
| + | |||
| + | Control node | ||
| + | * control plane | ||
| + | * execution plane | ||
| + | |||
| + | Dans AAP v1 le " | ||
| + | |||
| + | mesh node types : | ||
| + | `node_type=hybrid` par défaut ou `node_type=control` | ||
| + | |||
| + | node_type : | ||
| + | * control (WebUI & API) | ||
| + | * execution (ansible-playbook) | ||
| + | * hybrid (Execution + control) | ||
| + | * hop (sorte de proxy ssh entre le Controller et les Execution Nodes ; ne peut pas être un Execution Node) | ||
| + | |||
| + | ### Execution Node (Ansible Automation Engine) | ||
| + | |||
| + | The machine that runs Ansible | ||
| + | Linux Mac BSD ... | ||
| + | Python 3.8 ou + | ||
| + | |||
| + | ### Hop nodes / Execution nodes | ||
| + | |||
| + | mesh node types | ||
| + | `node_type=hop` | ||
| + | ou `node_type=execution` | ||
| + | |||
| + | ### Ansible Mesh / Receptor | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | receptor_listener_port | ||
| + | |||
| + | 27199/tcp | ||
| + | |||
| + | | | ||
| + | | --------------------- | -------------- | | ||
| + | | Automation Controller | Execution Node | | ||
| + | | ESTABLISHED 27199 | LISTEN 27199 | | ||
| + | |||
| + | work-signing keys | ||
| + | |||
| + | |||
| + | Control node receptor | ||
| + | ~~~yaml | ||
| + | - work-signing: | ||
| + | privatekey: / | ||
| + | tokenexpiration: | ||
| + | |||
| + | - work-verification: | ||
| + | publickey: / | ||
| + | ~~~ | ||
| + | |||
| + | Execution Node | ||
| + | ~~~yaml | ||
| + | - work-verification: | ||
| + | publickey: / | ||
| + | ~~~ | ||
| + | |||
| + | To create the keys, just do openssl commands, you can see them evokes in the plays here | ||
| + | https:// | ||
| + | |||
| + | |||
| + | |||
| + | ### Ansible Execution Environment | ||
| + | |||
| + | Sorte de pyenv contenant Ansible, les collections et plugins | ||
| + | |||
| + | ### Managed host | ||
| + | |||
| + | Les cibles | ||
| + | ~~~bash | ||
| + | ansible myhost --become -m raw -a "yum install -y python2" | ||
| + | ~~~ | ||
| + | |||
| + | Prereq Python 2 (version 2.6 or later) or Python 3 (version 3.5 or later) | ||
| + | |||
| + | Automation Hub / Galaxy | ||
| + | |||
| + | jfrog-artifactory : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ### Hop node | ||
| + | |||
| + | Anciennement " | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | Alternative à ssh-proxy\\ | ||
| + | The only prerequisite is that there is SSH connectivity from the Tower Cluster to the Isolated Node | ||
| + | |||
| + | Exemple de conf : | ||
| + | ~~~ini | ||
| + | [isolated_group_restrictedzone: | ||
| + | controller=tower | ||
| + | |||
| + | [isolated_group_nc] | ||
| + | cary.remote.office controller=tower | ||
| + | ~~~ | ||
| + | |||
| + | Isolated instances are not supported in conjunction with running Ansible Tower in OpenShift. | ||
| + | |||
| + | ### Ansible Automation Hub | ||
| + | |||
| + | Voir [Galaxy NG](https:// | ||
| + | |||
| + | (Private) Automation Hub | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## Config | ||
| + | |||
| + | ~~~bash | ||
| + | tower-cli setting modify ALLOW_JINJA_IN_EXTRA_VARS always | ||
| + | ~~~ | ||
| + | |||
| + | ## Logs | ||
| + | |||
| + | Voir : https:// | ||
| + | |||
| + | extra_vars des jobs dans les logs (à tester) | ||
| + | ~~~yaml | ||
| + | - hosts: localhost | ||
| + | gather_facts: | ||
| + | tasks: | ||
| + | - shell: "echo {{ inventory_hostname }}" | ||
| + | ~~~ | ||
| + | |||
| + | ou | ||
| + | |||
| + | The first idea was to add extra_vars to every job events, but it would work just as well to be able to add a short string label (prompt on launch) when launching a job template. This should not cause a performance issue. | ||
| + | |||
| + | Add extra_vars to every job event sent over job_events #11330 | ||
| + | |||
| + | |||
| + | ### Rechercher par date / heures | ||
| + | |||
| + | |||
| + | GT | ||
| + | ~~~ | ||
| + | env TZ=Europe/ | ||
| + | 2023-08-23 21: | ||
| + | ~~~ | ||
| + | |||
| + | LT | ||
| + | ~~~ | ||
| + | env TZ=Europe/ | ||
| + | 2023-08-24 00: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Développement / Intégration | ||
| + | |||
| + | |||
| + | ### Ansible Navigator | ||
| + | |||
| + | * TUI or CLI to execute playbook | ||
| + | * Supports Execution Environments | ||
| + | |||
| + | ### Ansible Builder | ||
| + | |||
| + | * creates Execution Environment | ||
| + | * takes in input text/yaml files describing the EE to produce | ||
| + | |||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | ### Autres | ||
| + | |||
| + | GPG Signing | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Connaitre la version | ||
| + | ~~~bash | ||
| + | cat / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | La config de la connexion à la DB est ici : \\ | ||
| + | `/ | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | ~~~bash | ||
| + | # | ||
| + | ansible-navigator config init --disabled -t all > ansible.cfg | ||
| + | ~~~ | ||
| + | |||
| + | Voir la configuration | ||
| + | ~~~bash | ||
| + | ansible-config dump --only-changed -t all | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | # | ||
| + | ansible-navigator config view | grep -B 2 -A 2 ' | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | [root@ansible-1 ~]# awx-manage list_instances | ||
| + | [tower capacity=51] | ||
| + | ansible-1 capacity=17 version=3.7.1 heartbeat=" | ||
| + | ansible-2 capacity=17 version=3.7.1 heartbeat=" | ||
| + | ansible-3 capacity=17 version=3.7.1 heartbeat=" | ||
| + | ~~~ | ||
| + | |||
| + | https:// | ||
| + | |||
| + | ~~~bash | ||
| + | #!/bin/bash | ||
| + | awx -f human inventory create --name " | ||
| + | awx -f human host create --name " | ||
| + | --inventory " | ||
| + | awx -f human host create --name " | ||
| + | --inventory " | ||
| + | awx -f human credential create --name " | ||
| + | --organization " | ||
| + | --credential_type " | ||
| + | --inputs ' | ||
| + | awx -f human project create --name=" | ||
| + | --scm_type=git \ | ||
| + | --scm_url=" | ||
| + | --organization " | ||
| + | --scm_clean=true --scm_delete_on_update=true --scm_update_on_launch=true \ | ||
| + | --wait | ||
| + | awx -f human job_templates create | ||
| + | --name=" | ||
| + | --inventory=" | ||
| + | --project=Apache \ | ||
| + | --playbook=apache_install.yml \ | ||
| + | --become_enabled=" | ||
| + | awx -f human job_template associate --name " | ||
| + | --credential " | ||
| + | ~~~ | ||
| + | |||
| + | Source : https:// | ||
| + | |||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | ### Credentials | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | sudo awx-python -m pip install safeguardcredentialtype | ||
| + | sudo awx-manage setup_managed_credential_types | ||
| + | sudo automation-controller-service restart | ||
| + | ~~~ | ||
| + | |||
| + | Source : https:// | ||
| + | |||
| + | Voir aussi : `M(awx.awx.credential_input_source)` | ||
| + | |||
