Skip to content

Commit

Permalink
lmn*: style adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
russoz committed Jan 4, 2025
1 parent 103b331 commit 2d5bd08
Show file tree
Hide file tree
Showing 43 changed files with 443 additions and 380 deletions.
11 changes: 6 additions & 5 deletions plugins/modules/launchd.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
state:
description:
- V(started)/V(stopped) are idempotent actions that will not run commands unless necessary.
- Launchd does not support V(restarted) nor V(reloaded) natively. These will trigger a stop/start (restarted) or an unload/load (reloaded).
- Launchd does not support V(restarted) nor V(reloaded) natively. These will trigger a stop/start (restarted) or an
unload/load (reloaded).
- V(restarted) unloads and loads the service before start to ensure that the latest job definition (plist) is used.
- V(reloaded) unloads and loads the service to ensure that the latest job definition (plist) is used. Whether a service is started or stopped
depends on the content of the definition file.
- V(reloaded) unloads and loads the service to ensure that the latest job definition (plist) is used. Whether a service
is started or stopped depends on the content of the definition file.
type: str
choices: [reloaded, restarted, started, stopped, unloaded]
enabled:
Expand All @@ -52,8 +53,8 @@
force_stop:
description:
- Whether the service should not be restarted automatically by launchd.
- Services might have the 'KeepAlive' attribute set to true in a launchd configuration. In case this is set to true, stopping a service
will cause that launchd starts the service again.
- Services might have the 'KeepAlive' attribute set to true in a launchd configuration. In case this is set to true,
stopping a service will cause that launchd starts the service again.
- Set this option to V(true) to let this module change the C(KeepAlive) attribute to V(false).
type: bool
default: false
Expand Down
15 changes: 8 additions & 7 deletions plugins/modules/layman.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
author: "Jakub Jirutka (@jirutka)"
short_description: Manage Gentoo overlays
description:
- Uses Layman to manage an additional repositories for the Portage package manager on Gentoo Linux. Please note that Layman must be installed
on a managed node prior using this module.
- Uses Layman to manage an additional repositories for the Portage package manager on Gentoo Linux. Please note that Layman
must be installed on a managed node prior using this module.
requirements:
- layman python module
extends_documentation_fragment:
Expand All @@ -29,13 +29,14 @@
options:
name:
description:
- The overlay id to install, synchronize, or uninstall. Use V(ALL) to sync all of the installed overlays (can be used only when O(state=updated)).
- The overlay ID to install, synchronize, or uninstall. Use V(ALL) to sync all of the installed overlays (can be used
only when O(state=updated)).
required: true
type: str
list_url:
description:
- An URL of the alternative overlays list that defines the overlay to install. This list will be fetched and saved under C(${overlay_defs}/${name}.xml),
where C(overlay_defs) is read from the Layman's configuration.
- An URL of the alternative overlays list that defines the overlay to install. This list will be fetched and saved under
C(${overlay_defs}/${name}.xml), where C(overlay_defs) is read from the Layman's configuration.
aliases: [url]
type: str
state:
Expand All @@ -46,8 +47,8 @@
type: str
validate_certs:
description:
- If V(false), SSL certificates will not be validated. This should only be set to V(false) when no other option exists. Prior to 1.9.3 the
code defaulted to V(false).
- If V(false), SSL certificates will not be validated. This should only be set to V(false) when no other option exists.
Prior to 1.9.3 the code defaulted to V(false).
type: bool
default: true
"""
Expand Down
26 changes: 14 additions & 12 deletions plugins/modules/ldap_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
- Add or remove multiple LDAP attribute values.
notes:
- This only deals with attributes on existing entries. To add or remove whole entries, see M(community.general.ldap_entry).
- For O(state=present) and O(state=absent), all value comparisons are performed on the server for maximum accuracy. For O(state=exact), values
have to be compared in Python, which obviously ignores LDAP matching rules. This should work out in most cases, but it is theoretically possible
to see spurious changes when target and actual values are semantically identical but lexically distinct.
- For O(state=present) and O(state=absent), all value comparisons are performed on the server for maximum accuracy. For
O(state=exact), values have to be compared in Python, which obviously ignores LDAP matching rules. This should work out
in most cases, but it is theoretically possible to see spurious changes when target and actual values are semantically
identical but lexically distinct.
version_added: '0.2.0'
author:
- Jiri Tyr (@jtyr)
Expand All @@ -42,26 +43,27 @@
choices: [present, absent, exact]
default: present
description:
- The state of the attribute values. If V(present), all given attribute values will be added if they are missing. If V(absent), all given
attribute values will be removed if present. If V(exact), the set of attribute values will be forced to exactly those provided and no
others. If O(state=exact) and the attribute value is empty, all values for this attribute will be removed.
- The state of the attribute values. If V(present), all given attribute values will be added if they are missing. If
V(absent), all given attribute values will be removed if present. If V(exact), the set of attribute values will be
forced to exactly those provided and no others. If O(state=exact) and the attribute value is empty, all values for
this attribute will be removed.
attributes:
required: true
type: dict
description:
- The attribute(s) and value(s) to add or remove.
- Each attribute value can be a string for single-valued attributes or a list of strings for multi-valued attributes.
- If you specify values for this option in YAML, please note that you can improve readability for long string values by using YAML block
modifiers as seen in the examples for this module.
- Note that when using values that YAML/ansible-core interprets as other types, like V(yes), V(no) (booleans), or V(2.10) (float), make
sure to quote them if these are meant to be strings. Otherwise the wrong values may be sent to LDAP.
- If you specify values for this option in YAML, please note that you can improve readability for long string values
by using YAML block modifiers as seen in the examples for this module.
- Note that when using values that YAML/ansible-core interprets as other types, like V(yes), V(no) (booleans), or V(2.10)
(float), make sure to quote them if these are meant to be strings. Otherwise the wrong values may be sent to LDAP.
ordered:
required: false
type: bool
default: false
description:
- If V(true), prepend list values with X-ORDERED index numbers in all attributes specified in the current task. This is useful mostly with
C(olcAccess) attribute to easily manage LDAP Access Control Lists.
- If V(true), prepend list values with X-ORDERED index numbers in all attributes specified in the current task. This
is useful mostly with C(olcAccess) attribute to easily manage LDAP Access Control Lists.
extends_documentation_fragment:
- community.general.ldap.documentation
- community.general.attributes
Expand Down
19 changes: 10 additions & 9 deletions plugins/modules/ldap_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
module: ldap_entry
short_description: Add or remove LDAP entries
description:
- Add or remove LDAP entries. This module only asserts the existence or non-existence of an LDAP entry, not its attributes. To assert the attribute
values of an entry, see M(community.general.ldap_attrs).
- Add or remove LDAP entries. This module only asserts the existence or non-existence of an LDAP entry, not its attributes.
To assert the attribute values of an entry, see M(community.general.ldap_attrs).
author:
- Jiri Tyr (@jtyr)
requirements:
Expand All @@ -29,18 +29,19 @@
options:
attributes:
description:
- If O(state=present), attributes necessary to create an entry. Existing entries are never modified. To assert specific attribute values
on an existing entry, use M(community.general.ldap_attrs) module instead.
- If O(state=present), attributes necessary to create an entry. Existing entries are never modified. To assert specific
attribute values on an existing entry, use M(community.general.ldap_attrs) module instead.
- Each attribute value can be a string for single-valued attributes or a list of strings for multi-valued attributes.
- If you specify values for this option in YAML, please note that you can improve readability for long string values by using YAML block
modifiers as seen in the examples for this module.
- Note that when using values that YAML/ansible-core interprets as other types, like V(yes), V(no) (booleans), or V(2.10) (float), make
sure to quote them if these are meant to be strings. Otherwise the wrong values may be sent to LDAP.
- If you specify values for this option in YAML, please note that you can improve readability for long string values
by using YAML block modifiers as seen in the examples for this module.
- Note that when using values that YAML/ansible-core interprets as other types, like V(yes), V(no) (booleans), or V(2.10)
(float), make sure to quote them if these are meant to be strings. Otherwise the wrong values may be sent to LDAP.
type: dict
default: {}
objectClass:
description:
- If O(state=present), value or list of values to use when creating the entry. It can either be a string or an actual list of strings.
- If O(state=present), value or list of values to use when creating the entry. It can either be a string or an actual
list of strings.
type: list
elements: str
state:
Expand Down
33 changes: 14 additions & 19 deletions plugins/modules/ldap_inc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,21 @@
__metaclass__ = type


DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ldap_inc
short_description: Use the Modify-Increment LDAP V3 feature to increment an attribute value
version_added: 10.2.0
description:
- Atomically increments the value of an attribute and return its new value.
notes:
- When implemented by the directory server, the module uses the ModifyIncrement extension
defined in L(RFC4525, https://www.rfc-editor.org/rfc/rfc4525.html) and the control PostRead. This extension and the control are
implemented in OpenLdap but not all directory servers implement them. In this case, the
module automatically uses a more classic method based on two phases, first the current
value is read then the modify operation remove the old value and add the new one in a
single request. If the value has changed by a concurrent call then the remove action will
fail. Then the sequence is retried 3 times before raising an error to the playbook. In an
heavy modification environment, the module does not guarante to be systematically successful.
- This only deals with integer attribute of an existing entry. To modify attributes
of an entry, see M(community.general.ldap_attrs) or to add or remove whole entries,
see M(community.general.ldap_entry).
- When implemented by the directory server, the module uses the ModifyIncrement extension defined in L(RFC4525, https://www.rfc-editor.org/rfc/rfc4525.html)
and the control PostRead. This extension and the control are implemented in OpenLdap but not all directory servers implement
them. In this case, the module automatically uses a more classic method based on two phases, first the current value is
read then the modify operation remove the old value and add the new one in a single request. If the value has changed
by a concurrent call then the remove action will fail. Then the sequence is retried 3 times before raising an error to
the playbook. In an heavy modification environment, the module does not guarante to be systematically successful.
- This only deals with integer attribute of an existing entry. To modify attributes of an entry, see M(community.general.ldap_attrs)
or to add or remove whole entries, see M(community.general.ldap_entry).
author:
- Philippe Duveau (@pduveau)
requirements:
Expand Down Expand Up @@ -71,11 +67,10 @@
extends_documentation_fragment:
- community.general.ldap.documentation
- community.general.attributes
"""

'''


EXAMPLES = r'''
EXAMPLES = r"""
- name: Increments uidNumber 1 Number for example.com
community.general.ldap_inc:
dn: "cn=uidNext,ou=unix-management,dc=example,dc=com"
Expand All @@ -90,10 +85,10 @@
attributes:
- uidNumber: "{{ ldap_uidNumber_sequence.value }}"
when: ldap_uidNumber_sequence.incremented
'''
"""


RETURN = r'''
RETURN = r"""
incremented:
description:
- It is set to V(true) if the attribute value has changed.
Expand Down Expand Up @@ -121,7 +116,7 @@
returned: success
type: bool
sample: true
'''
"""

from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils.common.text.converters import to_native, to_bytes
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/ldap_passwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
module: ldap_passwd
short_description: Set passwords in LDAP
description:
- Set a password for an LDAP entry. This module only asserts that a given password is valid for a given entry. To assert the existence of an
entry, see M(community.general.ldap_entry).
- Set a password for an LDAP entry. This module only asserts that a given password is valid for a given entry. To assert
the existence of an entry, see M(community.general.ldap_entry).
author:
- Keller Fuchs (@KellerFuchs)
requirements:
Expand Down
23 changes: 11 additions & 12 deletions plugins/modules/ldap_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,22 @@
default: false
type: bool
description:
- Set to V(true) to return the full attribute schema of entries, not their attribute values. Overrides O(attrs) when provided.
- Set to V(true) to return the full attribute schema of entries, not their attribute values. Overrides O(attrs) when
provided.
page_size:
default: 0
type: int
description:
- The page size when performing a simple paged result search (RFC 2696). This setting can be tuned to reduce issues with timeouts and server
limits.
- The page size when performing a simple paged result search (RFC 2696). This setting can be tuned to reduce issues
with timeouts and server limits.
- Setting the page size to V(0) (default) disables paged searching.
version_added: 7.1.0
base64_attributes:
description:
- If provided, all attribute values returned that are listed in this option will be Base64 encoded.
- If the special value V(*) appears in this list, all attributes will be Base64 encoded.
- All other attribute values will be converted to UTF-8 strings. If they contain binary data, please note that invalid UTF-8 bytes will
be omitted.
- All other attribute values will be converted to UTF-8 strings. If they contain binary data, please note that invalid
UTF-8 bytes will be omitted.
type: list
elements: str
version_added: 7.0.0
Expand All @@ -90,17 +91,15 @@
register: ldap_group_gids
"""

RESULTS = """
RESULTS = r"""
results:
description:
- For every entry found, one dictionary will be returned.
- Every dictionary contains a key C(dn) with the entry's DN as a value.
- Every attribute of the entry found is added to the dictionary. If the key
has precisely one value, that value is taken directly, otherwise the key's
value is a list.
- Note that all values (for single-element lists) and list elements (for multi-valued
lists) will be UTF-8 strings. Some might contain Base64-encoded binary data; which
ones is determined by the O(base64_attributes) option.
- Every attribute of the entry found is added to the dictionary. If the key has precisely one value, that value is taken
directly, otherwise the key's value is a list.
- Note that all values (for single-element lists) and list elements (for multi-valued lists) will be UTF-8 strings. Some
might contain Base64-encoded binary data; which ones is determined by the O(base64_attributes) option.
type: list
elements: dict
"""
Expand Down
9 changes: 6 additions & 3 deletions plugins/modules/librato_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
module: librato_annotation
short_description: Create an annotation in Librato
description:
- Create an annotation event on the given annotation stream :name. If the annotation stream does not exist, it will be created automatically.
- Create an annotation event on the given annotation stream :name. If the annotation stream does not exist, it will be created
automatically.
author: "Seth Edwards (@Sedward)"
requirements: []
extends_documentation_fragment:
Expand Down Expand Up @@ -49,13 +50,15 @@
source:
type: str
description:
- A string which describes the originating source of an annotation when that annotation is tracked across multiple members of a population.
- A string which describes the originating source of an annotation when that annotation is tracked across multiple members
of a population.
required: false
description:
type: str
description:
- The description contains extra metadata about a particular annotation.
- The description should contain specifics on the individual annotation for example V(Deployed 9b562b2 shipped new feature foo!).
- The description should contain specifics on the individual annotation for example V(Deployed 9b562b2 shipped new feature
foo!).
required: false
start_time:
type: int
Expand Down
5 changes: 3 additions & 2 deletions plugins/modules/linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
default: ''
linode_id:
description:
- Unique ID of a linode server. This value is read-only in the sense that if you specify it on creation of a Linode it will not be used.
The Linode API generates these IDs and we can those generated value here to reference a Linode more specifically. This is useful for idempotence.
- Unique ID of a linode server. This value is read-only in the sense that if you specify it on creation of a Linode
it will not be used. The Linode API generates these IDs and we can those generated value here to reference a Linode
more specifically. This is useful for idempotence.
aliases: [lid]
type: int
additional_disks:
Expand Down
Loading

0 comments on commit 2d5bd08

Please sign in to comment.