Outils pour utilisateurs

Outils du site


tech:ansible_-_dry_-_module_defaults

Différences

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

Lien vers cette vue comparative

tech:ansible_-_dry_-_module_defaults [2025/12/04 11:23] – créée Jean-Baptistetech:ansible_-_dry_-_module_defaults [2025/12/04 11:53] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Ansible DRY}}
 +
 +# Ansible - DRY - module_defaults
 +
 +
 +
 +~~~yaml
 +- name: Test AWX create obj
 +  hosts: localhost
 +  gather_facts: false
 +
 +  vars:
 +    awx_cred:
 +      controller_host: http://localhost:3000
 +      controller_username: admin
 +      controller_password: P@ssw0rd
 +      # validate_certs: false
 +
 +  module_defaults:
 +    awx.awx.credential: "{{ awx_cred }}"
 +    awx.awx.project: "{{ awx_cred }}"
 +    awx.awx.inventory: "{{ awx_cred }}"
 +    awx.awx.inventory_source: "{{ awx_cred }}"
 +    awx.awx.credential_type: "{{ awx_cred }}"
 +    awx.awx.execution_environment: "{{ awx_cred }}"
 +    awx.awx.job_template: "{{ awx_cred }}"
 +~~~
 +
 +~~~
 +$ ansible_collections/awx/awx/meta/runtime.yml | yq -r '.action_groups | keys[]'
 +controller
 +~~~
 +
 +~~~yaml
 +- name: Test AWX create obj
 +  hosts: localhost
 +  gather_facts: false
 +
 +  module_defaults:
 +    group/awx.awx.controller:
 +      controller_host: http://localhost:3000
 +      controller_username: admin
 +      controller_password: P@ssw0rd
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki