diff --git a/lib/ansible/modules/add_host.py b/lib/ansible/modules/add_host.py index fc4f79fa361..05be2adc220 100644 --- a/lib/ansible/modules/add_host.py +++ b/lib/ansible/modules/add_host.py @@ -29,14 +29,31 @@ options: - The groups to add the hostname to. type: list aliases: [ group, groupname ] +extends_documentation_fragment: +- action_common_attributes +attributes: + action: + support: full + async: + support: none + become: + support: none + bypass_host_loop: + support: full + check_mode: + support: full + connection: + support: none + delegation: + support: none + proprietary: + support: full + windows: + support: full notes: -- This module bypasses the play host loop and only runs once for all the hosts in the play, if you need it - to iterate use a C(loop) construct. If you need to dynamically add all hosts targeted by a playbook for - later use, the C(group_by) module is potentially a better choice. - The alias C(host) of the parameter C(name) is only available on Ansible 2.4 and newer. - Since Ansible 2.4, the C(inventory_dir) variable is now set to C(None) instead of the 'global inventory source', because you can now have multiple sources. An example was added that shows how to partially restore the previous behaviour. -- Windows targets are supported by this module. - Though this module does not change the remote host, we do provide 'changed' status as it can be useful for those trying to track inventory changes. - The hosts added will not bypass the ``--limit`` from the command line, so both of those need to be in agreement to make them available as play targets. They are still available from hostvars and for delegation as a normal part of the inventory. diff --git a/lib/ansible/modules/apt.py b/lib/ansible/modules/apt.py index d977ce69919..bb496315984 100644 --- a/lib/ansible/modules/apt.py +++ b/lib/ansible/modules/apt.py @@ -170,6 +170,13 @@ requirements: - python3-apt (python 3) - aptitude (before 2.4) author: "Matthew Williams (@mgwilliams)" +extends_documentation_fragment: +- action_common_attributes +attributes: + check_mode: + support: full + diff_mode: + support: full notes: - Three of the upgrade modes (C(full), C(safe) and its alias C(yes)) required C(aptitude) up to 2.3, since 2.4 C(apt-get) is used as a fall-back. - In most cases, packages installed with apt will start newly installed services by default. Most distributions have mechanisms to avoid this. diff --git a/lib/ansible/modules/apt_key.py b/lib/ansible/modules/apt_key.py index 0201dfed03c..9fad1e0368b 100644 --- a/lib/ansible/modules/apt_key.py +++ b/lib/ansible/modules/apt_key.py @@ -19,6 +19,11 @@ version_added: "1.0" short_description: Add or remove an apt key description: - Add or remove an I(apt) key, optionally downloading it. +extends_documentation_fragment: +- action_common_attributes +attributes: + check_mode: + support: full notes: - The apt-key command has been deprecated and suggests to 'manage keyring files in trusted.gpg.d instead'. See the Debian wiki for details. This module is kept for backwards compatiblity for systems that still use apt-key as the main way to manage apt repository keys. @@ -27,7 +32,6 @@ notes: To generate a full-fingerprint imported key: C(apt-key adv --list-public-keys --with-fingerprint --with-colons)." - If you specify both the key id and the URL with C(state=present), the task can verify or add the key as needed. - Adding a new key requires an apt cache update (e.g. using the M(ansible.builtin.apt) module's update_cache option). - - Supports C(check_mode). requirements: - gpg options: diff --git a/lib/ansible/modules/apt_repository.py b/lib/ansible/modules/apt_repository.py index 5331e89a391..2ca353c7b08 100644 --- a/lib/ansible/modules/apt_repository.py +++ b/lib/ansible/modules/apt_repository.py @@ -17,10 +17,14 @@ module: apt_repository short_description: Add and remove APT repositories description: - Add or remove an APT repositories in Ubuntu and Debian. +extends_documentation_fragment: +- action_common_attributes +attributes: + check_mode: + support: full notes: - This module works on Debian, Ubuntu and their derivatives. - This module supports Debian Squeeze (version 6) as well as its successors. - - Supports C(check_mode). options: repo: description: diff --git a/lib/ansible/modules/assemble.py b/lib/ansible/modules/assemble.py index c94d267765a..aa2c3ba9944 100644 --- a/lib/ansible/modules/assemble.py +++ b/lib/ansible/modules/assemble.py @@ -74,6 +74,16 @@ options: - The command is passed securely so shell features like expansion and pipes won't work. type: str version_added: '2.0' +attributes: + action: + support: full + async: + support: none + safe_file_operations: + support: full + vault: + support: full + version_added: '2.2' seealso: - module: ansible.builtin.copy - module: ansible.builtin.template @@ -81,6 +91,7 @@ seealso: author: - Stephen Fromm (@sfromm) extends_documentation_fragment: +- action_common_attributes - decrypt - files ''' diff --git a/lib/ansible/modules/assert.py b/lib/ansible/modules/assert.py index 32a0dd6fb80..3c725c31bed 100644 --- a/lib/ansible/modules/assert.py +++ b/lib/ansible/modules/assert.py @@ -40,8 +40,21 @@ options: type: bool default: no version_added: "2.8" -notes: - - This module is also supported for Windows targets. +extends_documentation_fragment: +- action_common_attributes +attributes: + action: + support: full + async: + support: none + connection: + support: none + delegation: + support: none + proprietary: + support: full + windows: + support: full seealso: - module: ansible.builtin.debug - module: ansible.builtin.fail diff --git a/lib/ansible/modules/async_status.py b/lib/ansible/modules/async_status.py index 838bf451167..2b47bb6e2c6 100644 --- a/lib/ansible/modules/async_status.py +++ b/lib/ansible/modules/async_status.py @@ -29,8 +29,15 @@ options: type: str choices: [ cleanup, status ] default: status -notes: -- This module is also supported for Windows targets. +extends_documentation_fragment: +- action_common_attributes +attributes: + action: + support: full + async: + support: none + windows: + support: full seealso: - ref: playbooks_async description: Detailed information on how to use asynchronous actions and polling. diff --git a/lib/ansible/modules/blockinfile.py b/lib/ansible/modules/blockinfile.py index 668c67a3c40..ff91da21ca2 100644 --- a/lib/ansible/modules/blockinfile.py +++ b/lib/ansible/modules/blockinfile.py @@ -86,14 +86,21 @@ options: default: END version_added: '2.5' notes: - - This module supports check mode. - When using 'with_*' loops be aware that if you do not set a unique mark the block will be overwritten on each iteration. - As of Ansible 2.3, the I(dest) option has been changed to I(path) as default, but I(dest) still works as well. - Option I(follow) has been removed in Ansible 2.5, because this module modifies the contents of the file so I(follow=no) doesn't make sense. - When more then one block should be handled in one file you must change the I(marker) per task. extends_documentation_fragment: +- action_common_attributes - files - validate +attributes: + check_mode: + support: full + diff_mode: + support: full + safe_file_operations: + support: full ''' EXAMPLES = r''' diff --git a/lib/ansible/modules/copy.py b/lib/ansible/modules/copy.py index 80012de6583..eb27c61169d 100644 --- a/lib/ansible/modules/copy.py +++ b/lib/ansible/modules/copy.py @@ -141,6 +141,8 @@ attributes: support: full diff_mode: support: full + safe_file_operations: + support: full vault: support: full version_added: '2.2' diff --git a/lib/ansible/modules/cron.py b/lib/ansible/modules/cron.py index 1854bcd2303..df305a85a7c 100644 --- a/lib/ansible/modules/cron.py +++ b/lib/ansible/modules/cron.py @@ -132,15 +132,18 @@ options: type: str version_added: "2.1" requirements: - - cron (or cronie on CentOS) + - cron (any 'vixie cron' conformant variant, like cronie) author: - Dane Summers (@dsummersl) - Mike Grozak (@rhaido) - Patrick Callahan (@dirtyharrycallahan) - Evan Kaufman (@EvanK) - Luca Berruti (@lberruti) -notes: - - Supports C(check_mode). +extends_documentation_fragment: +- action_common_attributes +attributes: + check_mode: + support: full ''' EXAMPLES = r'''