From 9de145482bcd855735c8306999381bd6489492e0 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 20 Feb 2023 17:28:47 +0100 Subject: [PATCH] Add attributes to various basic modules (#5964) * Add attributes to various basic modules. * Check and diff mode for pam_limits was added in #830. --- plugins/modules/alternatives.py | 7 +++++++ plugins/modules/archive.py | 9 ++++++++- plugins/modules/cronvar.py | 7 +++++++ plugins/modules/crypttab.py | 7 +++++++ plugins/modules/dconf.py | 7 +++++++ plugins/modules/gconftool2.py | 9 ++++++++- plugins/modules/homectl.py | 7 +++++++ plugins/modules/ini_file.py | 21 ++++++++++++++------- plugins/modules/interfaces_file.py | 15 +++++++++++---- plugins/modules/java_cert.py | 7 +++++++ plugins/modules/java_keystore.py | 8 +++++++- plugins/modules/kernel_blacklist.py | 9 ++++++++- plugins/modules/keyring.py | 7 +++++++ plugins/modules/launchd.py | 11 +++++++++-- plugins/modules/locale_gen.py | 23 +++++++++++++++-------- plugins/modules/make.py | 9 ++++++++- plugins/modules/mksysb.py | 7 +++++++ plugins/modules/modprobe.py | 7 +++++++ plugins/modules/nmcli.py | 11 +++++++++-- plugins/modules/osx_defaults.py | 7 +++++++ plugins/modules/pam_limits.py | 9 +++++++++ plugins/modules/pamd.py | 7 +++++++ plugins/modules/read_csv.py | 7 +++++++ plugins/modules/sefcontext.py | 11 +++++++++-- plugins/modules/selinux_permissive.py | 7 +++++++ plugins/modules/selogin.py | 9 ++++++++- plugins/modules/seport.py | 7 +++++++ plugins/modules/ssh_config.py | 9 +++++++-- plugins/modules/sudoers.py | 7 +++++++ plugins/modules/sysrc.py | 7 +++++++ plugins/modules/timezone.py | 7 +++++++ plugins/modules/ufw.py | 7 +++++++ plugins/modules/xattr.py | 7 +++++++ plugins/modules/xfconf.py | 9 +++++++++ plugins/modules/xml.py | 9 ++++++++- 35 files changed, 280 insertions(+), 34 deletions(-) diff --git a/plugins/modules/alternatives.py b/plugins/modules/alternatives.py index 48cacb4540..97d4f51fbb 100644 --- a/plugins/modules/alternatives.py +++ b/plugins/modules/alternatives.py @@ -22,6 +22,13 @@ author: - Marius Rieder (@jiuka) - David Wittman (@DavidWittman) - Gabe Mulley (@mulby) +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: full options: name: description: diff --git a/plugins/modules/archive.py b/plugins/modules/archive.py index 83eae34f56..5744925312 100644 --- a/plugins/modules/archive.py +++ b/plugins/modules/archive.py @@ -14,11 +14,18 @@ DOCUMENTATION = r''' --- module: archive short_description: Creates a compressed archive of one or more files or trees -extends_documentation_fragment: files +extends_documentation_fragment: + - files + - community.general.attributes description: - Creates or extends an archive. - The source and archive are on the remote host, and the archive I(is not) copied to the local host. - Source files can be deleted after archival by specifying I(remove=True). +attributes: + check_mode: + support: full + diff_mode: + support: none options: path: description: diff --git a/plugins/modules/cronvar.py b/plugins/modules/cronvar.py index 9299880537..7effed2ae1 100644 --- a/plugins/modules/cronvar.py +++ b/plugins/modules/cronvar.py @@ -24,6 +24,13 @@ short_description: Manage variables in crontabs description: - Use this module to manage crontab variables. - This module allows you to create, update, or delete cron variable definitions. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: none + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/crypttab.py b/plugins/modules/crypttab.py index a334e8ab3f..6aea362e74 100644 --- a/plugins/modules/crypttab.py +++ b/plugins/modules/crypttab.py @@ -14,6 +14,13 @@ module: crypttab short_description: Encrypted Linux block devices description: - Control Linux encrypted block devices that are set up during system boot in C(/etc/crypttab). +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/dconf.py b/plugins/modules/dconf.py index 61bf6f0e3f..4d7ed34bf9 100644 --- a/plugins/modules/dconf.py +++ b/plugins/modules/dconf.py @@ -44,6 +44,13 @@ notes: key is by making the configuration change in application affected by the key, and then having a look at value set via commands C(dconf dump /path/to/dir/) or C(dconf read /path/to/key). +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: key: type: str diff --git a/plugins/modules/gconftool2.py b/plugins/modules/gconftool2.py index 788aed3423..949e92b306 100644 --- a/plugins/modules/gconftool2.py +++ b/plugins/modules/gconftool2.py @@ -12,11 +12,18 @@ __metaclass__ = type DOCUMENTATION = ''' module: gconftool2 author: - - Kenneth D. Evensen (@kevensen) + - Kenneth D. Evensen (@kevensen) short_description: Edit GNOME Configurations description: - This module allows for the manipulation of GNOME 2 Configuration via gconftool-2. Please see the gconftool-2(1) man pages for more details. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: key: type: str diff --git a/plugins/modules/homectl.py b/plugins/modules/homectl.py index c14dc4af9a..301e388d38 100644 --- a/plugins/modules/homectl.py +++ b/plugins/modules/homectl.py @@ -17,6 +17,13 @@ short_description: Manage user accounts with systemd-homed version_added: 4.4.0 description: - Manages a user's home directory managed by systemd-homed. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/ini_file.py b/plugins/modules/ini_file.py index ee4ad62b72..231a0e836a 100644 --- a/plugins/modules/ini_file.py +++ b/plugins/modules/ini_file.py @@ -15,14 +15,21 @@ DOCUMENTATION = r''' --- module: ini_file short_description: Tweak settings in INI files -extends_documentation_fragment: files +extends_documentation_fragment: + - files + - community.general.attributes description: - - Manage (add, remove, change) individual settings in an INI-style file without having - to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). - - Adds missing sections if they don't exist. - - Before Ansible 2.0, comments are discarded when the source file is read, and therefore will not show up in the destination file. - - Since Ansible 2.3, this module adds missing ending newlines to files to keep in line with the POSIX standard, even when - no other modifications need to be applied. + - Manage (add, remove, change) individual settings in an INI-style file without having + to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). + - Adds missing sections if they don't exist. + - Before Ansible 2.0, comments are discarded when the source file is read, and therefore will not show up in the destination file. + - Since Ansible 2.3, this module adds missing ending newlines to files to keep in line with the POSIX standard, even when + no other modifications need to be applied. +attributes: + check_mode: + support: full + diff_mode: + support: full options: path: description: diff --git a/plugins/modules/interfaces_file.py b/plugins/modules/interfaces_file.py index fe4223a12f..8e643fb797 100644 --- a/plugins/modules/interfaces_file.py +++ b/plugins/modules/interfaces_file.py @@ -13,11 +13,18 @@ DOCUMENTATION = ''' --- module: interfaces_file short_description: Tweak settings in /etc/network/interfaces files -extends_documentation_fragment: files +extends_documentation_fragment: + - ansible.builtin.files + - community.general.attributes description: - - Manage (add, remove, change) individual interface options in an interfaces-style file without having - to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). Interface has to be presented in a file. - - Read information about interfaces from interfaces-styled files + - Manage (add, remove, change) individual interface options in an interfaces-style file without having + to manage the file as a whole with, say, M(ansible.builtin.template) or M(ansible.builtin.assemble). Interface has to be presented in a file. + - Read information about interfaces from interfaces-styled files +attributes: + check_mode: + support: full + diff_mode: + support: none options: dest: type: path diff --git a/plugins/modules/java_cert.py b/plugins/modules/java_cert.py index 461f365a72..a188b16c38 100644 --- a/plugins/modules/java_cert.py +++ b/plugins/modules/java_cert.py @@ -16,6 +16,13 @@ short_description: Uses keytool to import/remove certificate to/from java keysto description: - This is a wrapper module around keytool, which can be used to import certificates and optionally private keys to a given java keystore, or remove them from it. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: full options: cert_url: description: diff --git a/plugins/modules/java_keystore.py b/plugins/modules/java_keystore.py index 2383c8cc48..7c2c4884dc 100644 --- a/plugins/modules/java_keystore.py +++ b/plugins/modules/java_keystore.py @@ -16,6 +16,11 @@ module: java_keystore short_description: Create a Java keystore in JKS format description: - Bundle a x509 certificate and its private key into a Java Keystore in JKS format. +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: description: @@ -124,7 +129,8 @@ author: - Guillaume Grossetie (@Mogztter) - quidame (@quidame) extends_documentation_fragment: - - files + - ansible.builtin.files + - community.general.attributes seealso: - module: community.crypto.openssl_pkcs12 - module: community.general.java_cert diff --git a/plugins/modules/kernel_blacklist.py b/plugins/modules/kernel_blacklist.py index c4352ac08a..1b40999cae 100644 --- a/plugins/modules/kernel_blacklist.py +++ b/plugins/modules/kernel_blacklist.py @@ -13,10 +13,17 @@ DOCUMENTATION = ''' --- module: kernel_blacklist author: -- Matthias Vogelgesang (@matze) + - Matthias Vogelgesang (@matze) short_description: Blacklist kernel modules description: - Add or remove kernel modules from blacklist. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: full options: name: type: str diff --git a/plugins/modules/keyring.py b/plugins/modules/keyring.py index 43dfb8c5dc..ada22ed581 100644 --- a/plugins/modules/keyring.py +++ b/plugins/modules/keyring.py @@ -26,6 +26,13 @@ requirements: - keyring (Python library) - gnome-keyring (application - required for headless Gnome keyring access) - dbus-run-session (application - required for headless Gnome keyring access) +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: service: description: The name of the service. diff --git a/plugins/modules/launchd.py b/plugins/modules/launchd.py index 250bbffb9e..13a8ce0862 100644 --- a/plugins/modules/launchd.py +++ b/plugins/modules/launchd.py @@ -12,11 +12,18 @@ DOCUMENTATION = r''' --- module: launchd author: -- Martin Migasiewicz (@martinm82) + - Martin Migasiewicz (@martinm82) short_description: Manage macOS services version_added: 1.0.0 description: -- Manage launchd services on target macOS hosts. + - Manage launchd services on target macOS hosts. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/locale_gen.py b/plugins/modules/locale_gen.py index 743570b7ab..fccdf977a4 100644 --- a/plugins/modules/locale_gen.py +++ b/plugins/modules/locale_gen.py @@ -13,21 +13,28 @@ DOCUMENTATION = ''' module: locale_gen short_description: Creates or removes locales description: - - Manages locales by editing /etc/locale.gen and invoking locale-gen. + - Manages locales by editing /etc/locale.gen and invoking locale-gen. author: -- Augustus Kling (@AugustusKling) + - Augustus Kling (@AugustusKling) +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: type: str description: - - Name and encoding of the locale, such as "en_GB.UTF-8". + - Name and encoding of the locale, such as "en_GB.UTF-8". required: true state: - type: str - description: - - Whether the locale shall be present. - choices: [ absent, present ] - default: present + type: str + description: + - Whether the locale shall be present. + choices: [ absent, present ] + default: present ''' EXAMPLES = ''' diff --git a/plugins/modules/make.py b/plugins/modules/make.py index 31da07c579..be2a32bd45 100644 --- a/plugins/modules/make.py +++ b/plugins/modules/make.py @@ -13,10 +13,17 @@ DOCUMENTATION = r''' module: make short_description: Run targets in a Makefile requirements: -- make + - make author: Linus Unnebäck (@LinusU) description: - Run targets in a Makefile. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: target: description: diff --git a/plugins/modules/mksysb.py b/plugins/modules/mksysb.py index 39f3e6a1c4..c43a268f33 100644 --- a/plugins/modules/mksysb.py +++ b/plugins/modules/mksysb.py @@ -17,6 +17,13 @@ module: mksysb short_description: Generates AIX mksysb rootvg backups description: - This module manages a basic AIX mksysb (image) of rootvg. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: backup_crypt_files: description: diff --git a/plugins/modules/modprobe.py b/plugins/modules/modprobe.py index df460e7161..e386117945 100644 --- a/plugins/modules/modprobe.py +++ b/plugins/modules/modprobe.py @@ -18,6 +18,13 @@ author: - Matt Jeffery (@mattjeffery) description: - Load or unload kernel modules. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: type: str diff --git a/plugins/modules/nmcli.py b/plugins/modules/nmcli.py index aa2ddafe1d..461bcc58f9 100644 --- a/plugins/modules/nmcli.py +++ b/plugins/modules/nmcli.py @@ -13,16 +13,23 @@ DOCUMENTATION = r''' --- module: nmcli author: -- Chris Long (@alcamie101) + - Chris Long (@alcamie101) short_description: Manage Networking requirements: -- nmcli + - nmcli +extends_documentation_fragment: + - community.general.attributes description: - 'Manage the network devices. Create, modify and manage various connection and device type e.g., ethernet, teams, bonds, vlans etc.' - 'On CentOS 8 and Fedora >=29 like systems, the requirements can be met by installing the following packages: NetworkManager.' - 'On CentOS 7 and Fedora <=28 like systems, the requirements can be met by installing the following packages: NetworkManager-tui.' - 'On Ubuntu and Debian like systems, the requirements can be met by installing the following packages: network-manager' - 'On openSUSE, the requirements can be met by installing the following packages: NetworkManager.' +attributes: + check_mode: + support: full + diff_mode: + support: full options: state: description: diff --git a/plugins/modules/osx_defaults.py b/plugins/modules/osx_defaults.py index f905493a31..480f40af56 100644 --- a/plugins/modules/osx_defaults.py +++ b/plugins/modules/osx_defaults.py @@ -22,6 +22,13 @@ description: - macOS applications and other programs use the defaults system to record user preferences and other information that must be maintained when the applications are not running (such as default font for new documents, or the position of an Info panel). +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: domain: description: diff --git a/plugins/modules/pam_limits.py b/plugins/modules/pam_limits.py index d80ba5ffbf..dbb70045df 100644 --- a/plugins/modules/pam_limits.py +++ b/plugins/modules/pam_limits.py @@ -18,6 +18,15 @@ description: - The C(pam_limits) module modifies PAM limits. - The default file is C(/etc/security/limits.conf). - For the full documentation, see C(man 5 limits.conf). +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + version_added: 2.0.0 + diff_mode: + support: full + version_added: 2.0.0 options: domain: type: str diff --git a/plugins/modules/pamd.py b/plugins/modules/pamd.py index 9b7ac77857..6ffc8624e9 100644 --- a/plugins/modules/pamd.py +++ b/plugins/modules/pamd.py @@ -20,6 +20,13 @@ description: module_path must match an existing rule. See man(5) pam.d for details. notes: - This module does not handle authselect profiles. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/read_csv.py b/plugins/modules/read_csv.py index 38c91ded07..f2a359fa7d 100644 --- a/plugins/modules/read_csv.py +++ b/plugins/modules/read_csv.py @@ -16,6 +16,13 @@ description: - Read a CSV file and return a list or a dictionary, containing one dictionary per row. author: - Dag Wieers (@dagwieers) +extends_documentation_fragment: +- community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: path: description: diff --git a/plugins/modules/sefcontext.py b/plugins/modules/sefcontext.py index 8183ed7d71..c2fee45ee2 100644 --- a/plugins/modules/sefcontext.py +++ b/plugins/modules/sefcontext.py @@ -13,8 +13,15 @@ DOCUMENTATION = r''' module: sefcontext short_description: Manages SELinux file context mapping definitions description: -- Manages SELinux file context mapping definitions. -- Similar to the C(semanage fcontext) command. + - Manages SELinux file context mapping definitions. + - Similar to the C(semanage fcontext) command. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: full options: target: description: diff --git a/plugins/modules/selinux_permissive.py b/plugins/modules/selinux_permissive.py index 3563775d14..7249a01b82 100644 --- a/plugins/modules/selinux_permissive.py +++ b/plugins/modules/selinux_permissive.py @@ -15,6 +15,13 @@ module: selinux_permissive short_description: Change permissive domain in SELinux policy description: - Add and remove a domain from the list of permissive domains. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: domain: description: diff --git a/plugins/modules/selogin.py b/plugins/modules/selogin.py index 59222e073a..57482b0908 100644 --- a/plugins/modules/selogin.py +++ b/plugins/modules/selogin.py @@ -13,7 +13,14 @@ DOCUMENTATION = ''' module: selogin short_description: Manages linux user to SELinux user mapping description: - - Manages linux user to SELinux user mapping + - Manages linux user to SELinux user mapping +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: login: type: str diff --git a/plugins/modules/seport.py b/plugins/modules/seport.py index b43b501058..964e8f0eda 100644 --- a/plugins/modules/seport.py +++ b/plugins/modules/seport.py @@ -14,6 +14,13 @@ module: seport short_description: Manages SELinux network port type definitions description: - Manages SELinux network port type definitions. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: ports: description: diff --git a/plugins/modules/ssh_config.py b/plugins/modules/ssh_config.py index f2fa8aa457..c69f95d22b 100644 --- a/plugins/modules/ssh_config.py +++ b/plugins/modules/ssh_config.py @@ -20,6 +20,13 @@ description: author: - Björn Andersson (@gaqzi) - Abhijeet Kasurde (@Akasurde) +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: state: description: @@ -95,8 +102,6 @@ options: version_added: 6.1.0 requirements: - StormSSH -notes: -- Supports check mode. ''' EXAMPLES = r''' diff --git a/plugins/modules/sudoers.py b/plugins/modules/sudoers.py index fd29b189f0..fd8289b1ca 100644 --- a/plugins/modules/sudoers.py +++ b/plugins/modules/sudoers.py @@ -19,6 +19,13 @@ description: - This module allows for the manipulation of sudoers files. author: - "Jon Ellis (@JonEllis) " +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: commands: description: diff --git a/plugins/modules/sysrc.py b/plugins/modules/sysrc.py index ccd5c2c545..9652b629ab 100644 --- a/plugins/modules/sysrc.py +++ b/plugins/modules/sysrc.py @@ -18,6 +18,13 @@ short_description: Manage FreeBSD using sysrc version_added: '2.0.0' description: - Manages C(/etc/rc.conf) for FreeBSD. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/timezone.py b/plugins/modules/timezone.py index 20404d3a79..05849e4bb1 100644 --- a/plugins/modules/timezone.py +++ b/plugins/modules/timezone.py @@ -26,6 +26,13 @@ description: - As of Ansible 2.4 support was added for macOS. - As of Ansible 2.9 support was added for AIX 6.1+ - Windows and HPUX are not supported, please let us know if you find any other OS/distro in which this fails. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: full options: name: description: diff --git a/plugins/modules/ufw.py b/plugins/modules/ufw.py index 6d18f3f781..45c98fd639 100644 --- a/plugins/modules/ufw.py +++ b/plugins/modules/ufw.py @@ -25,6 +25,13 @@ notes: - See C(man ufw) for more examples. requirements: - C(ufw) package +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: state: description: diff --git a/plugins/modules/xattr.py b/plugins/modules/xattr.py index 9cc74a1382..0b44fdaadf 100644 --- a/plugins/modules/xattr.py +++ b/plugins/modules/xattr.py @@ -16,6 +16,13 @@ description: - Manages filesystem user defined extended attributes. - Requires that extended attributes are enabled on the target filesystem and that the setfattr/getfattr utilities are present. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: path: description: diff --git a/plugins/modules/xfconf.py b/plugins/modules/xfconf.py index 0fff6f0d14..680c814e16 100644 --- a/plugins/modules/xfconf.py +++ b/plugins/modules/xfconf.py @@ -26,6 +26,15 @@ seealso: description: XFCE documentation for the Xfconf configuration system. link: 'https://docs.xfce.org/xfce/xfconf/start' +extends_documentation_fragment: + - community.general.attributes + +attributes: + check_mode: + support: full + diff_mode: + support: full + options: channel: description: diff --git a/plugins/modules/xml.py b/plugins/modules/xml.py index 9f16ee1344..5b9bba355c 100644 --- a/plugins/modules/xml.py +++ b/plugins/modules/xml.py @@ -16,7 +16,14 @@ DOCUMENTATION = r''' module: xml short_description: Manage bits and pieces of XML files or strings description: -- A CRUD-like interface to managing bits of XML files. + - A CRUD-like interface to managing bits of XML files. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: full options: path: description: