Outils pour utilisateurs

Outils du site


tech:ansible_inventory_script_-_inventaire_dynamique

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:ansible_inventory_script_-_inventaire_dynamique [2025/10/07 23:03] Jean-Baptistetech:ansible_inventory_script_-_inventaire_dynamique [2025/11/09 19:21] (Version actuelle) Jean-Baptiste
Ligne 5: Ligne 5:
 Voir : Voir :
 * https://goetzrieger.github.io/ansible-tower-advanced/9-advanced-inventories/ * https://goetzrieger.github.io/ansible-tower-advanced/9-advanced-inventories/
 +* https://docs.ansible.com/ansible/latest/plugins/inventory.html#inventory-plugins
 +* https://ansible.readthedocs.io/projects/awx/en/24.6.1/userguide/inventories.html#ug-customscripts
  
 Voir aussi : Voir aussi :
 +* https://docs.ansible.com/ansible/latest/reference_appendices/config.html
 * https://www.redhat.com/sysadmin/ansible-plugin-inventory-files * https://www.redhat.com/sysadmin/ansible-plugin-inventory-files
 * https://github.com/ansible-community/contrib-scripts/blob/main/inventory/ssh_config.py * https://github.com/ansible-community/contrib-scripts/blob/main/inventory/ssh_config.py
 +
 +In Ansible 2.10 and later, inventory scripts moved to their associated collections. Many are now in the [[https://github.com/ansible-community/contrib-scripts/tree/main/inventory|ansible-community/contrib-scripts repository]]. We recommend you use [[https://github.com/ansible-community/contrib-scripts/tree/main/inventory|Inventory plugins]] instead.
 +
 +Source : https://docs.ansible.com/ansible/latest/inventory_guide/intro_dynamic_inventory.html#intro-dynamic-inventory
 +
  
 Nous allons coder un inventory script en bash en mode "hello world" Nous allons coder un inventory script en bash en mode "hello world"
  
 Voici le script bash avec des données codés en dures dedans, c'est moche mais c'est juste pour un PoC. Voici le script bash avec des données codés en dures dedans, c'est moche mais c'est juste pour un PoC.
-<code bash inv.sh>+ 
 +''inv.sh'' 
 +<code bash>
 #! /bin/bash #! /bin/bash
  
Ligne 176: Ligne 186:
  
 Nous allons coder un wrapper Python qui lance notre script bash. Nous allons coder un wrapper Python qui lance notre script bash.
-<code python inv.py>+ 
 +''inv.py'' 
 +<code python>
 #! /usr/bin/env python3 #! /usr/bin/env python3
  
tech/ansible_inventory_script_-_inventaire_dynamique.1759870981.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki