From a60fb178b1c91699945225ba990a738225f13d05 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Mon, 22 Jul 2024 03:31:19 +1200 Subject: [PATCH] docs adjustments (batch 1) (#83341) --- lib/ansible/modules/add_host.py | 2 +- lib/ansible/modules/apt.py | 48 +++++++++++++-------------- lib/ansible/modules/apt_key.py | 10 +++--- lib/ansible/modules/apt_repository.py | 12 +++---- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/ansible/modules/add_host.py b/lib/ansible/modules/add_host.py index de3c8619135..81930eab7d7 100644 --- a/lib/ansible/modules/add_host.py +++ b/lib/ansible/modules/add_host.py @@ -61,7 +61,7 @@ notes: - The alias O(host) of the parameter O(name) is only available on Ansible 2.4 and newer. - Since Ansible 2.4, the C(inventory_dir) variable is now set to V(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. -- 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. +- Though this module does not change the remote host, we do provide C(changed) status as it can be useful for those trying to track inventory changes. - The hosts added will not bypass the C(--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. seealso: diff --git a/lib/ansible/modules/apt.py b/lib/ansible/modules/apt.py index 858711e3a8f..0b496dfb89b 100644 --- a/lib/ansible/modules/apt.py +++ b/lib/ansible/modules/apt.py @@ -63,21 +63,20 @@ options: default: 'no' default_release: description: - - Corresponds to the C(-t) option for I(apt) and sets pin priorities + - Corresponds to the C(-t) option for I(apt) and sets pin priorities. aliases: [ default-release ] type: str install_recommends: description: - - Corresponds to the C(--no-install-recommends) option for I(apt). V(true) installs recommended packages. V(false) does not install + - Corresponds to the C(--no-install-recommends) option for C(apt). V(true) installs recommended packages. V(false) does not install recommended packages. By default, Ansible will use the same defaults as the operating system. Suggested packages are never installed. aliases: [ install-recommends ] type: bool force: description: - - 'Corresponds to the C(--force-yes) to I(apt-get) and implies O(allow_unauthenticated=yes) and O(allow_downgrade=yes)' - - "This option will disable checking both the packages' signatures and the certificates of the - web servers they are downloaded from." - - 'This option *is not* the equivalent of passing the C(-f) flag to I(apt-get) on the command line' + - 'Corresponds to the C(--force-yes) to C(apt-get) and implies O(allow_unauthenticated=yes) and O(allow_downgrade=yes).' + - "This option will disable checking both the packages' signatures and the certificates of the web servers they are downloaded from." + - 'This option *is not* the equivalent of passing the C(-f) flag to C(apt-get) on the command line.' - '**This is a destructive operation with the potential to destroy your system, and it should almost never be used.** Please also see C(man apt-get) for more information.' type: bool @@ -85,7 +84,7 @@ options: clean: description: - Run the equivalent of C(apt-get clean) to clear out the local repository of retrieved package files. It removes everything but - the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. + the lock file from C(/var/cache/apt/archives/) and C(/var/cache/apt/archives/partial/). - Can be run as part of the package installation (clean runs before install) or as a separate step. type: bool default: 'no' @@ -93,7 +92,7 @@ options: allow_unauthenticated: description: - Ignore if packages cannot be authenticated. This is useful for bootstrapping environments that manage their own apt-key setup. - - 'O(allow_unauthenticated) is only supported with O(state): V(install)/V(present)' + - 'O(allow_unauthenticated) is only supported with O(state): V(install)/V(present).' aliases: [ allow-unauthenticated ] type: bool default: 'no' @@ -111,7 +110,7 @@ options: version_added: "2.12" allow_change_held_packages: description: - - Allows changing the version of a package which is on the apt hold list + - Allows changing the version of a package which is on the apt hold list. type: bool default: 'no' version_added: '2.13' @@ -128,14 +127,14 @@ options: type: str dpkg_options: description: - - Add dpkg options to apt command. Defaults to '-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"' - - Options should be supplied as comma separated list + - Add C(dpkg) options to C(apt) command. Defaults to C(-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"). + - Options should be supplied as comma separated list. default: force-confdef,force-confold type: str deb: description: - Path to a .deb package on the remote machine. - - If :// in the path, ansible will attempt to download deb before installing. (Version added 2.1) + - If C(://) in the path, ansible will attempt to download deb before installing. (Version added 2.1) - Requires the C(xz-utils) package to extract the control file of the deb package to install. type: path required: false @@ -143,7 +142,8 @@ options: autoremove: description: - If V(true), remove unused dependency packages for all module states except V(build-dep). It can also be used as the only option. - - Previous to version 2.4, autoclean was also an alias for autoremove, now it is its own separate command. See documentation for further information. + - Previous to version 2.4, O(autoclean) was also an alias for O(autoremove), now it is its own separate command. + See documentation for further information. type: bool default: 'no' version_added: "2.1" @@ -155,10 +155,10 @@ options: version_added: "2.4" policy_rc_d: description: - - Force the exit code of /usr/sbin/policy-rc.d. - - For example, if I(policy_rc_d=101) the installed package will not trigger a service start. - - If /usr/sbin/policy-rc.d already exists, it is backed up and restored after the package installation. - - If V(null), the /usr/sbin/policy-rc.d isn't created/changed. + - Force the exit code of C(/usr/sbin/policy-rc.d). + - For example, if O(policy_rc_d=101) the installed package will not trigger a service start. + - If C(/usr/sbin/policy-rc.d) already exists, it is backed up and restored after the package installation. + - If V(null), the C(/usr/sbin/policy-rc.d) is not created/changed. type: int default: null version_added: "2.8" @@ -179,7 +179,7 @@ options: version_added: "2.11" force_apt_get: description: - - Force usage of apt-get instead of aptitude + - Force usage of apt-get instead of aptitude. type: bool default: 'no' version_added: "2.4" @@ -205,22 +205,22 @@ attributes: platforms: debian notes: - Three of the upgrade modes (V(full), V(safe) and its alias V(true)) 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. + - In most cases, packages installed with I(apt) will start newly installed services by default. Most distributions have mechanisms to avoid this. For example when installing Postgresql-9.5 in Debian 9, creating an executable shell script (/usr/sbin/policy-rc.d) that throws - a return code of 101 will stop Postgresql 9.5 starting up after install. Remove the file or its execute permission afterward. - - The apt-get commandline supports implicit regex matches here but we do not because it can let typos through easier + a return code of 101 will stop Postgresql 9.5 starting up after install. Remove the file or its execute permission afterward. + - The C(apt-get) commandline supports implicit regex matches here but we do not because it can let typos through easier (If you typo C(foo) as C(fo) apt-get would install packages that have "fo" in their name with a warning and a prompt for the user. - Since we don't have warnings and prompts before installing, we disallow this.Use an explicit fnmatch pattern if you want wildcarding) + Since there are no warnings and prompts before installing, we disallow this. Use an explicit fnmatch pattern if you want wildcarding). - When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the O(name) option. - When O(default_release) is used, an implicit priority of 990 is used. This is the same behavior as C(apt-get -t). - When an exact version is specified, an implicit priority of 1001 is used. - - If the interpreter can't import ``python-apt``/``python3-apt`` the module will check for it in system-owned interpreters as well. + - If the interpreter can't import C(python-apt)/C(python3-apt) the module will check for it in system-owned interpreters as well. If the dependency can't be found, the module will attempt to install it. If the dependency is found or installed, the module will be respawned under the correct interpreter. ''' EXAMPLES = ''' -- name: Install apache httpd (state=present is optional) +- name: Install apache httpd (state=present is optional) ansible.builtin.apt: name: apache2 state: present diff --git a/lib/ansible/modules/apt_key.py b/lib/ansible/modules/apt_key.py index 669bad20c6f..1ea4a6a02c4 100644 --- a/lib/ansible/modules/apt_key.py +++ b/lib/ansible/modules/apt_key.py @@ -26,13 +26,13 @@ attributes: platform: platforms: debian notes: - - The apt-key command used by this module has been deprecated. See the L(Debian wiki,https://wiki.debian.org/DebianRepository/UseThirdParty) for details. - This module is kept for backwards compatibility for systems that still use apt-key as the main way to manage apt repository keys. + - The C(apt-key) command used by this module has been deprecated. See the L(Debian wiki,https://wiki.debian.org/DebianRepository/UseThirdParty) for details. + This module is kept for backwards compatibility for systems that still use C(apt-key) as the main way to manage apt repository keys. - As a sanity check, downloaded key id must match the one specified. - "Use full fingerprint (40 characters) key ids to avoid key collisions. 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 O(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). + - If you specify both the key O(id) and the O(url) with O(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 C(update_cache) option). requirements: - gpg seealso: @@ -42,7 +42,7 @@ options: description: - The identifier of the key. - Including this allows check mode to correctly report the changed state. - - If specifying a subkey's id be aware that apt-key does not understand how to remove keys via a subkey id. Specify the primary key's id instead. + - If specifying a subkey's id be aware that apt-key does not understand how to remove keys via a subkey id. Specify the primary key's id instead. - This parameter is required when O(state) is set to V(absent). type: str data: diff --git a/lib/ansible/modules/apt_repository.py b/lib/ansible/modules/apt_repository.py index aa50c54c17f..774f57378f2 100644 --- a/lib/ansible/modules/apt_repository.py +++ b/lib/ansible/modules/apt_repository.py @@ -41,13 +41,13 @@ options: default: "present" mode: description: - - The octal mode for newly created files in sources.list.d. + - The octal mode for newly created files in C(sources.list.d). - Default is what system uses (probably 0644). type: raw version_added: "1.6" update_cache: description: - - Run the equivalent of C(apt-get update) when a change occurs. Cache updates are run after making changes. + - Run the equivalent of C(apt-get update) when a change occurs. Cache updates are run after making changes. type: bool default: "yes" aliases: [ update-cache ] @@ -72,9 +72,9 @@ options: version_added: '1.8' filename: description: - - Sets the name of the source list file in sources.list.d. + - Sets the name of the source list file in C(sources.list.d). Defaults to a file name based on the repository source url. - The .list extension will be automatically added. + The C(.list) extension will be automatically added. type: str version_added: '2.1' codename: @@ -90,8 +90,8 @@ options: Without this library, the module does not work. - Runs C(apt-get install python-apt) for Python 2, and C(apt-get install python3-apt) for Python 3. - Only works with the system Python 2 or Python 3. If you are using a Python on the remote that is not - the system Python, set O(install_python_apt=false) and ensure that the Python apt library - for your Python version is installed some other way. + the system Python, set O(install_python_apt=false) and ensure that the Python apt library + for your Python version is installed some other way. type: bool default: true author: