diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:16:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:16:47 +0000 |
commit | 7a7fb74454bb3a169acecd30e87067502bfe3260 (patch) | |
tree | d684cbea7ffc70bd39a1e52bb65b0ea5ae156bda /lib/ansible/config | |
parent | Adding upstream version 2.16.6. (diff) | |
download | ansible-core-7a7fb74454bb3a169acecd30e87067502bfe3260.tar.xz ansible-core-7a7fb74454bb3a169acecd30e87067502bfe3260.zip |
Adding upstream version 2.17.0.upstream/2.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ansible/config')
-rw-r--r-- | lib/ansible/config/ansible_builtin_runtime.yml | 2 | ||||
-rw-r--r-- | lib/ansible/config/base.yml | 303 | ||||
-rw-r--r-- | lib/ansible/config/manager.py | 58 |
3 files changed, 189 insertions, 174 deletions
diff --git a/lib/ansible/config/ansible_builtin_runtime.yml b/lib/ansible/config/ansible_builtin_runtime.yml index 570ccb0..3630e76 100644 --- a/lib/ansible/config/ansible_builtin_runtime.yml +++ b/lib/ansible/config/ansible_builtin_runtime.yml @@ -9088,6 +9088,8 @@ plugin_routing: tombstone: removal_date: "2023-05-16" warning_text: Use include_tasks or import_tasks instead. + yum: + redirect: ansible.builtin.dnf become: doas: redirect: community.general.doas diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 69a0d67..9a5686d 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -28,14 +28,14 @@ ANSIBLE_CONNECTION_PATH: ANSIBLE_COW_SELECTION: name: Cowsay filter selection default: default - description: This allows you to chose a specific cowsay stencil for the banners or use 'random' to cycle through them. + description: This allows you to choose a specific cowsay stencil for the banners or use 'random' to cycle through them. env: [{name: ANSIBLE_COW_SELECTION}] ini: - {key: cow_selection, section: defaults} ANSIBLE_COW_ACCEPTLIST: name: Cowsay filter acceptance list default: ['bud-frogs', 'bunny', 'cheese', 'daemon', 'default', 'dragon', 'elephant-in-snake', 'elephant', 'eyes', 'hellokitty', 'kitty', 'luke-koala', 'meow', 'milk', 'moofasa', 'moose', 'ren', 'sheep', 'small', 'stegosaurus', 'stimpy', 'supermilker', 'three-eyes', 'turkey', 'turtle', 'tux', 'udder', 'vader-koala', 'vader', 'www'] - description: Accept list of cowsay templates that are 'safe' to use, set to empty list if you want to enable all installed templates. + description: Accept a list of cowsay templates that are 'safe' to use, set to an empty list if you want to enable all installed templates. env: - name: ANSIBLE_COW_ACCEPTLIST version_added: '2.11' @@ -78,7 +78,7 @@ ANSIBLE_NOCOWS: ANSIBLE_COW_PATH: name: Set path to cowsay command default: null - description: Specify a custom cowsay path or swap in your cowsay implementation of choice + description: Specify a custom cowsay path or swap in your cowsay implementation of choice. env: [{name: ANSIBLE_COW_PATH}] ini: - {key: cowpath, section: defaults} @@ -119,8 +119,9 @@ BECOME_ALLOW_SAME_USER: name: Allow becoming the same user default: False description: - - This setting controls if become is skipped when remote user and become user are the same. I.E root sudo to root. - - If executable, it will be run and the resulting stdout will be used as the password. + - When ``False``(default), Ansible will skip using become if the remote user is the same as the become user, as this is normally a redundant operation. + In other words root sudo to root. + - If ``True``, this forces Ansible to use the become plugin anyways as there are cases in which this is needed. env: [{name: ANSIBLE_BECOME_ALLOW_SAME_USER}] ini: - {key: become_allow_same_user, section: privilege_escalation} @@ -130,7 +131,7 @@ BECOME_PASSWORD_FILE: name: Become password file default: ~ description: - - 'The password file to use for the become plugin. --become-password-file.' + - 'The password file to use for the become plugin. ``--become-password-file``.' - If executable, it will be run and the resulting stdout will be used as the password. env: [{name: ANSIBLE_BECOME_PASSWORD_FILE}] ini: @@ -141,7 +142,7 @@ AGNOSTIC_BECOME_PROMPT: name: Display an agnostic become prompt default: True type: boolean - description: Display an agnostic become prompt instead of displaying a prompt containing the command line supplied become method + description: Display an agnostic become prompt instead of displaying a prompt containing the command line supplied become method. env: [{name: ANSIBLE_AGNOSTIC_BECOME_PROMPT}] ini: - {key: agnostic_become_prompt, section: privilege_escalation} @@ -158,7 +159,7 @@ CACHE_PLUGIN: CACHE_PLUGIN_CONNECTION: name: Cache Plugin URI default: ~ - description: Defines connection or path information for the cache plugin + description: Defines connection or path information for the cache plugin. env: [{name: ANSIBLE_CACHE_PLUGIN_CONNECTION}] ini: - {key: fact_caching_connection, section: defaults} @@ -166,7 +167,7 @@ CACHE_PLUGIN_CONNECTION: CACHE_PLUGIN_PREFIX: name: Cache Plugin table prefix default: ansible_facts - description: Prefix to use for cache plugin files/tables + description: Prefix to use for cache plugin files/tables. env: [{name: ANSIBLE_CACHE_PLUGIN_PREFIX}] ini: - {key: fact_caching_prefix, section: defaults} @@ -174,7 +175,7 @@ CACHE_PLUGIN_PREFIX: CACHE_PLUGIN_TIMEOUT: name: Cache Plugin expiration timeout default: 86400 - description: Expiration timeout for the cache plugin data + description: Expiration timeout for the cache plugin data. env: [{name: ANSIBLE_CACHE_PLUGIN_TIMEOUT}] ini: - {key: fact_caching_timeout, section: defaults} @@ -182,7 +183,7 @@ CACHE_PLUGIN_TIMEOUT: yaml: {key: facts.cache.timeout} COLLECTIONS_SCAN_SYS_PATH: name: Scan PYTHONPATH for installed collections - description: A boolean to enable or disable scanning the sys.path for installed collections + description: A boolean to enable or disable scanning the sys.path for installed collections. default: true type: boolean env: @@ -190,9 +191,9 @@ COLLECTIONS_SCAN_SYS_PATH: ini: - {key: collections_scan_sys_path, section: defaults} COLLECTIONS_PATHS: - name: ordered list of root paths for loading installed Ansible collections content + name: An ordered list of root paths for loading installed Ansible collections content. description: > - Colon separated paths in which Ansible will search for collections content. + Colon-separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. For example, if ``COLLECTIONS_PATHS`` includes ``'{{ ANSIBLE_HOME ~ "/collections" }}'``, and you want to add ``my.collection`` to that directory, it must be saved as @@ -229,14 +230,14 @@ COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH: COLOR_CHANGED: name: Color for 'changed' task status default: yellow - description: Defines the color to use on 'Changed' task status + description: Defines the color to use on 'Changed' task status. env: [{name: ANSIBLE_COLOR_CHANGED}] ini: - {key: changed, section: colors} COLOR_CONSOLE_PROMPT: name: "Color for ansible-console's prompt task status" default: white - description: Defines the default color to use for ansible-console + description: Defines the default color to use for ansible-console. env: [{name: ANSIBLE_COLOR_CONSOLE_PROMPT}] ini: - {key: console_prompt, section: colors} @@ -244,21 +245,21 @@ COLOR_CONSOLE_PROMPT: COLOR_DEBUG: name: Color for debug statements default: dark gray - description: Defines the color to use when emitting debug messages + description: Defines the color to use when emitting debug messages. env: [{name: ANSIBLE_COLOR_DEBUG}] ini: - {key: debug, section: colors} COLOR_DEPRECATE: name: Color for deprecation messages default: purple - description: Defines the color to use when emitting deprecation messages + description: Defines the color to use when emitting deprecation messages. env: [{name: ANSIBLE_COLOR_DEPRECATE}] ini: - {key: deprecate, section: colors} COLOR_DIFF_ADD: name: Color for diff added display default: green - description: Defines the color to use when showing added lines in diffs + description: Defines the color to use when showing added lines in diffs. env: [{name: ANSIBLE_COLOR_DIFF_ADD}] ini: - {key: diff_add, section: colors} @@ -266,21 +267,21 @@ COLOR_DIFF_ADD: COLOR_DIFF_LINES: name: Color for diff lines display default: cyan - description: Defines the color to use when showing diffs + description: Defines the color to use when showing diffs. env: [{name: ANSIBLE_COLOR_DIFF_LINES}] ini: - {key: diff_lines, section: colors} COLOR_DIFF_REMOVE: name: Color for diff removed display default: red - description: Defines the color to use when showing removed lines in diffs + description: Defines the color to use when showing removed lines in diffs. env: [{name: ANSIBLE_COLOR_DIFF_REMOVE}] ini: - {key: diff_remove, section: colors} COLOR_ERROR: name: Color for error messages default: red - description: Defines the color to use when emitting error messages + description: Defines the color to use when emitting error messages. env: [{name: ANSIBLE_COLOR_ERROR}] ini: - {key: error, section: colors} @@ -288,49 +289,49 @@ COLOR_ERROR: COLOR_HIGHLIGHT: name: Color for highlighting default: white - description: Defines the color to use for highlighting + description: Defines the color to use for highlighting. env: [{name: ANSIBLE_COLOR_HIGHLIGHT}] ini: - {key: highlight, section: colors} COLOR_OK: name: Color for 'ok' task status default: green - description: Defines the color to use when showing 'OK' task status + description: Defines the color to use when showing 'OK' task status. env: [{name: ANSIBLE_COLOR_OK}] ini: - {key: ok, section: colors} COLOR_SKIP: name: Color for 'skip' task status default: cyan - description: Defines the color to use when showing 'Skipped' task status + description: Defines the color to use when showing 'Skipped' task status. env: [{name: ANSIBLE_COLOR_SKIP}] ini: - {key: skip, section: colors} COLOR_UNREACHABLE: name: Color for 'unreachable' host state default: bright red - description: Defines the color to use on 'Unreachable' status + description: Defines the color to use on 'Unreachable' status. env: [{name: ANSIBLE_COLOR_UNREACHABLE}] ini: - {key: unreachable, section: colors} COLOR_VERBOSE: name: Color for verbose messages default: blue - description: Defines the color to use when emitting verbose messages. i.e those that show with '-v's. + description: Defines the color to use when emitting verbose messages. In other words, those that show with '-v's. env: [{name: ANSIBLE_COLOR_VERBOSE}] ini: - {key: verbose, section: colors} COLOR_WARN: name: Color for warning messages default: bright purple - description: Defines the color to use when emitting warning messages + description: Defines the color to use when emitting warning messages. env: [{name: ANSIBLE_COLOR_WARN}] ini: - {key: warn, section: colors} CONNECTION_PASSWORD_FILE: name: Connection password file default: ~ - description: 'The password file to use for the connection plugin. --connection-password-file.' + description: 'The password file to use for the connection plugin. ``--connection-password-file``.' env: [{name: ANSIBLE_CONNECTION_PASSWORD_FILE}] ini: - {key: connection_password_file, section: defaults} @@ -339,7 +340,7 @@ CONNECTION_PASSWORD_FILE: COVERAGE_REMOTE_OUTPUT: name: Sets the output directory and filename prefix to generate coverage run info. description: - - Sets the output directory on the remote host to generate coverage reports to. + - Sets the output directory on the remote host to generate coverage reports into. - Currently only used for remote coverage on PowerShell modules. - This is for internal use only. env: @@ -352,7 +353,7 @@ COVERAGE_REMOTE_PATHS: name: Sets the list of paths to run coverage for. description: - A list of paths for files on the Ansible controller to run coverage for when executing on the remote host. - - Only files that match the path glob will have its coverage collected. + - Only files that match the path glob will have their coverage collected. - Multiple path globs can be specified and are separated by ``:``. - Currently only used for remote coverage on PowerShell modules. - This is for internal use only. @@ -365,7 +366,7 @@ ACTION_WARNINGS: name: Toggle action warnings default: True description: - - By default Ansible will issue a warning when received from a task action (module or action plugin) + - By default, Ansible will issue a warning when received from a task action (module or action plugin). - These warnings can be silenced by adjusting this setting to False. env: [{name: ANSIBLE_ACTION_WARNINGS}] ini: @@ -376,7 +377,7 @@ LOCALHOST_WARNING: name: Warning when using implicit inventory with only localhost default: True description: - - By default Ansible will issue a warning when there are no hosts in the + - By default, Ansible will issue a warning when there are no hosts in the inventory. - These warnings can be silenced by adjusting this setting to False. env: [{name: ANSIBLE_LOCALHOST_WARNING}] @@ -384,11 +385,20 @@ LOCALHOST_WARNING: - {key: localhost_warning, section: defaults} type: boolean version_added: "2.6" +LOG_VERBOSITY: + name: Default log verbosity + description: + - This will set log verbosity if higher than the normal display verbosity, otherwise it will match that. + env: [{name: ANSIBLE_LOG_VERBOSITY}] + ini: + - {key: log_verbosity, section: defaults} + type: int + version_added: "2.17" INVENTORY_UNPARSED_WARNING: name: Warning when no inventory files can be parsed, resulting in an implicit inventory with only localhost default: True description: - - By default Ansible will issue a warning when no inventory was loaded and notes that + - By default, Ansible will issue a warning when no inventory was loaded and notes that it will use an implicit localhost-only inventory. - These warnings can be silenced by adjusting this setting to False. env: [{name: ANSIBLE_INVENTORY_UNPARSED_WARNING}] @@ -399,7 +409,7 @@ INVENTORY_UNPARSED_WARNING: DOC_FRAGMENT_PLUGIN_PATH: name: documentation fragment plugins path default: '{{ ANSIBLE_HOME ~ "/plugins/doc_fragments:/usr/share/ansible/plugins/doc_fragments" }}' - description: Colon separated paths in which Ansible will search for Documentation Fragments Plugins. + description: Colon-separated paths in which Ansible will search for Documentation Fragments Plugins. env: [{name: ANSIBLE_DOC_FRAGMENT_PLUGINS}] ini: - {key: doc_fragment_plugins, section: defaults} @@ -407,7 +417,7 @@ DOC_FRAGMENT_PLUGIN_PATH: DEFAULT_ACTION_PLUGIN_PATH: name: Action plugins path default: '{{ ANSIBLE_HOME ~ "/plugins/action:/usr/share/ansible/plugins/action" }}' - description: Colon separated paths in which Ansible will search for Action Plugins. + description: Colon-separated paths in which Ansible will search for Action Plugins. env: [{name: ANSIBLE_ACTION_PLUGINS}] ini: - {key: action_plugins, section: defaults} @@ -421,8 +431,8 @@ DEFAULT_ALLOW_UNSAFE_LOOKUPS: to return data that is not marked 'unsafe'." - By default, such data is marked as unsafe to prevent the templating engine from evaluating any jinja2 templating language, as this could represent a security risk. This option is provided to allow for backward compatibility, - however users should first consider adding allow_unsafe=True to any lookups which may be expected to contain data which may be run - through the templating engine late + however, users should first consider adding allow_unsafe=True to any lookups that may be expected to contain data that may be run + through the templating engine late. env: [] ini: - {key: allow_unsafe_lookups, section: defaults} @@ -474,7 +484,7 @@ DEFAULT_BECOME_METHOD: DEFAULT_BECOME_EXE: name: Choose 'become' executable default: ~ - description: 'executable to use for privilege escalation, otherwise Ansible will depend on PATH' + description: 'executable to use for privilege escalation, otherwise Ansible will depend on PATH.' env: [{name: ANSIBLE_BECOME_EXE}] ini: - {key: become_exe, section: privilege_escalation} @@ -488,7 +498,7 @@ DEFAULT_BECOME_FLAGS: BECOME_PLUGIN_PATH: name: Become plugins path default: '{{ ANSIBLE_HOME ~ "/plugins/become:/usr/share/ansible/plugins/become" }}' - description: Colon separated paths in which Ansible will search for Become Plugins. + description: Colon-separated paths in which Ansible will search for Become Plugins. env: [{name: ANSIBLE_BECOME_PLUGINS}] ini: - {key: become_plugins, section: defaults} @@ -506,7 +516,7 @@ DEFAULT_BECOME_USER: DEFAULT_CACHE_PLUGIN_PATH: name: Cache Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/cache:/usr/share/ansible/plugins/cache" }}' - description: Colon separated paths in which Ansible will search for Cache Plugins. + description: Colon-separated paths in which Ansible will search for Cache Plugins. env: [{name: ANSIBLE_CACHE_PLUGINS}] ini: - {key: cache_plugins, section: defaults} @@ -514,7 +524,7 @@ DEFAULT_CACHE_PLUGIN_PATH: DEFAULT_CALLBACK_PLUGIN_PATH: name: Callback Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/callback:/usr/share/ansible/plugins/callback" }}' - description: Colon separated paths in which Ansible will search for Callback Plugins. + description: Colon-separated paths in which Ansible will search for Callback Plugins. env: [{name: ANSIBLE_CALLBACK_PLUGINS}] ini: - {key: callback_plugins, section: defaults} @@ -537,7 +547,7 @@ CALLBACKS_ENABLED: DEFAULT_CLICONF_PLUGIN_PATH: name: Cliconf Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/cliconf:/usr/share/ansible/plugins/cliconf" }}' - description: Colon separated paths in which Ansible will search for Cliconf Plugins. + description: Colon-separated paths in which Ansible will search for Cliconf Plugins. env: [{name: ANSIBLE_CLICONF_PLUGINS}] ini: - {key: cliconf_plugins, section: defaults} @@ -545,7 +555,7 @@ DEFAULT_CLICONF_PLUGIN_PATH: DEFAULT_CONNECTION_PLUGIN_PATH: name: Connection Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/connection:/usr/share/ansible/plugins/connection" }}' - description: Colon separated paths in which Ansible will search for Connection Plugins. + description: Colon-separated paths in which Ansible will search for Connection Plugins. env: [{name: ANSIBLE_CONNECTION_PLUGINS}] ini: - {key: connection_plugins, section: defaults} @@ -556,7 +566,7 @@ DEFAULT_DEBUG: default: False description: - "Toggles debug output in Ansible. This is *very* verbose and can hinder - multiprocessing. Debug output can also include secret information + multiprocessing. Debug output can also include secret information despite no_log settings being enabled, which means debug mode should not be used in production." env: [{name: ANSIBLE_DEBUG}] @@ -567,8 +577,8 @@ DEFAULT_EXECUTABLE: name: Target shell executable default: /bin/sh description: - - "This indicates the command to use to spawn a shell under for Ansible's execution needs on a target. - Users may need to change this in rare instances when shell usage is constrained, but in most cases it may be left as is." + - "This indicates the command to use to spawn a shell under, which is required for Ansible's execution needs on a target. + Users may need to change this in rare instances when shell usage is constrained, but in most cases, it may be left as is." env: [{name: ANSIBLE_EXECUTABLE}] ini: - {key: executable, section: defaults} @@ -576,9 +586,9 @@ DEFAULT_FACT_PATH: name: local fact path description: - "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 ``ansible.builtin.setup`` module: ``/etc/ansible/facts.d``." - - "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 ``ansible.legacy.gather_facts`` module, which then calls the configured fact modules, + - "If not set, it will fall back to the default from the ``ansible.builtin.setup`` module: ``/etc/ansible/facts.d``." + - "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 ``ansible.legacy.gather_facts`` module, which then calls the configured fact modules, by default this will be ``ansible.builtin.setup`` for POSIX systems but other platforms might have different defaults. env: [{name: ANSIBLE_FACT_PATH}] ini: @@ -593,7 +603,7 @@ DEFAULT_FACT_PATH: DEFAULT_FILTER_PLUGIN_PATH: name: Jinja2 Filter Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/filter:/usr/share/ansible/plugins/filter" }}' - description: Colon separated paths in which Ansible will search for Jinja2 Filter Plugins. + description: Colon-separated paths in which Ansible will search for Jinja2 Filter Plugins. env: [{name: ANSIBLE_FILTER_PLUGINS}] ini: - {key: filter_plugins, section: defaults} @@ -676,10 +686,10 @@ DEFAULT_HASH_BEHAVIOUR: description: - This setting controls how duplicate definitions of dictionary variables (aka hash, map, associative array) are handled in Ansible. - This does not affect variables whose values are scalars (integers, strings) or arrays. - - "**WARNING**, changing this setting is not recommended as this is fragile and makes your content (plays, roles, collections) non portable, + - "**WARNING**, changing this setting is not recommended as this is fragile and makes your content (plays, roles, collections) nonportable, leading to continual confusion and misuse. Don't change this setting unless you think you have an absolute need for it." - We recommend avoiding reusing variable names and relying on the ``combine`` filter and ``vars`` and ``varnames`` lookups - to create merged versions of the individual variables. In our experience this is rarely really needed and a sign that too much + to create merged versions of the individual variables. In our experience, this is rarely needed and is a sign that too much complexity has been introduced into the data structures and plays. - For some uses you can also look into custom vars_plugins to merge on input, even substituting the default ``host_group_vars`` that is in charge of parsing the ``host_vars/`` and ``group_vars/`` directories. Most users of this setting are only interested in inventory scope, @@ -696,7 +706,7 @@ DEFAULT_HASH_BEHAVIOUR: DEFAULT_HOST_LIST: name: Inventory Source default: /etc/ansible/hosts - description: Comma separated list of Ansible inventory sources + description: Comma-separated list of Ansible inventory sources env: - name: ANSIBLE_INVENTORY expand_relative_paths: True @@ -708,7 +718,7 @@ DEFAULT_HOST_LIST: DEFAULT_HTTPAPI_PLUGIN_PATH: name: HttpApi Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/httpapi:/usr/share/ansible/plugins/httpapi" }}' - description: Colon separated paths in which Ansible will search for HttpApi Plugins. + description: Colon-separated paths in which Ansible will search for HttpApi Plugins. env: [{name: ANSIBLE_HTTPAPI_PLUGINS}] ini: - {key: httpapi_plugins, section: defaults} @@ -724,13 +734,13 @@ DEFAULT_INTERNAL_POLL_INTERVAL: description: - This sets the interval (in seconds) of Ansible internal processes polling each other. Lower values improve performance with large playbooks at the expense of extra CPU load. - Higher values are more suitable for Ansible usage in automation scenarios, + Higher values are more suitable for Ansible usage in automation scenarios when UI responsiveness is not required but CPU usage might be a concern. - "The default corresponds to the value hardcoded in Ansible <= 2.1" DEFAULT_INVENTORY_PLUGIN_PATH: name: Inventory Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/inventory:/usr/share/ansible/plugins/inventory" }}' - description: Colon separated paths in which Ansible will search for Inventory Plugins. + description: Colon-separated paths in which Ansible will search for Inventory Plugins. env: [{name: ANSIBLE_INVENTORY_PLUGINS}] ini: - {key: inventory_plugins, section: defaults} @@ -769,7 +779,7 @@ DEFAULT_LIBVIRT_LXC_NOSECLABEL: name: No security label on Lxc default: False description: - - "This setting causes libvirt to connect to lxc containers by passing --noseclabel to virsh. + - "This setting causes libvirt to connect to LXC containers by passing ``--noseclabel`` parameter to ``virsh`` command. This is necessary when running on systems which do not have SELinux." env: - name: ANSIBLE_LIBVIRT_LXC_NOSECLABEL @@ -808,14 +818,14 @@ DEFAULT_LOG_PATH: DEFAULT_LOG_FILTER: name: Name filters for python logger default: [] - description: List of logger names to filter out of the log file + description: List of logger names to filter out of the log file. env: [{name: ANSIBLE_LOG_FILTER}] ini: - {key: log_filter, section: defaults} type: list DEFAULT_LOOKUP_PLUGIN_PATH: name: Lookup Plugins Path - description: Colon separated paths in which Ansible will search for Lookup Plugins. + description: Colon-separated paths in which Ansible will search for Lookup Plugins. default: '{{ ANSIBLE_HOME ~ "/plugins/lookup:/usr/share/ansible/plugins/lookup" }}' env: [{name: ANSIBLE_LOOKUP_PLUGINS}] ini: @@ -825,7 +835,7 @@ DEFAULT_LOOKUP_PLUGIN_PATH: DEFAULT_MANAGED_STR: name: Ansible managed default: 'Ansible managed' - 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. + 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 to those two modules. env: [] ini: - {key: ansible_managed, section: defaults} @@ -856,7 +866,7 @@ DEFAULT_MODULE_NAME: - {key: module_name, section: defaults} DEFAULT_MODULE_PATH: name: Modules Path - description: Colon separated paths in which Ansible will search for Modules. + description: Colon-separated paths in which Ansible will search for Modules. default: '{{ ANSIBLE_HOME ~ "/plugins/modules:/usr/share/ansible/plugins/modules" }}' env: [{name: ANSIBLE_LIBRARY}] ini: @@ -864,7 +874,7 @@ DEFAULT_MODULE_PATH: type: pathspec DEFAULT_MODULE_UTILS_PATH: name: Module Utils Path - description: Colon separated paths in which Ansible will search for Module utils files, which are shared by modules. + description: Colon-separated paths in which Ansible will search for Module utils files, which are shared by modules. default: '{{ ANSIBLE_HOME ~ "/plugins/module_utils:/usr/share/ansible/plugins/module_utils" }}' env: [{name: ANSIBLE_MODULE_UTILS}] ini: @@ -873,7 +883,7 @@ DEFAULT_MODULE_UTILS_PATH: DEFAULT_NETCONF_PLUGIN_PATH: name: Netconf Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/netconf:/usr/share/ansible/plugins/netconf" }}' - description: Colon separated paths in which Ansible will search for Netconf Plugins. + description: Colon-separated paths in which Ansible will search for Netconf Plugins. env: [{name: ANSIBLE_NETCONF_PLUGINS}] ini: - {key: netconf_plugins, section: defaults} @@ -890,7 +900,7 @@ DEFAULT_NO_TARGET_SYSLOG: name: No syslog on target default: False description: - - Toggle Ansible logging to syslog on the target when it executes tasks. On Windows hosts this will disable a newer + - Toggle Ansible logging to syslog on the target when it executes tasks. On Windows hosts, this will disable a newer style PowerShell modules from writing to the event log. env: [{name: ANSIBLE_NO_TARGET_SYSLOG}] ini: @@ -925,7 +935,7 @@ DEFAULT_PRIVATE_KEY_FILE: default: ~ description: - Option for connections using a certificate or key file to authenticate, rather than an agent or passwords, - you can set the default value here to avoid re-specifying --private-key with every invocation. + you can set the default value here to avoid re-specifying ``--private-key`` with every invocation. env: [{name: ANSIBLE_PRIVATE_KEY_FILE}] ini: - {key: private_key_file, section: defaults} @@ -935,7 +945,10 @@ DEFAULT_PRIVATE_ROLE_VARS: default: False description: - By default, imported roles publish their variables to the play and other roles, this setting can avoid that. - - This was introduced as a way to reset role variables to default values if a role is used more than once in a playbook. + - This was introduced as a way to reset role variables to default values if a role is used more than once + in a playbook. + - Starting in version '2.17' M(ansible.builtin.include_roles) and M(ansible.builtin.import_roles) can + indivudually override this via the C(public) parameter. - Included roles only make their variables public at execution, unlike imported roles which happen at playbook compile time. env: [{name: ANSIBLE_PRIVATE_ROLE_VARS}] ini: @@ -962,7 +975,7 @@ DEFAULT_REMOTE_USER: DEFAULT_ROLES_PATH: name: Roles path default: '{{ ANSIBLE_HOME ~ "/roles:/usr/share/ansible/roles:/etc/ansible/roles" }}' - description: Colon separated paths in which Ansible will search for Roles. + description: Colon-separated paths in which Ansible will search for Roles. env: [{name: ANSIBLE_ROLES_PATH}] expand_relative_paths: True ini: @@ -974,7 +987,7 @@ DEFAULT_SELINUX_SPECIAL_FS: default: fuse, nfs, vboxsf, ramfs, 9p, vfat description: - "Some filesystems do not support safe operations and/or return inconsistent errors, - this setting makes Ansible 'tolerate' those in the list w/o causing fatal errors." + this setting makes Ansible 'tolerate' those in the list without causing fatal errors." - Data corruption may occur and writes are not always verified when a filesystem is in the list. env: - name: ANSIBLE_SELINUX_SPECIAL_FS @@ -993,10 +1006,10 @@ DEFAULT_STDOUT_CALLBACK: ini: - {key: stdout_callback, section: defaults} EDITOR: - name: editor application touse + name: editor application to use default: vi descrioption: - - for the cases in which Ansible needs to return a file within an editor, this chooses the application to use + - for the cases in which Ansible needs to return a file within an editor, this chooses the application to use. ini: - section: defaults key: editor @@ -1023,7 +1036,7 @@ TASK_DEBUGGER_IGNORE_ERRORS: description: - This option defines whether the task debugger will be invoked on a failed task when ignore_errors=True is specified. - - True specifies that the debugger will honor ignore_errors, False will not honor ignore_errors. + - True specifies that the debugger will honor ignore_errors, and False will not honor ignore_errors. type: boolean env: [{name: ANSIBLE_TASK_DEBUGGER_IGNORE_ERRORS}] ini: @@ -1039,7 +1052,7 @@ DEFAULT_STRATEGY: version_added: "2.3" DEFAULT_STRATEGY_PLUGIN_PATH: name: Strategy Plugins Path - description: Colon separated paths in which Ansible will search for Strategy Plugins. + description: Colon-separated paths in which Ansible will search for Strategy Plugins. default: '{{ ANSIBLE_HOME ~ "/plugins/strategy:/usr/share/ansible/plugins/strategy" }}' env: [{name: ANSIBLE_STRATEGY_PLUGINS}] ini: @@ -1056,21 +1069,21 @@ DEFAULT_SU: DEFAULT_SYSLOG_FACILITY: name: syslog facility default: LOG_USER - description: Syslog facility to use when Ansible logs to the remote target + description: Syslog facility to use when Ansible logs to the remote target. env: [{name: ANSIBLE_SYSLOG_FACILITY}] ini: - {key: syslog_facility, section: defaults} DEFAULT_TERMINAL_PLUGIN_PATH: name: Terminal Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/terminal:/usr/share/ansible/plugins/terminal" }}' - description: Colon separated paths in which Ansible will search for Terminal Plugins. + description: Colon-separated paths in which Ansible will search for Terminal Plugins. env: [{name: ANSIBLE_TERMINAL_PLUGINS}] ini: - {key: terminal_plugins, section: defaults} type: pathspec DEFAULT_TEST_PLUGIN_PATH: name: Jinja2 Test Plugins Path - description: Colon separated paths in which Ansible will search for Jinja2 Test Plugins. + description: Colon-separated paths in which Ansible will search for Jinja2 Test Plugins. default: '{{ ANSIBLE_HOME ~ "/plugins/test:/usr/share/ansible/plugins/test" }}' env: [{name: ANSIBLE_TEST_PLUGINS}] ini: @@ -1107,7 +1120,7 @@ DEFAULT_UNDEFINED_VAR_BEHAVIOR: DEFAULT_VARS_PLUGIN_PATH: name: Vars Plugins Path default: '{{ ANSIBLE_HOME ~ "/plugins/vars:/usr/share/ansible/plugins/vars" }}' - description: Colon separated paths in which Ansible will search for Vars Plugins. + description: Colon-separated paths in which Ansible will search for Vars Plugins. env: [{name: ANSIBLE_VARS_PLUGINS}] ini: - {key: vars_plugins, section: defaults} @@ -1124,7 +1137,7 @@ DEFAULT_VARS_PLUGIN_PATH: DEFAULT_VAULT_ID_MATCH: name: Force vault id match default: False - description: 'If true, decrypting vaults with a vault id will only try the password from the matching vault-id' + description: 'If true, decrypting vaults with a vault id will only try the password from the matching vault-id.' env: [{name: ANSIBLE_VAULT_ID_MATCH}] ini: - {key: vault_id_match, section: defaults} @@ -1132,7 +1145,7 @@ DEFAULT_VAULT_ID_MATCH: DEFAULT_VAULT_IDENTITY: name: Vault id label default: default - description: 'The label to use for the default vault id label in cases where a vault id label is not provided' + description: 'The label to use for the default vault id label in cases where a vault id label is not provided.' env: [{name: ANSIBLE_VAULT_IDENTITY}] ini: - {key: vault_identity, section: defaults} @@ -1147,7 +1160,7 @@ VAULT_ENCRYPT_SALT: version_added: '2.15' DEFAULT_VAULT_ENCRYPT_IDENTITY: name: Vault id to use for encryption - description: 'The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The --encrypt-vault-id cli option overrides the configured value.' + description: 'The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The ``--encrypt-vault-id`` CLI option overrides the configured value.' env: [{name: ANSIBLE_VAULT_ENCRYPT_IDENTITY}] ini: - {key: vault_encrypt_identity, section: defaults} @@ -1155,7 +1168,7 @@ DEFAULT_VAULT_ENCRYPT_IDENTITY: DEFAULT_VAULT_IDENTITY_LIST: name: Default vault ids default: [] - description: 'A list of vault-ids to use by default. Equivalent to multiple --vault-id args. Vault-ids are tried in order.' + description: 'A list of vault-ids to use by default. Equivalent to multiple ``--vault-id`` args. Vault-ids are tried in order.' env: [{name: ANSIBLE_VAULT_IDENTITY_LIST}] ini: - {key: vault_identity_list, section: defaults} @@ -1165,7 +1178,7 @@ DEFAULT_VAULT_PASSWORD_FILE: name: Vault password file default: ~ description: - - 'The vault password file to use. Equivalent to --vault-password-file or --vault-id' + - 'The vault password file to use. Equivalent to ``--vault-password-file`` or ``--vault-id``.' - If executable, it will be run and the resulting stdout will be used as the password. env: [{name: ANSIBLE_VAULT_PASSWORD_FILE}] ini: @@ -1191,7 +1204,7 @@ DEPRECATION_WARNINGS: DEVEL_WARNING: name: Running devel warning default: True - description: Toggle to control showing warnings related to running devel + description: Toggle to control showing warnings related to running devel. env: [{name: ANSIBLE_DEVEL_WARNING}] ini: - {key: devel_warning, section: defaults} @@ -1207,7 +1220,7 @@ DIFF_ALWAYS: DIFF_CONTEXT: name: Difference context default: 3 - description: How many lines of context to show when displaying the differences between files. + description: Number of lines of context to show when displaying the differences between files. env: [{name: ANSIBLE_DIFF_CONTEXT}] ini: - {key: context, section: diff} @@ -1225,8 +1238,8 @@ DISPLAY_ARGS_TO_STDOUT: you do not want those to be printed." - "If you set this to True you should be sure that you have secured your environment's stdout (no one can shoulder surf your screen and you aren't saving stdout to an insecure file) or - made sure that all of your playbooks explicitly added the ``no_log: True`` parameter to tasks which have sensitive values - See How do I keep secret data in my playbook? for more information." + made sure that all of your playbooks explicitly added the ``no_log: True`` parameter to tasks that have sensitive values + :ref:`keep_secret_data` for more information." env: [{name: ANSIBLE_DISPLAY_ARGS_TO_STDOUT}] ini: - {key: display_args_to_stdout, section: defaults} @@ -1235,7 +1248,7 @@ DISPLAY_ARGS_TO_STDOUT: DISPLAY_SKIPPED_HOSTS: name: Show skipped results default: True - description: "Toggle to control displaying skipped task/host entries in a task in the default callback" + description: "Toggle to control displaying skipped task/host entries in a task in the default callback." env: - name: ANSIBLE_DISPLAY_SKIPPED_HOSTS ini: @@ -1245,7 +1258,7 @@ DOCSITE_ROOT_URL: name: Root docsite URL default: https://docs.ansible.com/ansible-core/ description: Root docsite URL used to generate docs URLs in warning/error text; - must be an absolute URL with valid scheme and trailing slash. + must be an absolute URL with a valid scheme and trailing slash. ini: - {key: docsite_root_url, section: defaults} version_added: "2.8" @@ -1253,7 +1266,7 @@ DUPLICATE_YAML_DICT_KEY: name: Controls ansible behaviour when finding duplicate keys in YAML. default: warn description: - - By default Ansible will issue a warning when a duplicate dict key is encountered in YAML. + - By default, Ansible will issue a warning when a duplicate dict key is encountered in YAML. - These warnings can be silenced by adjusting this setting to False. env: [{name: ANSIBLE_DUPLICATE_YAML_DICT_KEY}] ini: @@ -1345,7 +1358,7 @@ GALAXY_ROLE_SKELETON: GALAXY_ROLE_SKELETON_IGNORE: name: Galaxy role skeleton ignore default: ["^.git$", "^.*/.git_keep$"] - description: patterns of files to ignore inside a Galaxy role or collection skeleton directory + description: patterns of files to ignore inside a Galaxy role or collection skeleton directory. env: [{name: ANSIBLE_GALAXY_ROLE_SKELETON_IGNORE}] ini: - {key: role_skeleton_ignore, section: galaxy} @@ -1360,14 +1373,14 @@ GALAXY_COLLECTION_SKELETON: GALAXY_COLLECTION_SKELETON_IGNORE: name: Galaxy collection skeleton ignore default: ["^.git$", "^.*/.git_keep$"] - description: patterns of files to ignore inside a Galaxy collection skeleton directory + description: patterns of files to ignore inside a Galaxy collection skeleton directory. env: [{name: ANSIBLE_GALAXY_COLLECTION_SKELETON_IGNORE}] ini: - {key: collection_skeleton_ignore, section: galaxy} type: list GALAXY_COLLECTIONS_PATH_WARNING: - name: "ansible-galaxy collection install colections path warnings" - description: "whether ``ansible-galaxy collection install`` should warn about ``--collections-path`` missing from configured :ref:`collections_paths`" + name: "ansible-galaxy collection install collections path warnings" + description: "whether ``ansible-galaxy collection install`` should warn about ``--collections-path`` missing from configured :ref:`collections_paths`." default: true type: bool env: [{name: ANSIBLE_GALAXY_COLLECTIONS_PATH_WARNING}] @@ -1395,7 +1408,7 @@ GALAXY_SERVER_LIST: - A list of Galaxy servers to use when installing a collection. - The value corresponds to the config ini header ``[galaxy_server.{{item}}]`` which defines the server details. - 'See :ref:`galaxy_server_config` for more details on how to define a Galaxy server.' - - The order of servers in this list is used to as the order in which a collection is resolved. + - The order of servers in this list is used as the order in which a collection is resolved. - Setting this config option will ignore the :ref:`galaxy_server` config option. env: [{name: ANSIBLE_GALAXY_SERVER_LIST}] ini: @@ -1498,11 +1511,13 @@ GALAXY_REQUIRED_VALID_SIGNATURE_COUNT: - This should be a positive integer or all to indicate all signatures must successfully validate the collection. - Prepend + to the value to fail if no valid signatures are found for the collection. HOST_KEY_CHECKING: - # note: constant not in use by ssh plugin anymore + # NOTE: constant not in use by ssh/paramiko plugins anymore, but they do support the same configuration sources # TODO: check non ssh connection plugins for use/migration - name: Check host keys + name: Toggle host/key check default: True - description: 'Set this to "False" if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host' + description: + - Set this to "False" if you want to avoid host key checking by the underlying connection plugin Ansible uses to connect to the host. + - Please read the documentation of the specific connection plugin used for details. env: [{name: ANSIBLE_HOST_KEY_CHECKING}] ini: - {key: host_key_checking, section: defaults} @@ -1510,7 +1525,7 @@ HOST_KEY_CHECKING: HOST_PATTERN_MISMATCH: name: Control host pattern mismatch behaviour default: 'warning' - description: This setting changes the behaviour of mismatched host patterns, it allows you to force a fatal error, a warning or just ignore it + description: This setting changes the behaviour of mismatched host patterns, it allows you to force a fatal error, a warning or just ignore it. env: [{name: ANSIBLE_HOST_PATTERN_MISMATCH}] ini: - {key: host_pattern_mismatch, section: inventory} @@ -1533,23 +1548,14 @@ INTERPRETER_PYTHON: falling back to a fixed ordered list of well-known Python interpreter locations if a platform-specific default is not available. The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting ``auto_silent`` or - ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backwards-compatibility + ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backward-compatibility with older Ansible releases that always defaulted to ``/usr/bin/python``, will use that interpreter if present. _INTERPRETER_PYTHON_DISTRO_MAP: name: Mapping of known included platform pythons for various Linux distros default: - redhat: - '6': /usr/bin/python - '8': /usr/libexec/platform-python - '9': /usr/bin/python3 - debian: - '8': /usr/bin/python - '10': /usr/bin/python3 - fedora: - '23': /usr/bin/python3 - ubuntu: - '14': /usr/bin/python - '16': /usr/bin/python3 + # Entry only for testing + ansible test: + '99': /usr/bin/python99 version_added: "2.8" # FUTURE: add inventory override once we're sure it can't be abused by a rogue target # FUTURE: add a platform layer to the map so we could use for, eg, freebsd/macos/etc? @@ -1562,12 +1568,8 @@ INTERPRETER_PYTHON_FALLBACK: - python3.9 - python3.8 - python3.7 - - python3.6 - /usr/bin/python3 - - /usr/libexec/platform-python - - python2.7 - - /usr/bin/python - - python + - python3 vars: - name: ansible_interpreter_python_fallback type: list @@ -1590,7 +1592,7 @@ TRANSFORM_INVALID_GROUP_CHARS: INVALID_TASK_ATTRIBUTE_FAILED: name: Controls whether invalid attributes for a task result in errors instead of warnings default: True - description: If 'false', invalid attributes for a task will result in warnings instead of errors + description: If 'false', invalid attributes for a task will result in warnings instead of errors. type: boolean env: - name: ANSIBLE_INVALID_TASK_ATTRIBUTE_FAILED @@ -1683,7 +1685,7 @@ INVENTORY_EXPORT: INVENTORY_IGNORE_EXTS: name: Inventory ignore extensions default: "{{(REJECT_EXTS + ('.orig', '.ini', '.cfg', '.retry'))}}" - description: List of extensions to ignore when using a directory as an inventory source + description: List of extensions to ignore when using a directory as an inventory source. env: [{name: ANSIBLE_INVENTORY_IGNORE}] ini: - {key: inventory_ignore_extensions, section: defaults} @@ -1692,7 +1694,7 @@ INVENTORY_IGNORE_EXTS: INVENTORY_IGNORE_PATTERNS: name: Inventory ignore patterns default: [] - description: List of patterns to ignore when using a directory as an inventory source + description: List of patterns to ignore when using a directory as an inventory source. env: [{name: ANSIBLE_INVENTORY_IGNORE_REGEX}] ini: - {key: inventory_ignore_patterns, section: defaults} @@ -1703,29 +1705,16 @@ INVENTORY_UNPARSED_IS_FAILED: default: False description: > If 'true' it is a fatal error if every single potential inventory - source fails to parse, otherwise this situation will only attract a + source fails to parse, otherwise, this situation will only attract a warning. env: [{name: ANSIBLE_INVENTORY_UNPARSED_FAILED}] ini: - {key: unparsed_is_failed, section: inventory} type: bool -JINJA2_NATIVE_WARNING: - name: Running older than required Jinja version for jinja2_native warning - default: True - description: Toggle to control showing warnings related to running a Jinja version - older than required for jinja2_native - env: - - name: ANSIBLE_JINJA2_NATIVE_WARNING - deprecated: - why: This option is no longer used in the Ansible Core code base. - version: "2.17" - ini: - - {key: jinja2_native_warning, section: defaults} - type: boolean MAX_FILE_SIZE_FOR_DIFF: name: Diff maximum file size default: 104448 - description: Maximum size of files to be considered for diff display + description: Maximum size of files to be considered for diff display. env: [{name: ANSIBLE_MAX_DIFF_SIZE}] ini: - {key: max_diff_size, section: defaults} @@ -1754,8 +1743,8 @@ MODULE_IGNORE_EXTS: name: Module ignore extensions default: "{{(REJECT_EXTS + ('.yaml', '.yml', '.ini'))}}" description: - - List of extensions to ignore when looking for modules to load - - This is for rejecting script and binary module fallback extensions + - List of extensions to ignore when looking for modules to load. + - This is for rejecting script and binary module fallback extensions. env: [{name: ANSIBLE_MODULE_IGNORE_EXTS}] ini: - {key: module_ignore_exts, section: defaults} @@ -1763,16 +1752,16 @@ MODULE_IGNORE_EXTS: MODULE_STRICT_UTF8_RESPONSE: name: Module strict UTF-8 response description: - - Enables whether module responses are evaluated for containing non UTF-8 data - - Disabling this may result in unexpected behavior - - Only ansible-core should evaluate this configuration + - Enables whether module responses are evaluated for containing non-UTF-8 data. + - Disabling this may result in unexpected behavior. + - Only ansible-core should evaluate this configuration. env: [{name: ANSIBLE_MODULE_STRICT_UTF8_RESPONSE}] ini: - {key: module_strict_utf8_response, section: defaults} type: bool default: True OLD_PLUGIN_CACHE_CLEARING: - description: Previously Ansible would only clear some of the plugin loading caches when loading new roles, this led to some behaviours in which a plugin loaded in previous plays would be unexpectedly 'sticky'. This setting allows to return to that behaviour. + description: Previously Ansible would only clear some of the plugin loading caches when loading new roles, this led to some behaviors in which a plugin loaded in previous plays would be unexpectedly 'sticky'. This setting allows the user to return to that behavior. env: [{name: ANSIBLE_OLD_PLUGIN_CACHE_CLEAR}] ini: - {key: old_plugin_cache_clear, section: defaults} @@ -1783,7 +1772,7 @@ PAGER: name: pager application to use default: less descrioption: - - for the cases in which Ansible needs to return output in pageable fashion, this chooses the application to use + - for the cases in which Ansible needs to return output in a pageable fashion, this chooses the application to use. ini: - section: defaults key: pager @@ -1793,13 +1782,16 @@ PAGER: version_added: '2.15' - name: PAGER PARAMIKO_HOST_KEY_AUTO_ADD: - # TODO: move to plugin default: False description: 'TODO: write it' env: [{name: ANSIBLE_PARAMIKO_HOST_KEY_AUTO_ADD}] ini: - {key: host_key_auto_add, section: paramiko_connection} type: boolean + deprecated: + why: This option was moved to the plugin itself + version: "2.20" + alternatives: Use the option from the plugin itself. PARAMIKO_LOOK_FOR_KEYS: name: look for keys default: True @@ -1808,10 +1800,14 @@ PARAMIKO_LOOK_FOR_KEYS: ini: - {key: look_for_keys, section: paramiko_connection} type: boolean + deprecated: + why: This option was moved to the plugin itself + version: "2.20" + alternatives: Use the option from the plugin itself. PERSISTENT_CONTROL_PATH_DIR: name: Persistence socket path default: '{{ ANSIBLE_HOME ~ "/pc" }}' - description: Path to socket to be used by the connection persistence system. + description: Path to the socket to be used by the connection persistence system. env: [{name: ANSIBLE_PERSISTENT_CONTROL_PATH_DIR}] ini: - {key: control_path_dir, section: persistent_connection} @@ -1835,7 +1831,7 @@ PERSISTENT_CONNECT_RETRY_TIMEOUT: PERSISTENT_COMMAND_TIMEOUT: name: Persistence command timeout default: 30 - description: This controls the amount of time to wait for response from remote device before timing out persistent connection. + description: This controls the amount of time to wait for a response from a remote device before timing out a persistent connection. env: [{name: ANSIBLE_PERSISTENT_COMMAND_TIMEOUT}] ini: - {key: command_timeout, section: persistent_connection} @@ -1853,7 +1849,7 @@ PLAYBOOK_VARS_ROOT: default: top version_added: "2.4.1" description: - - This sets which playbook dirs will be used as a root to process vars plugins, which includes finding host_vars/group_vars + - This sets which playbook dirs will be used as a root to process vars plugins, which includes finding host_vars/group_vars. env: [{name: ANSIBLE_PLAYBOOK_VARS_ROOT}] ini: - {key: playbook_vars_root, section: defaults} @@ -1909,7 +1905,7 @@ RUN_VARS_PLUGINS: name: When should vars plugins run relative to inventory default: demand description: - - This setting can be used to optimize vars_plugin usage depending on user's inventory size and play selection. + - This setting can be used to optimize vars_plugin usage depending on the user's inventory size and play selection. env: [{name: ANSIBLE_RUN_VARS_PLUGINS}] ini: - {key: run_vars_plugins, section: defaults} @@ -1921,7 +1917,7 @@ RUN_VARS_PLUGINS: SHOW_CUSTOM_STATS: name: Display custom stats default: False - description: 'This adds the custom stats set via the set_stats plugin to the default output' + description: 'This adds the custom stats set via the set_stats plugin to the default output.' env: [{name: ANSIBLE_SHOW_CUSTOM_STATS}] ini: - {key: show_custom_stats, section: defaults} @@ -1930,7 +1926,7 @@ STRING_TYPE_FILTERS: name: Filters to preserve strings default: [string, to_json, to_nice_json, to_yaml, to_nice_yaml, ppretty, json] description: - - "This list of filters avoids 'type conversion' when templating variables" + - "This list of filters avoids 'type conversion' when templating variables." - Useful when you want to avoid conversion into lists or dictionaries for JSON strings, for example. env: [{name: ANSIBLE_STRING_TYPE_FILTERS}] ini: @@ -1940,8 +1936,8 @@ SYSTEM_WARNINGS: name: System warnings default: True description: - - Allows disabling of warnings related to potential issues on the system running ansible itself (not on the managed hosts) - - These may include warnings about 3rd party packages or other conditions that should be resolved if possible. + - Allows disabling of warnings related to potential issues on the system running Ansible itself (not on the managed hosts). + - These may include warnings about third-party packages or other conditions that should be resolved if possible. env: [{name: ANSIBLE_SYSTEM_WARNINGS}] ini: - {key: system_warnings, section: defaults} @@ -1964,6 +1960,15 @@ TAGS_SKIP: ini: - {key: skip, section: tags} version_added: "2.5" +TARGET_LOG_INFO: + name: Target log info + description: A string to insert into target logging for tracking purposes + env: [{name: ANSIBLE_TARGET_LOG_INFO}] + ini: + - {key: target_log_info, section: defaults} + vars: + - name: ansible_target_log_info + version_added: "2.17" TASK_TIMEOUT: name: Task Timeout default: 0 diff --git a/lib/ansible/config/manager.py b/lib/ansible/config/manager.py index 041e96e..b8dada4 100644 --- a/lib/ansible/config/manager.py +++ b/lib/ansible/config/manager.py @@ -1,8 +1,7 @@ # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type +from __future__ import annotations import atexit import configparser @@ -23,11 +22,9 @@ from ansible.module_utils.six import string_types from ansible.module_utils.parsing.convert_bool import boolean from ansible.parsing.quoting import unquote from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode -from ansible.utils import py3compat from ansible.utils.path import cleanup_tmp_file, makedirs_safe, unfrackpath -Plugin = namedtuple('Plugin', 'name type') Setting = namedtuple('Setting', 'name value origin type') INTERNAL_DEFS = {'lookup': ('_terms',)} @@ -45,7 +42,7 @@ def _get_entry(plugin_type, plugin_name, config): # FIXME: see if we can unify in module_utils with similar function used by argspec -def ensure_type(value, value_type, origin=None): +def ensure_type(value, value_type, origin=None, origin_ftype=None): ''' return a configuration variable with casting :arg value: The value to ensure correct typing of :kwarg value_type: The type of the value. This can be any of the following strings: @@ -144,7 +141,7 @@ def ensure_type(value, value_type, origin=None): elif value_type in ('str', 'string'): if isinstance(value, (string_types, AnsibleVaultEncryptedUnicode, bool, int, float, complex)): value = to_text(value, errors='surrogate_or_strict') - if origin == 'ini': + if origin_ftype and origin_ftype == 'ini': value = unquote(value) else: errmsg = 'string' @@ -152,7 +149,7 @@ def ensure_type(value, value_type, origin=None): # defaults to string type elif isinstance(value, (string_types, AnsibleVaultEncryptedUnicode)): value = to_text(value, errors='surrogate_or_strict') - if origin == 'ini': + if origin_ftype and origin_ftype == 'ini': value = unquote(value) if errmsg: @@ -473,6 +470,7 @@ class ConfigManager(object): # Note: sources that are lists listed in low to high precedence (last one wins) value = None origin = None + origin_ftype = None defs = self.get_configuration_definitions(plugin_type, plugin_name) if config in defs: @@ -525,31 +523,40 @@ class ConfigManager(object): # env vars are next precedence if value is None and defs[config].get('env'): - value, origin = self._loop_entries(py3compat.environ, defs[config]['env']) + value, origin = self._loop_entries(os.environ, defs[config]['env']) origin = 'env: %s' % origin # try config file entries next, if we have one if self._parsers.get(cfile, None) is None: self._parse_config_file(cfile) + # attempt to read from config file if value is None and cfile is not None: ftype = get_config_type(cfile) if ftype and defs[config].get(ftype): - if ftype == 'ini': - # load from ini config - try: # FIXME: generalize _loop_entries to allow for files also, most of this code is dupe - for ini_entry in defs[config]['ini']: - temp_value = get_ini_config_value(self._parsers[cfile], ini_entry) - if temp_value is not None: - value = temp_value - origin = cfile - if 'deprecated' in ini_entry: - self.DEPRECATED.append(('[%s]%s' % (ini_entry['section'], ini_entry['key']), ini_entry['deprecated'])) - except Exception as e: - sys.stderr.write("Error while loading ini config %s: %s" % (cfile, to_native(e))) - elif ftype == 'yaml': - # FIXME: implement, also , break down key from defs (. notation???) - origin = cfile + try: + for entry in defs[config][ftype]: + # load from config + if ftype == 'ini': + temp_value = get_ini_config_value(self._parsers[cfile], entry) + elif ftype == 'yaml': + raise AnsibleError('YAML configuration type has not been implemented yet') + else: + raise AnsibleError('Invalid configuration file type: %s' % ftype) + + if temp_value is not None: + # set value and origin + value = temp_value + origin = cfile + origin_ftype = ftype + if 'deprecated' in entry: + if ftype == 'ini': + self.DEPRECATED.append(('[%s]%s' % (entry['section'], entry['key']), entry['deprecated'])) + else: + raise AnsibleError('Unimplemented file type: %s' % ftype) + + except Exception as e: + sys.stderr.write("Error while loading config %s: %s" % (cfile, to_native(e))) # set default if we got here w/o a value if value is None: @@ -561,12 +568,13 @@ class ConfigManager(object): origin = 'default' value = self.template_default(defs[config].get('default'), variables) try: - value = ensure_type(value, defs[config].get('type'), origin=origin) + # ensure correct type, can raise exceptions on mismatched types + value = ensure_type(value, defs[config].get('type'), origin=origin, origin_ftype=origin_ftype) except ValueError as e: if origin.startswith('env:') and value == '': # this is empty env var for non string so we can set to default origin = 'default' - value = ensure_type(defs[config].get('default'), defs[config].get('type'), origin=origin) + value = ensure_type(defs[config].get('default'), defs[config].get('type'), origin=origin, origin_ftype=origin_ftype) else: raise AnsibleOptionsError('Invalid type for configuration option %s (from %s): %s' % (to_native(_get_entry(plugin_type, plugin_name, config)).strip(), origin, to_native(e))) |