Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr*: style adjustments #9524

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/modules/pacemaker_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
type: str
node:
description:
- Specify which node of the cluster you want to manage. V(null) == the cluster status itself, V(all) == check the status of all nodes.
- Specify which node of the cluster you want to manage. V(null) == the cluster status itself, V(all) == check the status
of all nodes.
type: str
timeout:
description:
Expand Down
11 changes: 7 additions & 4 deletions plugins/modules/packet_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@
state:
description:
- Desired state of the device.
- If set to V(present) (the default), the module call will return immediately after the device-creating HTTP request successfully returns.
- If set to V(active), the module call will block until all the specified devices are in state active due to the Packet API, or until O(wait_timeout).
- If set to V(present) (the default), the module call will return immediately after the device-creating HTTP request
successfully returns.
- If set to V(active), the module call will block until all the specified devices are in state active due to the Packet
API, or until O(wait_timeout).
choices: [present, absent, active, inactive, rebooted]
default: present
type: str
Expand All @@ -133,7 +135,8 @@
wait_timeout:
description:
- How long (seconds) to wait either for automatic IP address assignment, or for the device to reach the V(active) state.
- If O(wait_for_public_IPv) is set and O(state=active), the module will wait for both events consequently, applying the timeout twice.
- If O(wait_for_public_IPv) is set and O(state=active), the module will wait for both events consequently, applying
the timeout twice.
default: 900
type: int

Expand Down Expand Up @@ -262,7 +265,7 @@
returned: success

