tech:ansible_collection
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:ansible_collection [2025/09/04 17:09] – Jean-Baptiste | tech:ansible_collection [2025/11/13 12:02] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 2: | Ligne 2: | ||
| = Ansible collection | = Ansible collection | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | Dépendances : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| Ligne 13: | Ligne 32: | ||
| </ | </ | ||
| - | '' | + | Voir aussi la variable d’environnement |
| + | |||
| + | '' | ||
| <code yaml> | <code yaml> | ||
| --- | --- | ||
| Ligne 19: | Ligne 40: | ||
| collections: | collections: | ||
| - name: https:// | - name: https:// | ||
| - | type: git | + | |
| + | scm: git | ||
| version: master | version: master | ||
| </ | </ | ||
| <code bash> | <code bash> | ||
| - | ansible-galaxy collection install -r requirements.yml -p / | + | ansible-galaxy collection install -r collections/ |
| </ | </ | ||
| Ligne 32: | Ligne 54: | ||
| community.general.ansible_galaxy_install: | community.general.ansible_galaxy_install: | ||
| type: collection | type: collection | ||
| - | requirements_file: | + | requirements_file: |
| dest: ~/ | dest: ~/ | ||
| changed_when: | changed_when: | ||
| Ligne 60: | Ligne 82: | ||
| - | == Utiliser une collection | + | Lister les collections installées |
| + | <code bash> | ||
| + | ansible-galaxy | ||
| + | </ | ||
| + | Rechercher une collection distante | ||
| + | <code bash> | ||
| + | ansible-galaxy search plop | ||
| + | </ | ||
| - | <code yaml requirements.yml> | + | |
| + | == Utiliser une collection distante | ||
| + | |||
| + | '' | ||
| + | <code yaml> | ||
| --- | --- | ||
| collections: | collections: | ||
| Ligne 78: | Ligne 111: | ||
| </ | </ | ||
| - | <code yaml play.yml> | + | '' |
| + | <code yaml> | ||
| # | # | ||
| --- | --- | ||
| Ligne 103: | Ligne 137: | ||
| ansible-doc acme.awx.tower_credential | ansible-doc acme.awx.tower_credential | ||
| </ | </ | ||
| + | |||
| + | |||
| + | === Exemple de role distant sur Git | ||
| + | |||
| + | '' | ||
| + | <code yaml> | ||
| + | --- | ||
| + | |||
| + | - src: ssh:// | ||
| + | scm: git | ||
| + | version: master | ||
| + | |||
| + | </ | ||
| + | |||
| === Exemple de collection distante sur Git | === Exemple de collection distante sur Git | ||
| - | <code yaml requirements.yml> | + | '' |
| + | <code yaml> | ||
| --- | --- | ||
| collections: | collections: | ||
| - name: https:// | - name: https:// | ||
| - | type: git | + | |
| + | scm: git | ||
| </ | </ | ||
| Ligne 123: | Ligne 173: | ||
| - | <code yaml galaxy.yml> | + | '' |
| + | <code yaml> | ||
| --- | --- | ||
| Ligne 137: | Ligne 188: | ||
| </ | </ | ||
| - | <code yaml tasks/ | + | |
| + | '' | ||
| + | <code yaml> | ||
| - name: Enable local cache DNS | - name: Enable local cache DNS | ||
| Ligne 186: | Ligne 239: | ||
| - | ----------------- | ||
| - | |||
| - | Créer un paquet d'un role | ||
| - | <code bash> | ||
| - | tar czvf ./ | ||
| - | </ | ||
| - | |||
| - | La documentation est dans : | ||
| - | * meta/ | ||
| - | * README.md | ||
| - | |||
| - | Installer un role | ||
| - | <code bash> | ||
| - | ansible-galaxy install ./ | ||
| - | ansible-galaxy install role_name | ||
| - | </ | ||
| - | |||
| - | Par défaut dans '' | ||
| - | |||
| - | |||
| - | Voir : | ||
| - | * ansible-galaxy list | ||
| - | * ansible-galaxy search | ||
| - | * ansible-galaxy install | ||
| - | * ansible-galaxy import | ||
| - | * ansible-galaxy info | ||
tech/ansible_collection.1756998588.txt.gz · Dernière modification : de Jean-Baptiste
