Skip to content

Commit

Permalink
[PR #9423/0afd3386 backport][stable-9] [m-z]*.py: normalize doc_fragm…
Browse files Browse the repository at this point in the history
…ents (#9429)

[m-z]*.py: normalize doc_fragments (#9423)

(cherry picked from commit 0afd338)

Co-authored-by: Alexei Znamensky <[email protected]>
  • Loading branch information
patchback[bot] and russoz authored Dec 27, 2024
1 parent 4dd7628 commit 0bc4970
Show file tree
Hide file tree
Showing 22 changed files with 395 additions and 436 deletions.
29 changes: 15 additions & 14 deletions plugins/doc_fragments/onepassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class ModuleDocFragment(object):
DOCUMENTATION = r'''
DOCUMENTATION = r"""
requirements:
- See U(https://support.1password.com/command-line/)
options:
Expand All @@ -18,7 +18,8 @@ class ModuleDocFragment(object):
aliases: ['vault_password']
type: str
section:
description: Item section containing the field to retrieve (case-insensitive). If absent will return first match from any section.
description: Item section containing the field to retrieve (case-insensitive). If absent will return first match from
any section.
domain:
description: Domain of 1Password.
default: '1password.com'
Expand Down Expand Up @@ -55,25 +56,25 @@ class ModuleDocFragment(object):
env:
- name: OP_CONNECT_TOKEN
version_added: 8.1.0
'''
"""

LOOKUP = r'''
LOOKUP = r"""
options:
service_account_token:
env:
- name: OP_SERVICE_ACCOUNT_TOKEN
version_added: 8.2.0
notes:
- This lookup will use an existing 1Password session if one exists. If not, and you have already
performed an initial sign in (meaning C(~/.op/config), C(~/.config/op/config) or C(~/.config/.op/config) exists), then only the
O(master_password) is required. You may optionally specify O(subdomain) in this scenario, otherwise the last used subdomain will be used by C(op).
- This lookup will use an existing 1Password session if one exists. If not, and you have already performed an initial sign
in (meaning C(~/.op/config), C(~/.config/op/config) or C(~/.config/.op/config) exists), then only the O(master_password)
is required. You may optionally specify O(subdomain) in this scenario, otherwise the last used subdomain will be used
by C(op).
- This lookup can perform an initial login by providing O(subdomain), O(username), O(secret_key), and O(master_password).
- Can target a specific account by providing the O(account_id).
- Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal credentials
needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or greater in strength
to the 1Password master password.
- This lookup stores potentially sensitive data from 1Password as Ansible facts.
Facts are subject to caching if enabled, which means this data could be stored in clear text
on disk or in a database.
- Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal
credentials needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or
greater in strength to the 1Password master password.
- This lookup stores potentially sensitive data from 1Password as Ansible facts. Facts are subject to caching if enabled,
which means this data could be stored in clear text on disk or in a database.
- Tested with C(op) version 2.7.2.
'''
"""
111 changes: 54 additions & 57 deletions plugins/doc_fragments/oneview.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,67 @@
class ModuleDocFragment(object):

# OneView doc fragment
DOCUMENTATION = r'''
DOCUMENTATION = r"""
options:
config:
description:
- Path to a JSON configuration file containing the OneView client configuration.
The configuration file is optional and when used should be present in the host running the ansible commands.
If the file path is not provided, the configuration will be loaded from environment variables.
For links to example configuration files or how to use the environment variables verify the notes section.
type: path
api_version:
description:
- OneView API Version.
type: int
image_streamer_hostname:
description:
- IP address or hostname for the HPE Image Streamer REST API.
type: str
hostname:
description:
- IP address or hostname for the appliance.
type: str
username:
description:
- Username for API authentication.
type: str
password:
description:
- Password for API authentication.
type: str
config:
description:
- Path to a JSON configuration file containing the OneView client configuration. The configuration file is optional
and when used should be present in the host running the ansible commands. If the file path is not provided, the configuration
will be loaded from environment variables. For links to example configuration files or how to use the environment
variables verify the notes section.
type: path
api_version:
description:
- OneView API Version.
type: int
image_streamer_hostname:
description:
- IP address or hostname for the HPE Image Streamer REST API.
type: str
hostname:
description:
- IP address or hostname for the appliance.
type: str
username:
description:
- Username for API authentication.
type: str
password:
description:
- Password for API authentication.
type: str
requirements:
- Python >= 2.7.9
notes:
- "A sample configuration file for the config parameter can be found at:
U(https://github.com/HewlettPackard/oneview-ansible/blob/master/examples/oneview_config-rename.json)"
- "Check how to use environment variables for configuration at:
U(https://github.com/HewlettPackard/oneview-ansible#environment-variables)"
- "Additional Playbooks for the HPE OneView Ansible modules can be found at:
U(https://github.com/HewlettPackard/oneview-ansible/tree/master/examples)"
- "The OneView API version used will directly affect returned and expected fields in resources.
Information on setting the desired API version and can be found at:
U(https://github.com/HewlettPackard/oneview-ansible#setting-your-oneview-version)"
'''
- 'A sample configuration file for the config parameter can be found at:
U(https://github.com/HewlettPackard/oneview-ansible/blob/master/examples/oneview_config-rename.json).'
- 'Check how to use environment variables for configuration at: U(https://github.com/HewlettPackard/oneview-ansible#environment-variables).'
- 'Additional Playbooks for the HPE OneView Ansible modules can be found at: U(https://github.com/HewlettPackard/oneview-ansible/tree/master/examples).'
- 'The OneView API version used will directly affect returned and expected fields in resources. Information on setting the
desired API version and can be found at: U(https://github.com/HewlettPackard/oneview-ansible#setting-your-oneview-version).'
"""

VALIDATEETAG = r'''
VALIDATEETAG = r"""
options:
validate_etag:
description:
- When the ETag Validation is enabled, the request will be conditionally processed only if the current ETag
for the resource matches the ETag provided in the data.
type: bool
default: true
'''
validate_etag:
description:
- When the ETag Validation is enabled, the request will be conditionally processed only if the current ETag for the
resource matches the ETag provided in the data.
type: bool
default: true
"""

FACTSPARAMS = r'''
FACTSPARAMS = r"""
options:
params:
description:
- List of parameters to delimit, filter and sort the list of resources.
- "Parameter keys allowed are:"
- "C(start): The first item to return, using 0-based indexing."
- "C(count): The number of resources to return."
- "C(filter): A general filter/query string to narrow the list of items returned."
- "C(sort): The sort order of the returned data set."
type: dict
'''
params:
description:
- List of parameters to delimit, filter and sort the list of resources.
- 'Parameter keys allowed are:'
- 'V(start): The first item to return, using 0-based indexing.'
- 'V(count): The number of resources to return.'
- 'V(filter): A general filter/query string to narrow the list of items returned.'
- 'V(sort): The sort order of the returned data set.'
type: dict
"""
16 changes: 7 additions & 9 deletions plugins/doc_fragments/online.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,34 @@
class ModuleDocFragment(object):

# Standard documentation fragment
DOCUMENTATION = r'''
DOCUMENTATION = r"""
options:
api_token:
description:
- Online OAuth token.
type: str
required: true
aliases: [ oauth_token ]
aliases: [oauth_token]
api_url:
description:
- Online API URL.
type: str
default: 'https://api.online.net'
aliases: [ base_url ]
aliases: [base_url]
api_timeout:
description:
- HTTP timeout to Online API in seconds.
type: int
default: 30
aliases: [ timeout ]
aliases: [timeout]
validate_certs:
description:
- Validate SSL certs of the Online API.
type: bool
default: true
notes:
- Also see the API documentation on U(https://console.online.net/en/api/).
- If O(api_token) is not set within the module, the following
environment variables can be used in decreasing order of precedence
- If O(api_token) is not set within the module, the following environment variables can be used in decreasing order of precedence
E(ONLINE_TOKEN), E(ONLINE_API_KEY), E(ONLINE_OAUTH_TOKEN), E(ONLINE_API_TOKEN).
- If one wants to use a different O(api_url) one can also set the E(ONLINE_API_URL)
environment variable.
'''
- If one wants to use a different O(api_url) one can also set the E(ONLINE_API_URL) environment variable.
"""
64 changes: 32 additions & 32 deletions plugins/doc_fragments/opennebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@

class ModuleDocFragment(object):
# OpenNebula common documentation
DOCUMENTATION = r'''
DOCUMENTATION = r"""
options:
api_url:
description:
- The ENDPOINT URL of the XMLRPC server.
- If not specified then the value of the E(ONE_URL) environment variable, if any, is used.
type: str
aliases:
- api_endpoint
api_username:
description:
- The name of the user for XMLRPC authentication.
- If not specified then the value of the E(ONE_USERNAME) environment variable, if any, is used.
type: str
api_password:
description:
- The password or token for XMLRPC authentication.
- If not specified then the value of the E(ONE_PASSWORD) environment variable, if any, is used.
type: str
aliases:
- api_token
validate_certs:
description:
- Whether to validate the TLS/SSL certificates or not.
- This parameter is ignored if E(PYTHONHTTPSVERIFY) environment variable is used.
type: bool
default: true
wait_timeout:
description:
- Time to wait for the desired state to be reached before timeout, in seconds.
type: int
default: 300
'''
api_url:
description:
- The ENDPOINT URL of the XMLRPC server.
- If not specified then the value of the E(ONE_URL) environment variable, if any, is used.
type: str
aliases:
- api_endpoint
api_username:
description:
- The name of the user for XMLRPC authentication.
- If not specified then the value of the E(ONE_USERNAME) environment variable, if any, is used.
type: str
api_password:
description:
- The password or token for XMLRPC authentication.
- If not specified then the value of the E(ONE_PASSWORD) environment variable, if any, is used.
type: str
aliases:
- api_token
validate_certs:
description:
- Whether to validate the TLS/SSL certificates or not.
- This parameter is ignored if E(PYTHONHTTPSVERIFY) environment variable is used.
type: bool
default: true
wait_timeout:
description:
- Time to wait for the desired state to be reached before timeout, in seconds.
type: int
default: 300
"""
65 changes: 26 additions & 39 deletions plugins/doc_fragments/openswitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,75 +11,62 @@
class ModuleDocFragment(object):

# Standard files documentation fragment
DOCUMENTATION = r'''
DOCUMENTATION = r"""
options:
host:
description:
- Specifies the DNS host name or address for connecting to the remote
device over the specified transport. The value of host is used as
the destination address for the transport. Note this argument
does not affect the SSH argument.
- Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value
of host is used as the destination address for the transport. Note this argument does not affect the SSH argument.
type: str
port:
description:
- Specifies the port to use when building the connection to the remote
device. This value applies to either O(transport=cli) or O(transport=rest). The port
value will default to the appropriate transport common port if
none is provided in the task. (cli=22, http=80, https=443). Note
this argument does not affect the SSH transport.
- Specifies the port to use when building the connection to the remote device. This value applies to either O(transport=cli)
or O(transport=rest). The port value will default to the appropriate transport common port if none is provided in
the task. (cli=22, http=80, https=443). Note this argument does not affect the SSH transport.
type: int
default: 0 (use common port)
username:
description:
- Configures the username to use to authenticate the connection to
the remote device. This value is used to authenticate
either the CLI login or the eAPI authentication depending on which
transport is used. Note this argument does not affect the SSH
transport. If the value is not specified in the task, the value of
environment variable E(ANSIBLE_NET_USERNAME) will be used instead.
- Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate
either the CLI login or the eAPI authentication depending on which transport is used. Note this argument does not
affect the SSH transport. If the value is not specified in the task, the value of environment variable E(ANSIBLE_NET_USERNAME)
will be used instead.
type: str
password:
description:
- Specifies the password to use to authenticate the connection to
the remote device. This is a common argument used for either O(transport=cli)
or O(transport=rest). Note this argument does not affect the SSH
transport. If the value is not specified in the task, the value of
environment variable E(ANSIBLE_NET_PASSWORD) will be used instead.
- Specifies the password to use to authenticate the connection to the remote device. This is a common argument used
for either O(transport=cli) or O(transport=rest). Note this argument does not affect the SSH transport. If the value
is not specified in the task, the value of environment variable E(ANSIBLE_NET_PASSWORD) will be used instead.
type: str
timeout:
description:
- Specifies the timeout in seconds for communicating with the network device
for either connecting or sending commands. If the timeout is
exceeded before the operation is completed, the module will error.
- Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands.
If the timeout is exceeded before the operation is completed, the module will error.
type: int
default: 10
ssh_keyfile:
description:
- Specifies the SSH key to use to authenticate the connection to
the remote device. This argument is only used for O(transport=cli).
If the value is not specified in the task, the value of
environment variable E(ANSIBLE_NET_SSH_KEYFILE) will be used instead.
- Specifies the SSH key to use to authenticate the connection to the remote device. This argument is only used for O(transport=cli).
If the value is not specified in the task, the value of environment variable E(ANSIBLE_NET_SSH_KEYFILE) will be used
instead.
type: path
transport:
description:
- Configures the transport connection to use when connecting to the
remote device. The transport argument supports connectivity to the
device over SSH (V(ssh)), CLI (V(cli)), or REST (V(rest)).
- Configures the transport connection to use when connecting to the remote device. The transport argument supports connectivity
to the device over SSH (V(ssh)), CLI (V(cli)), or REST (V(rest)).
required: true
type: str
choices: [ cli, rest, ssh ]
choices: [cli, rest, ssh]
default: ssh
use_ssl:
description:
- Configures the O(transport) to use SSL if set to V(true) only when the
O(transport) argument is configured as rest. If the transport
argument is not V(rest), this value is ignored.
- Configures the O(transport) to use SSL if set to V(true) only when the O(transport) argument is configured as rest.
If the transport argument is not V(rest), this value is ignored.
type: bool
default: true
provider:
description:
- Convenience method that allows all C(openswitch) arguments to be passed as
a dict object. All constraints (required, choices, etc) must be
met either by individual arguments or values in this dict.
- Convenience method that allows all C(openswitch) arguments to be passed as a dict object. All constraints (required,
choices, and so on) must be met either by individual arguments or values in this dict.
type: dict
'''
"""
Loading

0 comments on commit 0bc4970

Please sign in to comment.