devices:
description: Information about each device that was processed
description: Information about each device that was processed.
type: list
sample:
- {
Expand Down
7 changes: 4 additions & 3 deletions plugins/modules/packet_ip_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@
state:
description:
- Desired state of the IP subnet on the specified device.
- With O(state=present), you must specify either O(hostname) or O(device_id). Subnet with given CIDR will then be assigned to the specified
device.
- With O(state=absent), you can specify either O(hostname) or O(device_id). The subnet will be removed from specified devices.
- With O(state=present), you must specify either O(hostname) or O(device_id). Subnet with given CIDR will then be assigned
to the specified device.
- With O(state=absent), you can specify either O(hostname) or O(device_id). The subnet will be removed from specified
devices.
- If you leave both O(hostname) and O(device_id) empty, the subnet will be removed from any device it is assigned to.
choices: ['present', 'absent']
default: 'present'
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/packet_volume_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
description:
- Attach/detach a volume to a device in the Packet host.
- API is documented at U(https://www.packet.com/developers/api/volumes/).
- This module creates the attachment route in the Packet API. In order to discover the block devices on the server, you have to run the Attach
Scripts, as documented at U(https://help.packet.net/technical/storage/packet-block-storage-linux).
- This module creates the attachment route in the Packet API. In order to discover the block devices on the server, you
have to run the Attach Scripts, as documented at U(https://help.packet.net/technical/storage/packet-block-storage-linux).
version_added: '0.2.0'

author:
Expand Down
34 changes: 19 additions & 15 deletions plugins/modules/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
options:
name:
description:
- Name or list of names of the package(s) or file(s) to install, upgrade, or remove. Cannot be used in combination with O(upgrade).
- Name or list of names of the package(s) or file(s) to install, upgrade, or remove. Cannot be used in combination with
O(upgrade).
aliases: [package, pkg]
type: list
elements: str
Expand All @@ -50,7 +51,8 @@
force:
description:
- When removing packages, forcefully remove them, without any checks. Same as O(extra_args="--nodeps --nodeps").
- When combined with O(update_cache), force a refresh of all package databases. Same as O(update_cache_extra_args="--refresh --refresh").
- When combined with O(update_cache), force a refresh of all package databases. Same as O(update_cache_extra_args="--refresh
--refresh").
default: false
type: bool

Expand All @@ -64,8 +66,8 @@
executable:
description:
- Path of the binary to use. This can either be C(pacman) or a pacman compatible AUR helper.
- Pacman compatibility is unfortunately ill defined, in particular, this modules makes extensive use of the C(--print-format) directive
which is known not to be implemented by some AUR helpers (notably, C(yay)).
- Pacman compatibility is unfortunately ill defined, in particular, this modules makes extensive use of the C(--print-format)
directive which is known not to be implemented by some AUR helpers (notably, C(yay)).
- Beware that AUR helpers might behave unexpectedly and are therefore not recommended.
default: pacman
type: str
Expand All @@ -82,8 +84,8 @@
- Whether or not to refresh the master package lists.
- This can be run as part of a package installation or as a separate step.
- If not specified, it defaults to V(false).
- Please note that this option only had an influence on the module's C(changed) state if O(name) and O(upgrade) are not specified before
community.general 5.0.0. See the examples for how to keep the old behavior.
- Please note that this option only had an influence on the module's C(changed) state if O(name) and O(upgrade) are
not specified before community.general 5.0.0. See the examples for how to keep the old behavior.
type: bool

update_cache_extra_args:
Expand Down Expand Up @@ -114,27 +116,29 @@
reason_for:
description:
- Set the install reason for V(all) packages or only for V(new) packages.
- In case of O(state=latest) already installed packages which will be updated to a newer version are not counted as V(new).
- In case of O(state=latest) already installed packages which will be updated to a newer version are not counted as
V(new).
default: new
choices: [all, new]
type: str
version_added: 5.4.0

notes:
- 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.
- To use an AUR helper (O(executable) option), a few extra setup steps might be required beforehand. For example, a dedicated build user with
permissions to install packages could be necessary.
- 'In the tests, while using C(yay) as the O(executable) option, the module failed to install AUR packages with the error: C(error: target not
found: <pkg>).'
- 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.
- To use an AUR helper (O(executable) option), a few extra setup steps might be required beforehand. For example, a dedicated
build user with permissions to install packages could be necessary.
- 'In the tests, while using C(yay) as the O(executable) option, the module failed to install AUR packages with the error:
C(error: target not found: <pkg>).'
"""

RETURN = r"""
packages:
description:
- A list of packages that have been changed.
- Before community.general 4.5.0 this was only returned when O(upgrade=true). In community.general 4.5.0, it was sometimes omitted when the
package list is empty, but since community.general 4.6.0 it is always returned when O(name) is specified or O(upgrade=true).
- Before community.general 4.5.0 this was only returned when O(upgrade=true). In community.general 4.5.0, it was sometimes
omitted when the package list is empty, but since community.general 4.6.0 it is always returned when O(name) is specified
or O(upgrade=true).
returned: success and O(name) is specified or O(upgrade=true)
type: list
elements: str
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/pagerduty.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
default: Created by Ansible
validate_certs:
description:
- If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
- If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using
self-signed certificates.
type: bool
default: true
"""
Expand Down
20 changes: 11 additions & 9 deletions plugins/modules/pagerduty_alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@
desc:
type: str
description:
- For O(state=triggered) - Required. Short description of the problem that led to this trigger. This field (or a truncated version) will
be used when generating phone calls, SMS messages and alert emails. It will also appear on the incidents tables in the PagerDuty UI. The
maximum length is 1024 characters.
- For O(state=acknowledged) or O(state=resolved) - Text that will appear in the incident's log associated with this event.
- For O(state=triggered) - Required. Short description of the problem that led to this trigger. This field (or a truncated
version) will be used when generating phone calls, SMS messages and alert emails. It will also appear on the incidents
tables in the PagerDuty UI. The maximum length is 1024 characters.
- For O(state=acknowledged) or O(state=resolved) - Text that will appear in the incident's log associated with this
event.
required: false
default: Created via Ansible
incident_class:
Expand All @@ -111,11 +112,12 @@
type: str
description:
- Identifies the incident to which this O(state) should be applied.
- For O(state=triggered) - If there is no open (in other words unresolved) incident with this key, a new one will be created. If there is already an
open incident with a matching key, this event will be appended to that incident's log. The event key provides an easy way to 'de-dup'
problem reports. If no O(incident_key) is provided, then it will be generated by PagerDuty.
- For O(state=acknowledged) or O(state=resolved) - This should be the incident_key you received back when the incident was first opened
by a trigger event. Acknowledge events referencing resolved or nonexistent incidents will be discarded.
- For O(state=triggered) - If there is no open (in other words unresolved) incident with this key, a new one will be
created. If there is already an open incident with a matching key, this event will be appended to that incident's
log. The event key provides an easy way to 'de-dup' problem reports. If no O(incident_key) is provided, then it will
be generated by PagerDuty.
- For O(state=acknowledged) or O(state=resolved) - This should be the incident_key you received back when the incident
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- For O(state=acknowledged) or O(state=resolved) - This should be the incident_key you received back when the incident
- For O(state=acknowledged) or O(state=resolved) - This should be the RV(ignore:incident_key) you received back when the incident

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that would make sense, but the RETURN values are not documented. @ApsOps @xshen1 could you please confirm? TIA

was first opened by a trigger event. Acknowledge events referencing resolved or nonexistent incidents will be discarded.
required: false
link_url:
type: str
Expand Down
7 changes: 4 additions & 3 deletions plugins/modules/pagerduty_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
options:
integration_key:
description:
- The integration key that identifies the service the change was made to. This can be found by adding an integration to a service in PagerDuty.
- The integration key that identifies the service the change was made to. This can be found by adding an integration
to a service in PagerDuty.
required: true
type: str
summary:
Expand Down Expand Up @@ -81,8 +82,8 @@
type: str
validate_certs:
description:
- If V(false), SSL certificates for the target URL will not be validated. This should only be used on personally controlled sites using
self-signed certificates.
- If V(false), SSL certificates for the target URL will not be validated. This should only be used on personally controlled
sites using self-signed certificates.
required: false
default: true
type: bool
Expand Down
9 changes: 6 additions & 3 deletions plugins/modules/pam_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,24 @@
required: true
backup:
description:
- Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
- Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered
it incorrectly.
required: false
type: bool
default: false
use_min:
description:
- If set to V(true), the minimal value will be used or conserved.
- If the specified value is inferior to the value in the file, file content is replaced with the new value, else content is not modified.
- If the specified value is inferior to the value in the file, file content is replaced with the new value, else content
is not modified.
required: false
type: bool
default: false
use_max:
description:
- If set to V(true), the maximal value will be used or conserved.
- If the specified value is superior to the value in the file, file content is replaced with the new value, else content is not modified.
- If the specified value is superior to the value in the file, file content is replaced with the new value, else content
is not modified.
required: false
type: bool
default: false
Expand Down
15 changes: 7 additions & 8 deletions plugins/modules/pamd.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
short_description: Manage PAM Modules
description:
- Edit PAM service's type, control, module path and module arguments.
- In order for a PAM rule to be modified, the type, control and module_path must match an existing rule. See man(5) pam.d for details.
- In order for a PAM rule to be modified, the type, control and 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:
Expand Down Expand Up @@ -70,7 +71,8 @@
- When O(state=updated), the O(module_arguments) will replace existing module_arguments.
- When O(state=args_absent) args matching those listed in O(module_arguments) will be removed.
- When O(state=args_present) any args listed in O(module_arguments) are added if missing from the existing rule.
- Furthermore, if the module argument takes a value denoted by C(=), the value will be changed to that specified in module_arguments.
- Furthermore, if the module argument takes a value denoted by C(=), the value will be changed to that specified in
module_arguments.
type: list
elements: str
state:
Expand All @@ -91,7 +93,8 @@
default: /etc/pam.d
backup:
description:
- Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
- Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered
it incorrectly.
type: bool
default: false
"""
Expand Down Expand Up @@ -151,11 +154,7 @@
type: auth
control: required
module_path: pam_faillock.so
module_arguments: 'preauth
silent
deny=3
unlock_time=604800
fail_interval=900'
module_arguments: 'preauth silent deny=3 unlock_time=604800 fail_interval=900'
state: updated

- name: Remove specific arguments from a rule
Expand Down
37 changes: 21 additions & 16 deletions plugins/modules/parted.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
module: parted
short_description: Configure block device partitions
description:
- This module allows configuring block device partition using the C(parted) command line tool. For a full description of the fields and the
options check the GNU parted manual.
- This module allows configuring block device partition using the C(parted) command line tool. For a full description of
the fields and the options check the GNU parted manual.
requirements:
- This module requires C(parted) version 1.8.3 and above.
- Option O(align) (except V(undefined)) requires C(parted) 2.1 or above.
Expand All @@ -33,7 +33,8 @@
device:
description:
- The block device (disk) where to operate.
- Regular files can also be partitioned, but it is recommended to create a loopback device using C(losetup) to easily access its partitions.
- Regular files can also be partitioned, but it is recommended to create a loopback device using C(losetup) to easily
access its partitions.
type: str
required: true
align:
Expand All @@ -49,16 +50,17 @@
type: int
unit:
description:
- Selects the current default unit that Parted will use to display locations and capacities on the disk and to interpret those given by
the user if they are not suffixed by an unit.
- Selects the current default unit that Parted will use to display locations and capacities on the disk and to interpret
those given by the user if they are not suffixed by an unit.
- When fetching information about a disk, it is recommended to always specify a unit.
type: str
choices: [s, B, KB, KiB, MB, MiB, GB, GiB, TB, TiB, '%', cyl, chs, compact]
default: KiB
label:
description:
- Disk label type or partition table to use.
- If O(device) already contains a different label, it will be changed to O(label) and any previous partitions will be lost.
- If O(device) already contains a different label, it will be changed to O(label) and any previous partitions will be
lost.
- A O(name) must be specified for a V(gpt) partition table.
type: str
choices: [aix, amiga, bsd, dvh, gpt, loop, mac, msdos, pc98, sun]
Expand All @@ -72,17 +74,19 @@
default: primary
part_start:
description:
- Where the partition will start as offset from the beginning of the disk, that is, the "distance" from the start of the disk. Negative
numbers specify distance from the end of the disk.
- The distance can be specified with all the units supported by parted (except compat) and it is case sensitive, for example V(10GiB), V(15%).
- Where the partition will start as offset from the beginning of the disk, that is, the "distance" from the start of
the disk. Negative numbers specify distance from the end of the disk.
- The distance can be specified with all the units supported by parted (except compat) and it is case sensitive, for
example V(10GiB), V(15%).
- Using negative values may require setting of O(fs_type) (see notes).
type: str
default: 0%
part_end:
description:
- Where the partition will end as offset from the beginning of the disk, that is, the "distance" from the start of the disk. Negative numbers
specify distance from the end of the disk.
- The distance can be specified with all the units supported by parted (except compat) and it is case sensitive, for example V(10GiB), V(15%).
- Where the partition will end as offset from the beginning of the disk, that is, the "distance" from the start of the
disk. Negative numbers specify distance from the end of the disk.
- The distance can be specified with all the units supported by parted (except compat) and it is case sensitive, for
example V(10GiB), V(15%).
type: str
default: 100%
name:
Expand Down Expand Up @@ -114,10 +118,11 @@
version_added: '1.3.0'

notes:
- When fetching information about a new disk and when the version of parted installed on the system is before version 3.1, the module queries
the kernel through C(/sys/) to obtain disk information. In this case the units CHS and CYL are not supported.
- Negative O(part_start) start values were rejected if O(fs_type) was not given. This bug was fixed in parted 3.2.153. If you want to use negative
O(part_start), specify O(fs_type) as well or make sure your system contains newer parted.
- When fetching information about a new disk and when the version of parted installed on the system is before version 3.1,
the module queries the kernel through C(/sys/) to obtain disk information. In this case the units CHS and CYL are not
supported.
- Negative O(part_start) start values were rejected if O(fs_type) was not given. This bug was fixed in parted 3.2.153. If
you want to use negative O(part_start), specify O(fs_type) as well or make sure your system contains newer parted.
"""

RETURN = r"""
Expand Down
Loading
Loading