clarify how to customize ansible cli output (#77357)

pull/77369/head
Sandra McCann 3 years ago committed by GitHub
parent babc26adc1
commit f03624e295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,6 +25,12 @@ Use version control
Keep your playbooks, roles, inventory, and variables files in git or another version control system and make commits to the repository when you make changes. Version control gives you an audit trail describing when and why you changed the rules that automate your infrastructure. Keep your playbooks, roles, inventory, and variables files in git or another version control system and make commits to the repository when you make changes. Version control gives you an audit trail describing when and why you changed the rules that automate your infrastructure.
Customize the CLI output
-------------------------
You can change the output from Ansible CLI commands using :ref:`callback_plugins`.
Playbook tips Playbook tips
============= =============
@ -87,7 +93,7 @@ You should encrypt sensitive or secret variables with Ansible Vault. However, en
When running a playbook, Ansible finds the variables in the unencrypted file, which pulls the sensitive variable values from the encrypted file. There is no limit to the number of variable and vault files or their names. When running a playbook, Ansible finds the variables in the unencrypted file, which pulls the sensitive variable values from the encrypted file. There is no limit to the number of variable and vault files or their names.
Note that using this strategy in your inventory still requires *all vault passwords to be available* (for example for ``ansible-playbook`` or `AWX/Ansible Tower <https://github.com/ansible/awx/issues/223#issuecomment-768386089>`_) when run with that inventory. Note that using this strategy in your inventory still requires *all vault passwords to be available* (for example for ``ansible-playbook`` or `AWX/Ansible Tower <https://github.com/ansible/awx/issues/223#issuecomment-768386089>`_) when run with that inventory.
Execution tricks Execution tricks
================ ================

@ -611,11 +611,11 @@ DEFAULT_EXECUTABLE:
DEFAULT_FACT_PATH: DEFAULT_FACT_PATH:
name: local fact path name: local fact path
description: description:
- "This option allows you to globally configure a custom path for 'local_facts' for the implied M(ansible.builtin.setup) task when using fact gathering." - "This option allows you to globally configure a custom path for 'local_facts' for the implied :ref:`ansible_collections.ansible.builtin.setup_module` task when using fact gathering."
- "If not set, it will fallback to the default from the M(ansible.builtin.setup) module: ``/etc/ansible/facts.d``." - "If not set, it will fallback to the default from the ``ansible.builtin.setup`` module: ``/etc/ansible/facts.d``."
- "This does **not** affect user defined tasks that use the M(ansible.builtin.setup) module." - "This does **not** affect user defined tasks that use the ``ansible.builtin.setup`` module."
- The real action being created by the implicit task is currently M(ansible.legacy.gather_facts), which then calls the configured fact modules, - The real action being created by the implicit task is currently ``ansible.legacy.gather_facts`` module, which then calls the configured fact modules,
by default this will be M(ansible.builtin.setup) for POSIX systems but other platforms might have different defaults. by default this will be ``ansible.builtin.setup`` for POSIX systems but other platforms might have different defaults.
env: [{name: ANSIBLE_FACT_PATH}] env: [{name: ANSIBLE_FACT_PATH}]
ini: ini:
- {key: fact_path, section: defaults} - {key: fact_path, section: defaults}
@ -673,9 +673,9 @@ DEFAULT_GATHERING:
DEFAULT_GATHER_SUBSET: DEFAULT_GATHER_SUBSET:
name: Gather facts subset name: Gather facts subset
description: description:
- Set the `gather_subset` option for the M(ansible.builtin.setup) task in the implicit fact gathering. - Set the `gather_subset` option for the :ref:`ansible_collections.ansible.builtin.setup_module` task in the implicit fact gathering.
See the module documentation for specifics. See the module documentation for specifics.
- "It does **not** apply to user defined M(ansible.builtin.setup) tasks." - "It does **not** apply to user defined ``ansible.builtin.setup`` tasks."
env: [{name: ANSIBLE_GATHER_SUBSET}] env: [{name: ANSIBLE_GATHER_SUBSET}]
ini: ini:
- key: gather_subset - key: gather_subset
@ -693,7 +693,7 @@ DEFAULT_GATHER_TIMEOUT:
name: Gather facts timeout name: Gather facts timeout
description: description:
- Set the timeout in seconds for the implicit fact gathering, see the module documentation for specifics. - Set the timeout in seconds for the implicit fact gathering, see the module documentation for specifics.
- "It does **not** apply to user defined M(ansible.builtin.setup) tasks." - "It does **not** apply to user defined :ref:`ansible_collections.ansible.builtin.setup_module` tasks."
env: [{name: ANSIBLE_GATHER_TIMEOUT}] env: [{name: ANSIBLE_GATHER_TIMEOUT}]
ini: ini:
- {key: gather_timeout, section: defaults} - {key: gather_timeout, section: defaults}
@ -869,7 +869,7 @@ DEFAULT_LOOKUP_PLUGIN_PATH:
DEFAULT_MANAGED_STR: DEFAULT_MANAGED_STR:
name: Ansible managed name: Ansible managed
default: 'Ansible managed' default: 'Ansible managed'
description: Sets the macro for the 'ansible_managed' variable available for M(ansible.builtin.template) and M(ansible.windows.win_template) modules. This is only relevant for those two modules. description: Sets the macro for the 'ansible_managed' variable available for :ref:`ansible_collections.ansible.builtin.template_module` and :ref:`ansible_collections.ansible.windows.win_template_module`. This is only relevant for those two modules.
env: [] env: []
ini: ini:
- {key: ansible_managed, section: defaults} - {key: ansible_managed, section: defaults}
@ -1030,8 +1030,9 @@ DEFAULT_STDOUT_CALLBACK:
name: Main display callback plugin name: Main display callback plugin
default: default default: default
description: description:
- "Set the main callback used to display Ansible output, you can only have one at a time." - "Set the main callback used to display Ansible output. You can only have one at a time."
- You can have many other callbacks, but just one can be in charge of stdout. - You can have many other callbacks, but just one can be in charge of stdout.
- See :ref:`callback_plugins` for a list of available options.
env: [{name: ANSIBLE_STDOUT_CALLBACK}] env: [{name: ANSIBLE_STDOUT_CALLBACK}]
ini: ini:
- {key: stdout_callback, section: defaults} - {key: stdout_callback, section: defaults}

Loading…
Cancel
Save