s[o-y]*: normalize docs (#9351)

* s[o-y]*: normalize docs

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/spectrum_model_attrs.py

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/9363/head
Alexei Znamensky 2024-12-25 21:48:22 +13:00 committed by GitHub
parent 6cd3f79e19
commit 4b23e5ecff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 994 additions and 1174 deletions

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: solaris_zone
short_description: Manage Solaris zones
description:
@ -31,16 +30,15 @@ options:
description:
- V(present), configure and install the zone.
- V(installed), synonym for V(present).
- V(running), if the zone already exists, boot it, otherwise, configure and install
the zone first, then boot it.
- V(running), if the zone already exists, boot it, otherwise, configure and install the zone first, then boot it.
- V(started), synonym for V(running).
- V(stopped), shutdown a zone.
- V(absent), destroy the zone.
- V(configured), configure the ready so that it's to be attached.
- V(attached), attach a zone, but do not boot it.
- V(detached), shutdown and detach a zone
- V(detached), shutdown and detach a zone.
type: str
choices: [ absent, attached, configured, detached, installed, present, running, started, stopped ]
choices: [absent, attached, configured, detached, installed, present, running, started, stopped]
default: present
name:
description:
@ -53,8 +51,7 @@ options:
required: true
path:
description:
- The path where the zone will be created. This is required when the zone is created, but not
used otherwise.
- The path where the zone will be created. This is required when the zone is created, but not used otherwise.
type: str
sparse:
description:
@ -63,32 +60,29 @@ options:
default: false
root_password:
description:
- The password hash for the root account. If not specified, the zone's root account
will not have a password.
- The password hash for the root account. If not specified, the zone's root account will not have a password.
type: str
config:
description:
- 'The zonecfg configuration commands for this zone. See zonecfg(1M) for the valid options
and syntax. Typically this is a list of options separated by semi-colons or new lines, e.g.
"set auto-boot=true;add net;set physical=bge0;set address=10.1.1.1;end"'
- The C(zonecfg) configuration commands for this zone. See zonecfg(1M) for the valid options and syntax. Typically this is a list of options
separated by semi-colons or new lines, for example V(set auto-boot=true;add net;set physical=bge0;set address=10.1.1.1;end).
type: str
default: ''
create_options:
description:
- 'Extra options to the zonecfg(1M) create command.'
- Extra options to the zonecfg(1M) create command.
type: str
default: ''
install_options:
description:
- 'Extra options to the zoneadm(1M) install command. To automate Solaris 11 zone creation,
use this to specify the profile XML file, e.g. install_options="-c sc_profile.xml"'
- Extra options to the zoneadm(1M) install command. To automate Solaris 11 zone creation, use this to specify the profile XML file, for example
O(install_options=-c sc_profile.xml).
type: str
default: ''
attach_options:
description:
- 'Extra options to the zoneadm attach command. For example, this can be used to specify
whether a minimum or full update of packages is required and if any packages need to
be deleted. For valid values, see zoneadm(1M)'
- Extra options to the zoneadm attach command. For example, this can be used to specify whether a minimum or full update of packages is
required and if any packages need to be deleted. For valid values, see zoneadm(1M).
type: str
default: ''
timeout:
@ -96,9 +90,9 @@ options:
- Timeout, in seconds, for zone to boot.
type: int
default: 600
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create and install a zone, but don't boot it
community.general.solaris_zone:
name: zone1
@ -149,7 +143,7 @@ EXAMPLES = '''
name: zone1
state: attached
attach_options: -u
'''
"""
import os
import platform

View File

@ -10,93 +10,86 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: sorcery
short_description: Package manager for Source Mage GNU/Linux
description:
- Manages "spells" on Source Mage GNU/Linux using I(sorcery) toolchain
- Manages "spells" on Source Mage GNU/Linux using I(sorcery) toolchain.
author: "Vlad Glagolev (@vaygr)"
notes:
- When all three components are selected, the update goes by the sequence --
Sorcery -> Grimoire(s) -> Spell(s); you cannot override it.
- Grimoire handling is supported since community.general 7.3.0.
- When all three components are selected, the update goes by the sequence -- Sorcery -> Grimoire(s) -> Spell(s); you cannot override it.
- Grimoire handling is supported since community.general 7.3.0.
requirements:
- bash
- bash
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
- Name of the spell or grimoire.
- Multiple names can be given, separated by commas.
- Special value V(*) in conjunction with states V(latest) or
V(rebuild) will update or rebuild the whole system respectively
- The alias O(grimoire) was added in community.general 7.3.0.
aliases: ["spell", "grimoire"]
type: list
elements: str
name:
description:
- Name of the spell or grimoire.
- Multiple names can be given, separated by commas.
- Special value V(*) in conjunction with states V(latest) or V(rebuild) will update or rebuild the whole system respectively.
- The alias O(grimoire) was added in community.general 7.3.0.
aliases: ["spell", "grimoire"]
type: list
elements: str
repository:
description:
- Repository location.
- If specified, O(name) represents grimoire(s) instead of spell(s).
- Special value V(*) will pull grimoire from the official location.
- Only single item in O(name) in conjunction with V(*) can be used.
- O(state=absent) must be used with a special value V(*).
type: str
version_added: 7.3.0
repository:
description:
- Repository location.
- If specified, O(name) represents grimoire(s) instead of spell(s).
- Special value V(*) will pull grimoire from the official location.
- Only single item in O(name) in conjunction with V(*) can be used.
- O(state=absent) must be used with a special value V(*).
type: str
version_added: 7.3.0
state:
description:
- Whether to cast, dispel or rebuild a package.
- State V(cast) is an equivalent of V(present), not V(latest).
- State V(rebuild) implies cast of all specified spells, not only
those existed before.
choices: ["present", "latest", "absent", "cast", "dispelled", "rebuild"]
default: "present"
type: str
state:
description:
- Whether to cast, dispel or rebuild a package.
- State V(cast) is an equivalent of V(present), not V(latest).
- State V(rebuild) implies cast of all specified spells, not only those existed before.
choices: ["present", "latest", "absent", "cast", "dispelled", "rebuild"]
default: "present"
type: str
depends:
description:
- Comma-separated list of _optional_ dependencies to build a spell
(or make sure it is built) with; use V(+)/V(-) in front of dependency
to turn it on/off (V(+) is optional though).
- This option is ignored if O(name) parameter is equal to V(*) or
contains more than one spell.
- Providers must be supplied in the form recognized by Sorcery,
for example 'V(openssl(SSL\))'.
type: str
depends:
description:
- Comma-separated list of _optional_ dependencies to build a spell (or make sure it is built) with; use V(+)/V(-) in front of dependency
to turn it on/off (V(+) is optional though).
- This option is ignored if O(name) parameter is equal to V(*) or contains more than one spell.
- Providers must be supplied in the form recognized by Sorcery, for example 'V(openssl(SSL\))'.
type: str
update:
description:
- Whether or not to update sorcery scripts at the very first stage.
type: bool
default: false
update:
description:
- Whether or not to update sorcery scripts at the very first stage.
type: bool
default: false
update_cache:
description:
- Whether or not to update grimoire collection before casting spells.
type: bool
default: false
aliases: ["update_codex"]
update_cache:
description:
- Whether or not to update grimoire collection before casting spells.
type: bool
default: false
aliases: ["update_codex"]
cache_valid_time:
description:
- Time in seconds to invalidate grimoire collection on update.
- Especially useful for SCM and rsync grimoires.
- Makes sense only in pair with O(update_cache).
type: int
default: 0
'''
cache_valid_time:
description:
- Time in seconds to invalidate grimoire collection on update.
- Especially useful for SCM and rsync grimoires.
- Makes sense only in pair with O(update_cache).
type: int
default: 0
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Make sure spell foo is installed
community.general.sorcery:
spell: foo
@ -131,9 +124,9 @@ EXAMPLES = '''
depends: "{{ item.depends | default(None) }}"
state: present
loop:
- { spell: 'vifm', depends: '+file,-gtk+2' }
- { spell: 'fwknop', depends: 'gpgme' }
- { spell: 'pv,tnftp,tor' }
- {spell: 'vifm', depends: '+file,-gtk+2'}
- {spell: 'fwknop', depends: 'gpgme'}
- {spell: 'pv,tnftp,tor'}
- name: Install the latest version of spell foo using regular glossary
community.general.sorcery:
@ -184,11 +177,11 @@ EXAMPLES = '''
- name: Update only Sorcery itself
community.general.sorcery:
update: true
'''
"""
RETURN = '''
'''
RETURN = r"""
"""
import datetime

View File

@ -9,88 +9,86 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: spectrum_device
short_description: Creates/deletes devices in CA Spectrum
description:
- This module allows you to create and delete devices in CA Spectrum U(https://www.ca.com/us/products/ca-spectrum.html).
- Tested on CA Spectrum 9.4.2, 10.1.1 and 10.2.1
- This module allows you to create and delete devices in CA Spectrum U(https://www.ca.com/us/products/ca-spectrum.html).
- Tested on CA Spectrum 9.4.2, 10.1.1 and 10.2.1.
author: "Renato Orgito (@orgito)"
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
device:
type: str
aliases: [ host, name ]
required: true
description:
- IP address of the device.
- If a hostname is given, it will be resolved to the IP address.
community:
type: str
description:
- SNMP community used for device discovery.
- Required when O(state=present).
required: true
landscape:
type: str
required: true
description:
- Landscape handle of the SpectroServer to which add or remove the device.
state:
type: str
description:
- On V(present) creates the device when it does not exist.
- On V(absent) removes the device when it exists.
choices: ['present', 'absent']
default: 'present'
url:
type: str
aliases: [ oneclick_url ]
required: true
description:
- HTTP, HTTPS URL of the Oneclick server in the form V((http|https\)://host.domain[:port]).
url_username:
type: str
aliases: [ oneclick_user ]
required: true
description:
- Oneclick user name.
url_password:
type: str
aliases: [ oneclick_password ]
required: true
description:
- Oneclick user password.
use_proxy:
description:
- if V(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
default: true
type: bool
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.
default: true
type: bool
agentport:
type: int
required: false
description:
- UDP port used for SNMP discovery.
default: 161
device:
type: str
aliases: [host, name]
required: true
description:
- IP address of the device.
- If a hostname is given, it will be resolved to the IP address.
community:
type: str
description:
- SNMP community used for device discovery.
- Required when O(state=present).
required: true
landscape:
type: str
required: true
description:
- Landscape handle of the SpectroServer to which add or remove the device.
state:
type: str
description:
- On V(present) creates the device when it does not exist.
- On V(absent) removes the device when it exists.
choices: ['present', 'absent']
default: 'present'
url:
type: str
aliases: [oneclick_url]
required: true
description:
- HTTP, HTTPS URL of the Oneclick server in the form V((http|https\)://host.domain[:port]).
url_username:
type: str
aliases: [oneclick_user]
required: true
description:
- Oneclick user name.
url_password:
type: str
aliases: [oneclick_password]
required: true
description:
- Oneclick user password.
use_proxy:
description:
- If V(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
default: true
type: bool
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.
default: true
type: bool
agentport:
type: int
required: false
description:
- UDP port used for SNMP discovery.
default: 161
notes:
- The devices will be created inside the I(Universe) container of the specified landscape.
- All the operations will be performed only on the specified landscape.
'''
- The devices will be created inside the I(Universe) container of the specified landscape.
- All the operations will be performed only on the specified landscape.
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Add device to CA Spectrum
local_action:
module: spectrum_device
@ -113,15 +111,15 @@ EXAMPLES = '''
oneclick_password: password
use_proxy: false
state: absent
'''
"""
RETURN = '''
RETURN = r"""
device:
description: device data when state = present
description: Device data when O(state=present).
returned: success
type: dict
sample: {'model_handle': '0x1007ab', 'landscape': '0x100000', 'address': '10.10.5.1'}
'''
"""
from socket import gethostbyname, gaierror
import xml.etree.ElementTree as ET

View File

@ -9,110 +9,108 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: spectrum_model_attrs
short_description: Enforce a model's attributes in CA Spectrum
description:
- This module can be used to enforce a model's attributes in CA Spectrum.
- This module can be used to enforce a model's attributes in CA Spectrum.
version_added: 2.5.0
author:
- Tyler Gates (@tgates81)
- Tyler Gates (@tgates81)
notes:
- Tested on CA Spectrum version 10.4.2.0.189.
- Model creation and deletion are not possible with this module. For that use M(community.general.spectrum_device) instead.
- Tested on CA Spectrum version 10.4.2.0.189.
- Model creation and deletion are not possible with this module. For that use M(community.general.spectrum_device) instead.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
url:
description:
- URL of OneClick server.
type: str
required: true
url_username:
description:
- OneClick username.
type: str
required: true
aliases: [username]
url_password:
description:
- OneClick password.
type: str
required: true
aliases: [password]
use_proxy:
description:
- if V(false), it will not use a proxy, even if one is defined in
an environment variable on the target hosts.
default: true
required: false
type: bool
name:
description:
- Model name.
type: str
required: true
type:
description:
- Model type.
type: str
required: true
validate_certs:
description:
- Validate SSL certificates. Only change this to V(false) if you can guarantee that you are talking to the correct endpoint and there is no
man-in-the-middle attack happening.
type: bool
default: true
required: false
attributes:
description:
- A list of attribute names and values to enforce.
- All values and parameters are case sensitive and must be provided as strings only.
required: true
type: list
elements: dict
suboptions:
name:
description:
- Attribute name OR hex ID.
- 'Currently defined names are:'
- ' C(App_Manufacturer) (C(0x230683))'
- ' C(CollectionsModelNameString) (C(0x12adb))'
- ' C(Condition) (C(0x1000a))'
- ' C(Criticality) (C(0x1290c))'
- ' C(DeviceType) (C(0x23000e))'
- ' C(isManaged) (C(0x1295d))'
- ' C(Model_Class) (C(0x11ee8))'
- ' C(Model_Handle) (C(0x129fa))'
- ' C(Model_Name) (C(0x1006e))'
- ' C(Modeltype_Handle) (C(0x10001))'
- ' C(Modeltype_Name) (C(0x10000))'
- ' C(Network_Address) (C(0x12d7f))'
- ' C(Notes) (C(0x11564))'
- ' C(ServiceDesk_Asset_ID) (C(0x12db9))'
- ' C(TopologyModelNameString) (C(0x129e7))'
- ' C(sysDescr) (C(0x10052))'
- ' C(sysName) (C(0x10b5b))'
- ' C(Vendor_Name) (C(0x11570))'
- ' C(Description) (C(0x230017))'
- Hex IDs are the direct identifiers in Spectrum and will always work.
- 'To lookup hex IDs go to the UI: Locator -> Devices -> By Model Name -> <enter any model> -> Attributes tab.'
type: str
required: true
value:
description:
- Attribute value. Empty strings should be V("") or V(null).
type: str
required: true
'''
url:
description:
- URL of OneClick server.
type: str
required: true
url_username:
description:
- OneClick username.
type: str
required: true
aliases: [username]
url_password:
description:
- OneClick password.
type: str
required: true
aliases: [password]
use_proxy:
description:
- If V(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
default: true
required: false
type: bool
name:
description:
- Model name.
type: str
required: true
type:
description:
- Model type.
type: str
required: true
validate_certs:
description:
- Validate SSL certificates. Only change this to V(false) if you can guarantee that you are talking to the correct endpoint and there is
no man-in-the-middle attack happening.
type: bool
default: true
required: false
attributes:
description:
- A list of attribute names and values to enforce.
- All values and parameters are case sensitive and must be provided as strings only.
required: true
type: list
elements: dict
suboptions:
name:
description:
- Attribute name OR hex ID.
- 'Currently defined names are:'
- C(App_Manufacturer) (C(0x230683));
- C(CollectionsModelNameString) (C(0x12adb));
- C(Condition) (C(0x1000a));
- C(Criticality) (C(0x1290c));
- C(DeviceType) (C(0x23000e));
- C(isManaged) (C(0x1295d));
- C(Model_Class) (C(0x11ee8));
- C(Model_Handle) (C(0x129fa));
- C(Model_Name) (C(0x1006e));
- C(Modeltype_Handle) (C(0x10001));
- C(Modeltype_Name) (C(0x10000));
- C(Network_Address) (C(0x12d7f));
- C(Notes) (C(0x11564));
- C(ServiceDesk_Asset_ID) (C(0x12db9));
- C(TopologyModelNameString) (C(0x129e7));
- C(sysDescr) (C(0x10052));
- C(sysName) (C(0x10b5b));
- C(Vendor_Name) (C(0x11570));
- C(Description) (C(0x230017)).
- Hex IDs are the direct identifiers in Spectrum and will always work.
- 'To lookup hex IDs go to the UI: Locator -> Devices -> By Model Name -> <enter any model> -> Attributes tab.'
type: str
required: true
value:
description:
- Attribute value. Empty strings should be V("") or V(null).
type: str
required: true
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Enforce maintenance mode for modelxyz01 with a note about why
community.general.spectrum_model_attrs:
url: "http://oneclick.url.com"
@ -128,23 +126,20 @@ EXAMPLES = r'''
value: "MM set on {{ ansible_date_time.iso8601 }} via CO {{ CO }} by {{ tower_user_name | default(ansible_user_id) }}"
delegate_to: localhost
register: spectrum_model_attrs_status
'''
"""
RETURN = r'''
RETURN = r"""
msg:
description: Informational message on the job result.
type: str
returned: always
sample: 'Success'
description: Informational message on the job result.
type: str
returned: always
sample: 'Success'
changed_attrs:
description: Dictionary of changed name or hex IDs (whichever was specified) to their new corresponding values.
type: dict
returned: always
sample: {
"Notes": "MM set on 2021-02-03T22:04:02Z via CO CO9999 by tgates",
"isManaged": "true"
}
'''
description: Dictionary of changed name or hex IDs (whichever was specified) to their new corresponding values.
type: dict
returned: always
sample: {"Notes": "MM set on 2021-02-03T22:04:02Z via CO CO9999 by tgates", "isManaged": "true"}
"""
from ansible.module_utils.basic import AnsibleModule

File diff suppressed because it is too large Load Diff

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
short_description: Manage HPE StoreServ 3PAR CPG
author:
- Farhan Nomani (@farhan7500)
@ -43,18 +42,15 @@ options:
type: str
growth_increment:
description:
- Specifies the growth increment(in MiB, GiB or TiB) the amount of logical disk storage
created on each auto-grow operation.
- Specifies the growth increment(in MiB, GiB or TiB) the amount of logical disk storage created on each auto-grow operation.
type: str
growth_limit:
description:
- Specifies that the autogrow operation is limited to the specified
storage amount that sets the growth limit(in MiB, GiB or TiB).
- Specifies that the autogrow operation is limited to the specified storage amount that sets the growth limit(in MiB, GiB or TiB).
type: str
growth_warning:
description:
- Specifies that the threshold(in MiB, GiB or TiB) of used logical disk space when exceeded
results in a warning alert.
- Specifies that the threshold(in MiB, GiB or TiB) of used logical disk space when exceeded results in a warning alert.
type: str
high_availability:
choices:
@ -62,8 +58,7 @@ options:
- CAGE
- MAG
description:
- Specifies that the layout must support the failure of one port pair,
one cage, or one magazine.
- Specifies that the layout must support the failure of one port pair, one cage, or one magazine.
type: str
raid_type:
choices:
@ -92,13 +87,12 @@ options:
type: bool
default: false
extends_documentation_fragment:
- community.general.hpe3par
- community.general.attributes
'''
- community.general.hpe3par
- community.general.attributes
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Create CPG sample_cpg
community.general.ss_3par_cpg:
storage_system_ip: 10.10.10.1
@ -124,10 +118,10 @@ EXAMPLES = r'''
state: absent
cpg_name: sample_cpg
secure: false
'''
"""
RETURN = r'''
'''
RETURN = r"""
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.storage.hpe3par import hpe3par

View File

@ -11,18 +11,17 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ssh_config
short_description: Manage SSH config for user
version_added: '2.0.0'
description:
- Configures SSH hosts with special C(IdentityFile)s and hostnames.
- Configures SSH hosts with special C(IdentityFile)s and hostnames.
author:
- Björn Andersson (@gaqzi)
- Abhijeet Kasurde (@Akasurde)
- Björn Andersson (@gaqzi)
- Abhijeet Kasurde (@Akasurde)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
@ -33,7 +32,7 @@ options:
description:
- Whether a host entry should exist or not.
default: present
choices: [ 'present', 'absent' ]
choices: ['present', 'absent']
type: str
user:
description:
@ -50,8 +49,7 @@ options:
host:
description:
- The endpoint this configuration is valid for.
- Can be an actual address on the internet or an alias that will
connect to the value of O(hostname).
- Can be an actual address on the internet or an alias that will connect to the value of O(hostname).
required: true
type: str
hostname:
@ -68,17 +66,14 @@ options:
type: str
identity_file:
description:
- The path to an identity file (SSH private key) that will be used
when connecting to this host.
- The path to an identity file (SSH private key) that will be used when connecting to this host.
- File need to exist and have mode V(0600) to be valid.
type: path
identities_only:
description:
- Specifies that SSH should only use the configured authentication
identity and certificate files (either the default files, or
those explicitly configured in the C(ssh_config) files or passed on
the ssh command-line), even if ssh-agent or a PKCS11Provider or
SecurityKeyProvider offers more identities.
- Specifies that SSH should only use the configured authentication identity and certificate files (either the default files, or those explicitly
configured in the C(ssh_config) files or passed on the ssh command-line), even if ssh-agent or a PKCS11Provider or SecurityKeyProvider
offers more identities.
type: bool
version_added: 8.2.0
user_known_hosts_file:
@ -89,7 +84,7 @@ options:
description:
- Whether to strictly check the host key when doing connections to the remote host.
- The value V(accept-new) is supported since community.general 8.6.0.
choices: [ 'yes', 'no', 'ask', 'accept-new' ]
choices: ['yes', 'no', 'ask', 'accept-new']
type: str
proxycommand:
description:
@ -126,7 +121,7 @@ options:
controlmaster:
description:
- Sets the C(ControlMaster) option.
choices: [ 'yes', 'no', 'ask', 'auto', 'autoask' ]
choices: ['yes', 'no', 'ask', 'auto', 'autoask']
type: str
version_added: 8.1.0
controlpath:
@ -145,10 +140,10 @@ options:
type: str
version_added: 10.1.0
requirements:
- paramiko
'''
- paramiko
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Add a host in the configuration
community.general.ssh_config:
user: akasurde
@ -163,9 +158,9 @@ EXAMPLES = r'''
ssh_config_file: "{{ ssh_config_test }}"
host: "example.com"
state: absent
'''
"""
RETURN = r'''
RETURN = r"""
hosts_added:
description: A list of host added.
returned: success
@ -201,7 +196,7 @@ hosts_change_diff:
}
}
]
'''
"""
import os

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: stacki_host
short_description: Add or remove host to stacki front-end
description:
@ -35,8 +34,7 @@ options:
type: str
stacki_password:
description:
- Password for authenticating with Stacki API, but if not
specified, the environment variable E(stacki_password) is used instead.
- Password for authenticating with Stacki API, but if not specified, the environment variable E(stacki_password) is used instead.
required: true
type: str
stacki_endpoint:
@ -68,7 +66,7 @@ options:
description:
- Set value to the desired state for the specified host.
type: str
choices: [ absent, present ]
choices: [absent, present]
default: present
appliance:
description:
@ -96,10 +94,10 @@ options:
type: str
default: private
author:
- Hugh Ma (@bbyhuy) <Hugh.Ma@flextronics.com>
'''
- Hugh Ma (@bbyhuy) <Hugh.Ma@flextronics.com>
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Add a host named test-1
community.general.stacki_host:
name: test-1
@ -117,27 +115,27 @@ EXAMPLES = '''
stacki_password: pwd
stacki_endpoint: url
state: absent
'''
"""
RETURN = '''
RETURN = r"""
changed:
description: response to whether or not the api call completed successfully
description: Response to whether or not the api call completed successfully.
returned: always
type: bool
sample: true
stdout:
description: the set of responses from the commands
description: The set of responses from the commands.
returned: always
type: list
sample: ['...', '...']
stdout_lines:
description: the value of stdout split into a list
description: The value of stdout split into a list.
returned: always
type: list
sample: [['...', '...'], ['...'], ['...']]
'''
"""
import json

View File

@ -7,15 +7,14 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
DOCUMENTATION = r"""
module: statsd
short_description: Send metrics to StatsD
version_added: 2.1.0
description:
- The C(statsd) module sends metrics to StatsD.
- For more information, see U(https://statsd-metrics.readthedocs.io/en/latest/).
- Supported metric types are V(counter) and V(gauge).
Currently unupported metric types are V(timer), V(set), and V(gaugedelta).
- Supported metric types are V(counter) and V(gauge). Currently unupported metric types are V(timer), V(set), and V(gaugedelta).
author: "Mark Mercado (@mamercad)"
requirements:
- statsd
@ -80,9 +79,9 @@ options:
default: false
description:
- If the metric is of type V(gauge), change the value by O(delta).
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Increment the metric my_counter by 1
community.general.statsd:
host: localhost
@ -100,7 +99,7 @@ EXAMPLES = '''
metric: my_gauge
metric_type: gauge
value: 7
'''
"""
from ansible.module_utils.basic import (AnsibleModule, missing_required_lib)

View File

@ -9,127 +9,123 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
DOCUMENTATION = r"""
module: statusio_maintenance
short_description: Create maintenance windows for your status.io dashboard
description:
- Creates a maintenance window for status.io
- Deletes a maintenance window for status.io
- Creates or deletes a maintenance window for status.io.
notes:
- You can use the apiary API url (http://docs.statusio.apiary.io/) to
capture API traffic
- Use start_date and start_time with minutes to set future maintenance window
- You can use the apiary API URL (U(http://docs.statusio.apiary.io/)) to capture API traffic.
- Use start_date and start_time with minutes to set future maintenance window.
author: Benjamin Copeland (@bhcopeland) <ben@copeland.me.uk>
extends_documentation_fragment:
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
title:
type: str
description:
- A descriptive title for the maintenance window
default: "A new maintenance window"
desc:
type: str
description:
- Message describing the maintenance window
default: "Created by Ansible"
state:
type: str
description:
- Desired state of the package.
default: "present"
choices: ["present", "absent"]
api_id:
type: str
description:
- Your unique API ID from status.io
required: true
api_key:
type: str
description:
- Your unique API Key from status.io
required: true
statuspage:
type: str
description:
- Your unique StatusPage ID from status.io
required: true
url:
type: str
description:
- Status.io API URL. A private apiary can be used instead.
default: "https://api.status.io"
components:
type: list
elements: str
description:
- The given name of your component (server name)
aliases: ['component']
containers:
type: list
elements: str
description:
- The given name of your container (data center)
aliases: ['container']
all_infrastructure_affected:
description:
- If it affects all components and containers
type: bool
default: false
automation:
description:
- Automatically start and end the maintenance window
type: bool
default: false
maintenance_notify_now:
description:
- Notify subscribers now
type: bool
default: false
maintenance_notify_72_hr:
description:
- Notify subscribers 72 hours before maintenance start time
type: bool
default: false
maintenance_notify_24_hr:
description:
- Notify subscribers 24 hours before maintenance start time
type: bool
default: false
maintenance_notify_1_hr:
description:
- Notify subscribers 1 hour before maintenance start time
type: bool
default: false
maintenance_id:
type: str
description:
- The maintenance id number when deleting a maintenance window
minutes:
type: int
description:
- The length of time in UTC that the maintenance will run
(starting from playbook runtime)
default: 10
start_date:
type: str
description:
- Date maintenance is expected to start (Month/Day/Year) (UTC)
- End Date is worked out from start_date + minutes
start_time:
type: str
description:
- Time maintenance is expected to start (Hour:Minutes) (UTC)
- End Time is worked out from start_time + minutes
'''
title:
type: str
description:
- A descriptive title for the maintenance window.
default: "A new maintenance window"
desc:
type: str
description:
- Message describing the maintenance window.
default: "Created by Ansible"
state:
type: str
description:
- Desired state of the package.
default: "present"
choices: ["present", "absent"]
api_id:
type: str
description:
- Your unique API ID from status.io.
required: true
api_key:
type: str
description:
- Your unique API Key from status.io.
required: true
statuspage:
type: str
description:
- Your unique StatusPage ID from status.io.
required: true
url:
type: str
description:
- Status.io API URL. A private apiary can be used instead.
default: "https://api.status.io"
components:
type: list
elements: str
description:
- The given name of your component (server name).
aliases: ['component']
containers:
type: list
elements: str
description:
- The given name of your container (data center).
aliases: ['container']
all_infrastructure_affected:
description:
- If it affects all components and containers.
type: bool
default: false
automation:
description:
- Automatically start and end the maintenance window.
type: bool
default: false
maintenance_notify_now:
description:
- Notify subscribers now.
type: bool
default: false
maintenance_notify_72_hr:
description:
- Notify subscribers 72 hours before maintenance start time.
type: bool
default: false
maintenance_notify_24_hr:
description:
- Notify subscribers 24 hours before maintenance start time.
type: bool
default: false
maintenance_notify_1_hr:
description:
- Notify subscribers 1 hour before maintenance start time.
type: bool
default: false
maintenance_id:
type: str
description:
- The maintenance id number when deleting a maintenance window.
minutes:
type: int
description:
- The length of time in UTC that the maintenance will run (starting from playbook runtime).
default: 10
start_date:
type: str
description:
- Date maintenance is expected to start (Month/Day/Year) (UTC).
- End Date is worked out from O(start_date) + O(minutes).
start_time:
type: str
description:
- Time maintenance is expected to start (Hour:Minutes) (UTC).
- End Time is worked out from O(start_time) + O(minutes).
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a maintenance window for 10 minutes on server1, with automation to stop the maintenance
community.general.statusio_maintenance:
title: Router Upgrade from ansible
@ -176,10 +172,9 @@ EXAMPLES = '''
api_id: api_id
api_key: api_key
state: absent
'''
"""
# TODO: Add RETURN documentation.
RETURN = ''' # '''
RETURN = """ # """
import datetime
import json

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: sudoers
short_description: Manage sudoers files
version_added: "4.3.0"
@ -98,11 +97,11 @@ options:
- If V(required), visudo must be available to validate the sudoers rule.
type: str
default: detect
choices: [ absent, detect, required ]
choices: [absent, detect, required]
version_added: 5.2.0
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Allow the backup user to sudo /usr/local/bin/backup
community.general.sudoers:
name: allow-backup
@ -158,7 +157,7 @@ EXAMPLES = '''
user: alice
commands: /usr/bin/less
noexec: true
'''
"""
import os
from ansible.module_utils.basic import AnsibleModule

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: supervisorctl
short_description: Manage the state of a program or group of programs running via supervisord
description:
- Manage the state of a program or group of programs running via supervisord
- Manage the state of a program or group of programs running via supervisord.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -33,29 +32,29 @@ options:
config:
type: path
description:
- The supervisor configuration file path
- The supervisor configuration file path.
server_url:
type: str
description:
- URL on which supervisord server is listening
- URL on which supervisord server is listening.
username:
type: str
description:
- username to use for authentication
- Username to use for authentication.
password:
type: str
description:
- password to use for authentication
- Password to use for authentication.
state:
type: str
description:
- The desired state of program/group.
required: true
choices: [ "present", "started", "stopped", "restarted", "absent", "signalled" ]
choices: ["present", "started", "stopped", "restarted", "absent", "signalled"]
stop_before_removing:
type: bool
description:
- Use O(stop_before_removing=true) to stop the program/group before removing it
- Use O(stop_before_removing=true) to stop the program/group before removing it.
required: false
default: false
version_added: 7.5.0
@ -66,19 +65,19 @@ options:
supervisorctl_path:
type: path
description:
- path to supervisorctl executable
- Path to C(supervisorctl) executable.
notes:
- When O(state=present), the module will call C(supervisorctl reread) then C(supervisorctl add) if the program/group does not exist.
- When O(state=restarted), the module will call C(supervisorctl update) then call C(supervisorctl restart).
- When O(state=absent), the module will call C(supervisorctl reread) then C(supervisorctl remove) to remove the target program/group.
If the program/group is still running, the action will fail. If you want to stop the program/group before removing, use O(stop_before_removing=true).
requirements: [ "supervisorctl" ]
- When O(state=absent), the module will call C(supervisorctl reread) then C(supervisorctl remove) to remove the target program/group. If the
program/group is still running, the action will fail. If you want to stop the program/group before removing, use O(stop_before_removing=true).
requirements: ["supervisorctl"]
author:
- "Matt Wright (@mattupstate)"
- "Aaron Wang (@inetfuture) <inetfuture@gmail.com>"
'''
- "Matt Wright (@mattupstate)"
- "Aaron Wang (@inetfuture) <inetfuture@gmail.com>"
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Manage the state of program to be in started state
community.general.supervisorctl:
name: my_app
@ -113,7 +112,7 @@ EXAMPLES = '''
community.general.supervisorctl:
name: all
state: restarted
'''
"""
import os
from ansible.module_utils.basic import AnsibleModule, is_executable

View File

@ -8,60 +8,55 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: svc
author:
- Brian Coca (@bcoca)
- Brian Coca (@bcoca)
short_description: Manage daemontools services
description:
- Controls daemontools services on remote hosts using the svc utility.
- Controls daemontools services on remote hosts using the svc utility.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
- Name of the service to manage.
type: str
required: true
state:
description:
- V(started)/V(stopped) are idempotent actions that will not run
commands unless necessary. V(restarted) will always bounce the
svc (svc -t) and V(killed) will always bounce the svc (svc -k).
V(reloaded) will send a sigusr1 (svc -1).
V(once) will run a normally downed svc once (svc -o), not really
an idempotent operation.
type: str
choices: [ killed, once, reloaded, restarted, started, stopped ]
downed:
description:
- Should a 'down' file exist or not, if it exists it disables auto startup.
Defaults to no. Downed does not imply stopped.
type: bool
enabled:
description:
- Whether the service is enabled or not, if disabled it also implies stopped.
Take note that a service can be enabled and downed (no auto restart).
type: bool
service_dir:
description:
- Directory svscan watches for services
type: str
default: /service
service_src:
description:
- Directory where services are defined, the source of symlinks to service_dir.
type: str
default: /etc/service
'''
name:
description:
- Name of the service to manage.
type: str
required: true
state:
description:
- V(started)/V(stopped) are idempotent actions that will not run commands unless necessary. V(restarted) will always bounce the svc (svc
-t) and V(killed) will always bounce the svc (svc -k). V(reloaded) will send a sigusr1 (svc -1). V(once) will run a normally downed svc
once (svc -o), not really an idempotent operation.
type: str
choices: [killed, once, reloaded, restarted, started, stopped]
downed:
description:
- Should a 'down' file exist or not, if it exists it disables auto startup. Defaults to no. Downed does not imply stopped.
type: bool
enabled:
description:
- Whether the service is enabled or not, if disabled it also implies stopped. Take note that a service can be enabled and downed (no auto
restart).
type: bool
service_dir:
description:
- Directory svscan watches for services.
type: str
default: /service
service_src:
description:
- Directory where services are defined, the source of symlinks to O(service_dir).
type: str
default: /etc/service
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Start svc dnscache, if not running
community.general.svc:
name: dnscache
@ -92,7 +87,7 @@ EXAMPLES = '''
name: dnscache
state: reloaded
service_dir: /var/service
'''
"""
import os
import re

View File

@ -10,19 +10,16 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: svr4pkg
short_description: Manage Solaris SVR4 packages
description:
- Manages SVR4 packages on Solaris 10 and 11.
- These were the native packages on Solaris <= 10 and are available
as a legacy feature in Solaris 11.
- Note that this is a very basic packaging system. It will not enforce
dependencies on install or remove.
- Manages SVR4 packages on Solaris 10 and 11.
- These were the native packages on Solaris <= 10 and are available as a legacy feature in Solaris 11.
- Note that this is a very basic packaging system. It will not enforce dependencies on install or remove.
author: "Boyd Adamson (@brontitall)"
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
@ -47,8 +44,9 @@ options:
src:
description:
- Specifies the location to install the package from. Required when O(state=present).
- "Can be any path acceptable to the C(pkgadd) command's C(-d) option. For example: V(somefile.pkg), V(/dir/with/pkgs), V(http:/server/mypkgs.pkg)."
- If using a file or directory, they must already be accessible by the host. See the M(ansible.builtin.copy) module for a way to get them there.
- "Can be any path acceptable to the C(pkgadd) command's C(-d) option. For example: V(somefile.pkg), V(/dir/with/pkgs), V(http://server/mypkgs.pkg)."
- If using a file or directory, they must already be accessible by the host. See the M(ansible.builtin.copy) module for a way to get them
there.
type: str
proxy:
description:
@ -73,9 +71,9 @@ options:
required: false
type: bool
default: false
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Install a package from an already copied file
community.general.svr4pkg:
name: CSWcommon
@ -106,7 +104,7 @@ EXAMPLES = '''
name: FIREFOX
state: absent
category: true
'''
"""
import os

View File

@ -12,41 +12,40 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: swdepot
short_description: Manage packages with swdepot package manager (HP-UX)
description:
- Will install, upgrade and remove packages with swdepot package manager (HP-UX)
- Will install, upgrade and remove packages with swdepot package manager (HP-UX).
notes: []
author: "Raul Melo (@melodous)"
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
- package name.
aliases: [pkg]
required: true
type: str
state:
description:
- whether to install (V(present), V(latest)), or remove (V(absent)) a package.
required: true
choices: [ 'present', 'latest', 'absent']
type: str
depot:
description:
- The source repository from which install or upgrade a package.
type: str
'''
name:
description:
- Package name.
aliases: [pkg]
required: true
type: str
state:
description:
- Whether to install (V(present), V(latest)), or remove (V(absent)) a package.
required: true
choices: ['present', 'latest', 'absent']
type: str
depot:
description:
- The source repository from which install or upgrade a package.
type: str
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Install a package
community.general.swdepot:
name: unzip-6.0
@ -63,7 +62,7 @@ EXAMPLES = '''
community.general.swdepot:
name: unzip
state: absent
'''
"""
import re

View File

@ -10,13 +10,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: swupd
short_description: Manages updates and bundles in ClearLinux systems
description:
- Manages updates and bundles with the swupd bundle manager, which is used by the
Clear Linux Project for Intel Architecture.
- Manages updates and bundles with the swupd bundle manager, which is used by the Clear Linux Project for Intel Architecture.
author: Alberto Murillo (@albertomurillo)
extends_documentation_fragment:
- community.general.attributes
@ -28,19 +26,16 @@ attributes:
options:
contenturl:
description:
- URL pointing to the contents of available bundles.
If not specified, the contents are retrieved from clearlinux.org.
- URL pointing to the contents of available bundles. If not specified, the contents are retrieved from clearlinux.org.
type: str
format:
description:
- The format suffix for version file downloads. For example [1,2,3,staging,etc].
If not specified, the default format is used.
- The format suffix for version file downloads. For example [1,2,3,staging,etc]. If not specified, the default format is used.
type: str
manifest:
description:
- The manifest contains information about the bundles at certain version of the OS.
Specify a Manifest version to verify against that version or leave unspecified to
verify against the current version.
- The manifest contains information about the bundles at certain version of the OS. Specify a Manifest version to verify against that version
or leave unspecified to verify against the current version.
aliases: [release, version]
type: int
name:
@ -50,8 +45,7 @@ options:
type: str
state:
description:
- Indicates the desired (I)bundle state. V(present) ensures the bundle
is installed while V(absent) ensures the (I)bundle is not installed.
- Indicates the desired (I)bundle state. V(present) ensures the bundle is installed while V(absent) ensures the (I)bundle is not installed.
default: present
choices: [present, absent]
type: str
@ -73,9 +67,9 @@ options:
description:
- URL for version string download.
type: str
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Update the OS to the latest version
community.general.swupd:
update: true
@ -98,18 +92,18 @@ EXAMPLES = '''
community.general.swupd:
verify: true
manifest: 12920
'''
"""
RETURN = '''
RETURN = r"""
stdout:
description: stdout of swupd
description: C(stdout) of C(swupd).
returned: always
type: str
stderr:
description: stderr of swupd
description: C(stderr) of C(swupd).
returned: always
type: str
'''
"""
import os
from ansible.module_utils.basic import AnsibleModule

View File

@ -7,55 +7,53 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: syslogger
short_description: Log messages in the syslog
description:
- Uses syslog to add log entries to the host.
- Uses syslog to add log entries to the host.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: none
diff_mode:
support: none
check_mode:
support: none
diff_mode:
support: none
options:
msg:
type: str
description:
- This is the message to place in syslog.
required: true
priority:
type: str
description:
- Set the log priority.
choices: [ "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug" ]
default: "info"
facility:
type: str
description:
- Set the log facility.
choices: [ "kern", "user", "mail", "daemon", "auth", "lpr", "news",
"uucp", "cron", "syslog", "local0", "local1", "local2",
"local3", "local4", "local5", "local6", "local7" ]
default: "daemon"
log_pid:
description:
- Log the PID in brackets.
type: bool
default: false
ident:
description:
- Specify the name of application name which is sending the log to syslog.
type: str
default: 'ansible_syslogger'
version_added: '0.2.0'
msg:
type: str
description:
- This is the message to place in syslog.
required: true
priority:
type: str
description:
- Set the log priority.
choices: ["emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"]
default: "info"
facility:
type: str
description:
- Set the log facility.
choices: ["kern", "user", "mail", "daemon", "auth", "lpr", "news", "uucp", "cron", "syslog", "local0", "local1", "local2", "local3", "local4",
"local5", "local6", "local7"]
default: "daemon"
log_pid:
description:
- Log the PID in brackets.
type: bool
default: false
ident:
description:
- Specify the name of application name which is sending the log to syslog.
type: str
default: 'ansible_syslogger'
version_added: '0.2.0'
author:
- Tim Rightnour (@garbled1)
'''
- Tim Rightnour (@garbled1)
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Simple Usage
community.general.syslogger:
msg: "I will end up as daemon.info"
@ -72,36 +70,36 @@ EXAMPLES = r'''
ident: "MyApp"
msg: "I want to believe"
priority: "alert"
'''
"""
RETURN = r'''
RETURN = r"""
ident:
description: Name of application sending the message to log
description: Name of application sending the message to log.
returned: always
type: str
sample: "ansible_syslogger"
version_added: '0.2.0'
priority:
description: Priority level
description: Priority level.
returned: always
type: str
sample: "daemon"
facility:
description: Syslog facility
description: Syslog facility.
returned: always
type: str
sample: "info"
log_pid:
description: Log PID status
description: Log PID status.
returned: always
type: bool
sample: true
msg:
description: Message sent to syslog
description: Message sent to syslog.
returned: always
type: str
sample: "Hello from Ansible"
'''
"""
import syslog
import traceback

View File

@ -8,37 +8,35 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: syspatch
short_description: Manage OpenBSD system patches
description:
- "Manage OpenBSD system patches using syspatch."
- Manage OpenBSD system patches using syspatch.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
revert:
description:
- Revert system patches.
type: str
choices: [ all, one ]
revert:
description:
- Revert system patches.
type: str
choices: [all, one]
author:
- Andrew Klaus (@precurse)
'''
- Andrew Klaus (@precurse)
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Apply all available system patches
community.general.syspatch:
@ -58,20 +56,20 @@ EXAMPLES = '''
- name: Reboot if patch requires it
ansible.builtin.reboot:
when: syspatch.reboot_needed
'''
"""
RETURN = r'''
RETURN = r"""
rc:
description: The command return code (0 means success)
description: The command return code (0 means success).
returned: always
type: int
stdout:
description: syspatch standard output.
description: C(syspatch) standard output.
returned: always
type: str
sample: "001_rip6cksum"
stderr:
description: syspatch standard error.
description: C(syspatch) standard error.
returned: always
type: str
sample: "syspatch: need root privileges"
@ -80,7 +78,7 @@ reboot_needed:
returned: always
type: bool
sample: true
'''
"""
from ansible.module_utils.basic import AnsibleModule

View File

@ -9,64 +9,62 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
author:
- David Lundgren (@dlundgren)
- David Lundgren (@dlundgren)
module: sysrc
short_description: Manage FreeBSD using sysrc
version_added: '2.0.0'
description:
- Manages C(/etc/rc.conf) for FreeBSD.
- Manages C(/etc/rc.conf) for FreeBSD.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
- Name of variable in C(/etc/rc.conf) to manage.
type: str
required: true
value:
description:
- The value to set when O(state=present).
- The value to add when O(state=value_present).
- The value to remove when O(state=value_absent).
type: str
state:
description:
- Use V(present) to add the variable.
- Use V(absent) to remove the variable.
- Use V(value_present) to add the value to the existing variable.
- Use V(value_absent) to remove the value from the existing variable.
type: str
default: "present"
choices: [ absent, present, value_present, value_absent ]
path:
description:
- Path to file to use instead of V(/etc/rc.conf).
type: str
default: "/etc/rc.conf"
delim:
description:
- Delimiter to be used instead of V(" ") (space).
- Only used when O(state=value_present) or O(state=value_absent).
default: " "
type: str
jail:
description:
- Name or ID of the jail to operate on.
type: str
name:
description:
- Name of variable in C(/etc/rc.conf) to manage.
type: str
required: true
value:
description:
- The value to set when O(state=present).
- The value to add when O(state=value_present).
- The value to remove when O(state=value_absent).
type: str
state:
description:
- Use V(present) to add the variable.
- Use V(absent) to remove the variable.
- Use V(value_present) to add the value to the existing variable.
- Use V(value_absent) to remove the value from the existing variable.
type: str
default: "present"
choices: [absent, present, value_present, value_absent]
path:
description:
- Path to file to use instead of V(/etc/rc.conf).
type: str
default: "/etc/rc.conf"
delim:
description:
- Delimiter to be used instead of V(" ") (space).
- Only used when O(state=value_present) or O(state=value_absent).
default: " "
type: str
jail:
description:
- Name or ID of the jail to operate on.
type: str
notes:
- The O(name) cannot contain periods as sysrc does not support OID style names.
'''
"""
EXAMPLES = r'''
---
EXAMPLES = r"""
# enable mysql in the /etc/rc.conf
- name: Configure mysql pid file
community.general.sysrc:
@ -94,15 +92,15 @@ EXAMPLES = r'''
name: nginx_enable
value: "YES"
jail: testjail
'''
"""
RETURN = r'''
RETURN = r"""
changed:
description: Return changed for sysrc actions.
returned: always
type: bool
sample: true
'''
"""
from ansible.module_utils.basic import AnsibleModule
import re

View File

@ -8,54 +8,53 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: sysupgrade
short_description: Manage OpenBSD system upgrades
version_added: 1.1.0
description:
- Manage OpenBSD system upgrades using sysupgrade.
- Manage OpenBSD system upgrades using C(sysupgrade).
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: none
diff_mode:
support: none
check_mode:
support: none
diff_mode:
support: none
options:
snapshot:
description:
- Apply the latest snapshot.
- Otherwise release will be applied.
default: false
type: bool
force:
description:
- Force upgrade (for snapshots only).
default: false
type: bool
keep_files:
description:
- Keep the files under /home/_sysupgrade.
- By default, the files will be deleted after the upgrade.
default: false
type: bool
fetch_only:
description:
- Fetch and verify files and create /bsd.upgrade but do not reboot.
- Set to V(false) if you want sysupgrade to reboot. This will cause Ansible to error, as it expects the module to exit gracefully. See the examples.
default: true
type: bool
installurl:
description:
- OpenBSD mirror top-level URL for fetching an upgrade.
- By default, the mirror URL is pulled from /etc/installurl.
type: str
snapshot:
description:
- Apply the latest snapshot.
- Otherwise release will be applied.
default: false
type: bool
force:
description:
- Force upgrade (for snapshots only).
default: false
type: bool
keep_files:
description:
- Keep the files under C(/home/_sysupgrade).
- By default, the files will be deleted after the upgrade.
default: false
type: bool
fetch_only:
description:
- Fetch and verify files and create C(/bsd.upgrade) but do not reboot.
- Set to V(false) if you want C(sysupgrade) to reboot. This will cause Ansible to error, as it expects the module to exit gracefully. See the examples.
default: true
type: bool
installurl:
description:
- OpenBSD mirror top-level URL for fetching an upgrade.
- By default, the mirror URL is pulled from C(/etc/installurl).
type: str
author:
- Andrew Klaus (@precurse)
'''
- Andrew Klaus (@precurse)
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Upgrade to latest release
community.general.sysupgrade:
register: sysupgrade
@ -77,9 +76,9 @@ EXAMPLES = r'''
community.general.sysupgrade:
fetch_only: false
ignore_errors: true
'''
"""
RETURN = r'''
RETURN = r"""
rc:
description: The command return code (0 means success).
returned: always
@ -93,7 +92,7 @@ stderr:
returned: always
type: str
sample: "sysupgrade: need root privileges"
'''
"""
from ansible.module_utils.basic import AnsibleModule