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

View File

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

View File

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

View File

@ -9,110 +9,108 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: spectrum_model_attrs module: spectrum_model_attrs
short_description: Enforce a model's attributes in CA Spectrum short_description: Enforce a model's attributes in CA Spectrum
description: 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 version_added: 2.5.0
author: author:
- Tyler Gates (@tgates81) - Tyler Gates (@tgates81)
notes: notes:
- Tested on CA Spectrum version 10.4.2.0.189. - 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. - Model creation and deletion are not possible with this module. For that use M(community.general.spectrum_device) instead.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
url: url:
description: description:
- URL of OneClick server. - URL of OneClick server.
type: str type: str
required: true required: true
url_username: url_username:
description: description:
- OneClick username. - OneClick username.
type: str type: str
required: true required: true
aliases: [username] aliases: [username]
url_password: url_password:
description: description:
- OneClick password. - OneClick password.
type: str type: str
required: true required: true
aliases: [password] aliases: [password]
use_proxy: use_proxy:
description: description:
- if V(false), it will not use a proxy, even if one is defined in - If V(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
an environment variable on the target hosts. default: true
default: true required: false
required: false type: bool
type: bool name:
name: description:
description: - Model name.
- Model name. type: str
type: str required: true
required: true type:
type: description:
description: - Model type.
- Model type. type: str
type: str required: true
required: true validate_certs:
validate_certs: description:
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
- 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 no man-in-the-middle attack happening.
man-in-the-middle attack happening. type: bool
type: bool default: true
default: true required: false
required: false attributes:
attributes: description:
description: - A list of attribute names and values to enforce.
- A list of attribute names and values to enforce. - All values and parameters are case sensitive and must be provided as strings only.
- All values and parameters are case sensitive and must be provided as strings only. required: true
required: true type: list
type: list elements: dict
elements: dict suboptions:
suboptions: name:
name: description:
description: - Attribute name OR hex ID.
- Attribute name OR hex ID. - 'Currently defined names are:'
- 'Currently defined names are:' - C(App_Manufacturer) (C(0x230683));
- ' C(App_Manufacturer) (C(0x230683))' - C(CollectionsModelNameString) (C(0x12adb));
- ' C(CollectionsModelNameString) (C(0x12adb))' - C(Condition) (C(0x1000a));
- ' C(Condition) (C(0x1000a))' - C(Criticality) (C(0x1290c));
- ' C(Criticality) (C(0x1290c))' - C(DeviceType) (C(0x23000e));
- ' C(DeviceType) (C(0x23000e))' - C(isManaged) (C(0x1295d));
- ' C(isManaged) (C(0x1295d))' - C(Model_Class) (C(0x11ee8));
- ' C(Model_Class) (C(0x11ee8))' - C(Model_Handle) (C(0x129fa));
- ' C(Model_Handle) (C(0x129fa))' - C(Model_Name) (C(0x1006e));
- ' C(Model_Name) (C(0x1006e))' - C(Modeltype_Handle) (C(0x10001));
- ' C(Modeltype_Handle) (C(0x10001))' - C(Modeltype_Name) (C(0x10000));
- ' C(Modeltype_Name) (C(0x10000))' - C(Network_Address) (C(0x12d7f));
- ' C(Network_Address) (C(0x12d7f))' - C(Notes) (C(0x11564));
- ' C(Notes) (C(0x11564))' - C(ServiceDesk_Asset_ID) (C(0x12db9));
- ' C(ServiceDesk_Asset_ID) (C(0x12db9))' - C(TopologyModelNameString) (C(0x129e7));
- ' C(TopologyModelNameString) (C(0x129e7))' - C(sysDescr) (C(0x10052));
- ' C(sysDescr) (C(0x10052))' - C(sysName) (C(0x10b5b));
- ' C(sysName) (C(0x10b5b))' - C(Vendor_Name) (C(0x11570));
- ' C(Vendor_Name) (C(0x11570))' - C(Description) (C(0x230017)).
- ' C(Description) (C(0x230017))' - Hex IDs are the direct identifiers in Spectrum and will always work.
- 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.'
- 'To lookup hex IDs go to the UI: Locator -> Devices -> By Model Name -> <enter any model> -> Attributes tab.' type: str
type: str required: true
required: true value:
value: description:
description: - Attribute value. Empty strings should be V("") or V(null).
- Attribute value. Empty strings should be V("") or V(null). type: str
type: str required: true
required: true """
'''
EXAMPLES = r''' EXAMPLES = r"""
- name: Enforce maintenance mode for modelxyz01 with a note about why - name: Enforce maintenance mode for modelxyz01 with a note about why
community.general.spectrum_model_attrs: community.general.spectrum_model_attrs:
url: "http://oneclick.url.com" 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) }}" value: "MM set on {{ ansible_date_time.iso8601 }} via CO {{ CO }} by {{ tower_user_name | default(ansible_user_id) }}"
delegate_to: localhost delegate_to: localhost
register: spectrum_model_attrs_status register: spectrum_model_attrs_status
''' """
RETURN = r''' RETURN = r"""
msg: msg:
description: Informational message on the job result. description: Informational message on the job result.
type: str type: str
returned: always returned: always
sample: 'Success' sample: 'Success'
changed_attrs: changed_attrs:
description: Dictionary of changed name or hex IDs (whichever was specified) to their new corresponding values. description: Dictionary of changed name or hex IDs (whichever was specified) to their new corresponding values.
type: dict type: dict
returned: always returned: always
sample: { sample: {"Notes": "MM set on 2021-02-03T22:04:02Z via CO CO9999 by tgates", "isManaged": "true"}
"Notes": "MM set on 2021-02-03T22:04:02Z via CO CO9999 by tgates", """
"isManaged": "true"
}
'''
from ansible.module_utils.basic import AnsibleModule 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 __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
short_description: Manage HPE StoreServ 3PAR CPG short_description: Manage HPE StoreServ 3PAR CPG
author: author:
- Farhan Nomani (@farhan7500) - Farhan Nomani (@farhan7500)
@ -43,18 +42,15 @@ options:
type: str type: str
growth_increment: growth_increment:
description: description:
- Specifies the growth increment(in MiB, GiB or TiB) the amount of logical disk storage - Specifies the growth increment(in MiB, GiB or TiB) the amount of logical disk storage created on each auto-grow operation.
created on each auto-grow operation.
type: str type: str
growth_limit: growth_limit:
description: description:
- Specifies that the autogrow operation is limited to the specified - Specifies that the autogrow operation is limited to the specified storage amount that sets the growth limit(in MiB, GiB or TiB).
storage amount that sets the growth limit(in MiB, GiB or TiB).
type: str type: str
growth_warning: growth_warning:
description: description:
- Specifies that the threshold(in MiB, GiB or TiB) of used logical disk space when exceeded - Specifies that the threshold(in MiB, GiB or TiB) of used logical disk space when exceeded results in a warning alert.
results in a warning alert.
type: str type: str
high_availability: high_availability:
choices: choices:
@ -62,8 +58,7 @@ options:
- CAGE - CAGE
- MAG - MAG
description: description:
- Specifies that the layout must support the failure of one port pair, - Specifies that the layout must support the failure of one port pair, one cage, or one magazine.
one cage, or one magazine.
type: str type: str
raid_type: raid_type:
choices: choices:
@ -92,13 +87,12 @@ options:
type: bool type: bool
default: false default: false
extends_documentation_fragment: extends_documentation_fragment:
- community.general.hpe3par - community.general.hpe3par
- community.general.attributes - community.general.attributes
"""
'''
EXAMPLES = r''' EXAMPLES = r"""
- name: Create CPG sample_cpg - name: Create CPG sample_cpg
community.general.ss_3par_cpg: community.general.ss_3par_cpg:
storage_system_ip: 10.10.10.1 storage_system_ip: 10.10.10.1
@ -124,10 +118,10 @@ EXAMPLES = r'''
state: absent state: absent
cpg_name: sample_cpg cpg_name: sample_cpg
secure: false secure: false
''' """
RETURN = r''' RETURN = r"""
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.storage.hpe3par import hpe3par 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 __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r"""
---
module: ssh_config module: ssh_config
short_description: Manage SSH config for user short_description: Manage SSH config for user
version_added: '2.0.0' version_added: '2.0.0'
description: description:
- Configures SSH hosts with special C(IdentityFile)s and hostnames. - Configures SSH hosts with special C(IdentityFile)s and hostnames.
author: author:
- Björn Andersson (@gaqzi) - Björn Andersson (@gaqzi)
- Abhijeet Kasurde (@Akasurde) - Abhijeet Kasurde (@Akasurde)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -33,7 +32,7 @@ options:
description: description:
- Whether a host entry should exist or not. - Whether a host entry should exist or not.
default: present default: present
choices: [ 'present', 'absent' ] choices: ['present', 'absent']
type: str type: str
user: user:
description: description:
@ -50,8 +49,7 @@ options:
host: host:
description: description:
- The endpoint this configuration is valid for. - The endpoint this configuration is valid for.
- Can be an actual address on the internet or an alias that will - Can be an actual address on the internet or an alias that will connect to the value of O(hostname).
connect to the value of O(hostname).
required: true required: true
type: str type: str
hostname: hostname:
@ -68,17 +66,14 @@ options:
type: str type: str
identity_file: identity_file:
description: description:
- The path to an identity file (SSH private key) that will be used - The path to an identity file (SSH private key) that will be used when connecting to this host.
when connecting to this host.
- File need to exist and have mode V(0600) to be valid. - File need to exist and have mode V(0600) to be valid.
type: path type: path
identities_only: identities_only:
description: description:
- Specifies that SSH should only use the configured authentication - Specifies that SSH should only use the configured authentication identity and certificate files (either the default files, or those explicitly
identity and certificate files (either the default files, or configured in the C(ssh_config) files or passed on the ssh command-line), even if ssh-agent or a PKCS11Provider or SecurityKeyProvider
those explicitly configured in the C(ssh_config) files or passed on offers more identities.
the ssh command-line), even if ssh-agent or a PKCS11Provider or
SecurityKeyProvider offers more identities.
type: bool type: bool
version_added: 8.2.0 version_added: 8.2.0
user_known_hosts_file: user_known_hosts_file:
@ -89,7 +84,7 @@ options:
description: description:
- Whether to strictly check the host key when doing connections to the remote host. - 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. - 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 type: str
proxycommand: proxycommand:
description: description:
@ -126,7 +121,7 @@ options:
controlmaster: controlmaster:
description: description:
- Sets the C(ControlMaster) option. - Sets the C(ControlMaster) option.
choices: [ 'yes', 'no', 'ask', 'auto', 'autoask' ] choices: ['yes', 'no', 'ask', 'auto', 'autoask']
type: str type: str
version_added: 8.1.0 version_added: 8.1.0
controlpath: controlpath:
@ -145,10 +140,10 @@ options:
type: str type: str
version_added: 10.1.0 version_added: 10.1.0
requirements: requirements:
- paramiko - paramiko
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Add a host in the configuration - name: Add a host in the configuration
community.general.ssh_config: community.general.ssh_config:
user: akasurde user: akasurde
@ -163,9 +158,9 @@ EXAMPLES = r'''
ssh_config_file: "{{ ssh_config_test }}" ssh_config_file: "{{ ssh_config_test }}"
host: "example.com" host: "example.com"
state: absent state: absent
''' """
RETURN = r''' RETURN = r"""
hosts_added: hosts_added:
description: A list of host added. description: A list of host added.
returned: success returned: success
@ -201,7 +196,7 @@ hosts_change_diff:
} }
} }
] ]
''' """
import os import os

View File

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

View File

@ -7,15 +7,14 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: statsd module: statsd
short_description: Send metrics to StatsD short_description: Send metrics to StatsD
version_added: 2.1.0 version_added: 2.1.0
description: description:
- The C(statsd) module sends metrics to StatsD. - The C(statsd) module sends metrics to StatsD.
- For more information, see U(https://statsd-metrics.readthedocs.io/en/latest/). - For more information, see U(https://statsd-metrics.readthedocs.io/en/latest/).
- Supported metric types are V(counter) and V(gauge). - Supported metric types are V(counter) and V(gauge). Currently unupported metric types are V(timer), V(set), and V(gaugedelta).
Currently unupported metric types are V(timer), V(set), and V(gaugedelta).
author: "Mark Mercado (@mamercad)" author: "Mark Mercado (@mamercad)"
requirements: requirements:
- statsd - statsd
@ -80,9 +79,9 @@ options:
default: false default: false
description: description:
- If the metric is of type V(gauge), change the value by O(delta). - 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 - name: Increment the metric my_counter by 1
community.general.statsd: community.general.statsd:
host: localhost host: localhost
@ -100,7 +99,7 @@ EXAMPLES = '''
metric: my_gauge metric: my_gauge
metric_type: gauge metric_type: gauge
value: 7 value: 7
''' """
from ansible.module_utils.basic import (AnsibleModule, missing_required_lib) 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 __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: statusio_maintenance module: statusio_maintenance
short_description: Create maintenance windows for your status.io dashboard short_description: Create maintenance windows for your status.io dashboard
description: description:
- Creates a maintenance window for status.io - Creates or deletes a maintenance window for status.io.
- Deletes a maintenance window for status.io
notes: notes:
- You can use the apiary API url (http://docs.statusio.apiary.io/) to - You can use the apiary API URL (U(http://docs.statusio.apiary.io/)) to capture API traffic.
capture API traffic - Use start_date and start_time with minutes to set future maintenance window.
- Use start_date and start_time with minutes to set future maintenance window
author: Benjamin Copeland (@bhcopeland) <ben@copeland.me.uk> author: Benjamin Copeland (@bhcopeland) <ben@copeland.me.uk>
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
diff_mode: diff_mode:
support: none support: none
options: options:
title: title:
type: str type: str
description: description:
- A descriptive title for the maintenance window - A descriptive title for the maintenance window.
default: "A new maintenance window" default: "A new maintenance window"
desc: desc:
type: str type: str
description: description:
- Message describing the maintenance window - Message describing the maintenance window.
default: "Created by Ansible" default: "Created by Ansible"
state: state:
type: str type: str
description: description:
- Desired state of the package. - Desired state of the package.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
api_id: api_id:
type: str type: str
description: description:
- Your unique API ID from status.io - Your unique API ID from status.io.
required: true required: true
api_key: api_key:
type: str type: str
description: description:
- Your unique API Key from status.io - Your unique API Key from status.io.
required: true required: true
statuspage: statuspage:
type: str type: str
description: description:
- Your unique StatusPage ID from status.io - Your unique StatusPage ID from status.io.
required: true required: true
url: url:
type: str type: str
description: description:
- Status.io API URL. A private apiary can be used instead. - Status.io API URL. A private apiary can be used instead.
default: "https://api.status.io" default: "https://api.status.io"
components: components:
type: list type: list
elements: str elements: str
description: description:
- The given name of your component (server name) - The given name of your component (server name).
aliases: ['component'] aliases: ['component']
containers: containers:
type: list type: list
elements: str elements: str
description: description:
- The given name of your container (data center) - The given name of your container (data center).
aliases: ['container'] aliases: ['container']
all_infrastructure_affected: all_infrastructure_affected:
description: description:
- If it affects all components and containers - If it affects all components and containers.
type: bool type: bool
default: false default: false
automation: automation:
description: description:
- Automatically start and end the maintenance window - Automatically start and end the maintenance window.
type: bool type: bool
default: false default: false
maintenance_notify_now: maintenance_notify_now:
description: description:
- Notify subscribers now - Notify subscribers now.
type: bool type: bool
default: false default: false
maintenance_notify_72_hr: maintenance_notify_72_hr:
description: description:
- Notify subscribers 72 hours before maintenance start time - Notify subscribers 72 hours before maintenance start time.
type: bool type: bool
default: false default: false
maintenance_notify_24_hr: maintenance_notify_24_hr:
description: description:
- Notify subscribers 24 hours before maintenance start time - Notify subscribers 24 hours before maintenance start time.
type: bool type: bool
default: false default: false
maintenance_notify_1_hr: maintenance_notify_1_hr:
description: description:
- Notify subscribers 1 hour before maintenance start time - Notify subscribers 1 hour before maintenance start time.
type: bool type: bool
default: false default: false
maintenance_id: maintenance_id:
type: str type: str
description: description:
- The maintenance id number when deleting a maintenance window - The maintenance id number when deleting a maintenance window.
minutes: minutes:
type: int type: int
description: description:
- The length of time in UTC that the maintenance will run - The length of time in UTC that the maintenance will run (starting from playbook runtime).
(starting from playbook runtime) default: 10
default: 10 start_date:
start_date: type: str
type: str description:
description: - Date maintenance is expected to start (Month/Day/Year) (UTC).
- Date maintenance is expected to start (Month/Day/Year) (UTC) - End Date is worked out from O(start_date) + O(minutes).
- End Date is worked out from start_date + minutes start_time:
start_time: type: str
type: str description:
description: - Time maintenance is expected to start (Hour:Minutes) (UTC).
- Time maintenance is expected to start (Hour:Minutes) (UTC) - End Time is worked out from O(start_time) + O(minutes).
- End Time is worked out from start_time + minutes """
'''
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a maintenance window for 10 minutes on server1, with automation to stop the maintenance - name: Create a maintenance window for 10 minutes on server1, with automation to stop the maintenance
community.general.statusio_maintenance: community.general.statusio_maintenance:
title: Router Upgrade from ansible title: Router Upgrade from ansible
@ -176,10 +172,9 @@ EXAMPLES = '''
api_id: api_id api_id: api_id
api_key: api_key api_key: api_key
state: absent state: absent
"""
'''
# TODO: Add RETURN documentation. # TODO: Add RETURN documentation.
RETURN = ''' # ''' RETURN = """ # """
import datetime import datetime
import json import json

View File

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

View File

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

View File

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

View File

@ -10,19 +10,16 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: svr4pkg module: svr4pkg
short_description: Manage Solaris SVR4 packages short_description: Manage Solaris SVR4 packages
description: description:
- Manages SVR4 packages on Solaris 10 and 11. - Manages SVR4 packages on Solaris 10 and 11.
- These were the native packages on Solaris <= 10 and are available - These were the native packages on Solaris <= 10 and are available as a legacy feature in Solaris 11.
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.
- Note that this is a very basic packaging system. It will not enforce
dependencies on install or remove.
author: "Boyd Adamson (@brontitall)" author: "Boyd Adamson (@brontitall)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
check_mode: check_mode:
support: full support: full
@ -47,8 +44,9 @@ options:
src: src:
description: description:
- Specifies the location to install the package from. Required when O(state=present). - 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)." - "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. - 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 type: str
proxy: proxy:
description: description:
@ -73,9 +71,9 @@ options:
required: false required: false
type: bool type: bool
default: false default: false
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Install a package from an already copied file - name: Install a package from an already copied file
community.general.svr4pkg: community.general.svr4pkg:
name: CSWcommon name: CSWcommon
@ -106,7 +104,7 @@ EXAMPLES = '''
name: FIREFOX name: FIREFOX
state: absent state: absent
category: true category: true
''' """
import os import os

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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