[ip ... j]*.py: normalize docs (#9392)

* [ip ... j]*.py: normalize docs

* Update plugins/modules/ip_netns.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/8676/merge
Alexei Znamensky 2024-12-27 01:40:05 +13:00 committed by GitHub
parent cea6eeef37
commit a99f72fc36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
43 changed files with 1290 additions and 1429 deletions

View File

@ -7,14 +7,13 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: ip_netns
author: "Arie Bregman (@bregman-arie)"
short_description: Manage network namespaces
requirements: [ ip ]
requirements: [ip]
description:
- Create or delete network namespaces using the ip command.
- Create or delete network namespaces using the C(ip) command.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -26,18 +25,18 @@ options:
name:
required: false
description:
- Name of the namespace
- Name of the namespace.
type: str
state:
required: false
default: "present"
choices: [ present, absent ]
choices: [present, absent]
description:
- Whether the namespace should exist
- Whether the namespace should exist.
type: str
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a namespace named mario
community.general.ip_netns:
name: mario
@ -47,11 +46,11 @@ EXAMPLES = '''
community.general.ip_netns:
name: luigi
state: absent
'''
"""
RETURN = '''
RETURN = r"""
# Default return values
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_text

View File

@ -7,8 +7,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_config
author: Fran Fitzpatrick (@fxfitz)
short_description: Manage Global FreeIPA Configuration Settings
@ -115,10 +114,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure password plugin features DC:Disable Last Success and KDC:Disable Lockout are enabled
community.general.ipa_config:
ipaconfigstring: ["KDC:Disable Last Success", "KDC:Disable Lockout"]
@ -221,14 +219,14 @@ EXAMPLES = r'''
ipa_host: localhost
ipa_user: admin
ipa_pass: supersecret
'''
"""
RETURN = r'''
RETURN = r"""
config:
description: Configuration as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_dnsrecord
author: Abhijeet Kasurde (@Akasurde)
short_description: Manage FreeIPA DNS records
@ -50,7 +49,8 @@ options:
- In the case of V(A6) record type, this will be the A6 Record data.
- In the case of V(CNAME) record type, this will be the hostname.
- In the case of V(DNAME) record type, this will be the DNAME target.
- In the case of V(NS) record type, this will be the name server hostname. Hostname must already have a valid A or AAAA record.
- In the case of V(NS) record type, this will be the name server hostname. Hostname must already have a valid A or AAAA
record.
- In the case of V(PTR) record type, this will be the hostname.
- In the case of V(TXT) record type, this will be a text.
- In the case of V(SRV) record type, this will be a service record.
@ -65,7 +65,8 @@ options:
- In the case of V(A6) record type, this will be the A6 Record data.
- In the case of V(CNAME) record type, this will be the hostname.
- In the case of V(DNAME) record type, this will be the DNAME target.
- In the case of V(NS) record type, this will be the name server hostname. Hostname must already have a valid A or AAAA record.
- In the case of V(NS) record type, this will be the name server hostname. Hostname must already have a valid A or AAAA
record.
- In the case of V(PTR) record type, this will be the hostname.
- In the case of V(TXT) record type, this will be a text.
- In the case of V(SRV) record type, this will be a service record.
@ -80,7 +81,7 @@ options:
required: false
type: int
state:
description: State to ensure
description: State to ensure.
required: false
default: present
choices: ["absent", "present"]
@ -88,10 +89,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure dns record is present
community.general.ipa_dnsrecord:
ipa_host: spider.example.com
@ -189,14 +189,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: ChangeMe!
'''
"""
RETURN = r'''
RETURN = r"""
dnsrecord:
description: DNS record as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -8,13 +8,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_dnszone
author: Fran Fitzpatrick (@fxfitz)
short_description: Manage FreeIPA DNS Zones
description:
- Add and delete an IPA DNS Zones using IPA API
- Add and delete an IPA DNS Zones using IPA API.
attributes:
check_mode:
support: full
@ -27,7 +26,7 @@ options:
required: true
type: str
state:
description: State to ensure
description: State to ensure.
required: false
default: present
choices: ["absent", "present"]
@ -44,10 +43,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure dns zone is present
community.general.ipa_dnszone:
ipa_host: spider.example.com
@ -78,14 +76,14 @@ EXAMPLES = r'''
state: present
zone_name: example.com
allowsyncptr: true
'''
"""
RETURN = r'''
RETURN = r"""
zone:
description: DNS zone as returned by IPA API.
returned: always
type: dict
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ipa import IPAClient, ipa_argument_spec

View File

@ -8,8 +8,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_getkeytab
short_description: Manage keytab file in FreeIPA
version_added: 9.5.0
@ -82,7 +81,8 @@ options:
state:
description:
- The state of the keytab file.
- V(present) only check for existence of a file, if you want to recreate keytab with other parameters you should set O(force=true).
- V(present) only check for existence of a file, if you want to recreate keytab with other parameters you should set
O(force=true).
type: str
default: present
choices: ["present", "absent"]
@ -95,9 +95,9 @@ requirements:
- Managed host is FreeIPA client
extends_documentation_fragment:
- community.general.attributes
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Get Kerberos ticket using default principal
community.general.krb_ticket:
password: "{{ aldpro_admin_password }}"
@ -121,7 +121,7 @@ EXAMPLES = r'''
principal: HTTP/freeipa-dc02.ipa.test
ipa_host: freeipa-dc01.ipa.test
force: true
'''
"""
import os

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_group
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA group
description:
- Add, modify and delete group within IPA server
- Add, modify and delete group within IPA server.
attributes:
check_mode:
support: full
@ -82,17 +81,16 @@ options:
version_added: 6.3.0
state:
description:
- State to ensure
- State to ensure.
default: "present"
choices: ["absent", "present"]
type: str
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure group is present
community.general.ipa_group:
name: oinstall
@ -162,14 +160,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
group:
description: Group as returned by IPA API
description: Group as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,8 +7,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_hbacrule
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA HBAC rule
@ -28,7 +27,7 @@ options:
aliases: ["name"]
type: str
description:
description: Description
description: Description.
type: str
host:
description:
@ -39,13 +38,13 @@ options:
type: list
elements: str
hostcategory:
description: Host category
description: Host category.
choices: ['all']
type: str
hostgroup:
description:
- List of hostgroup names to assign.
- If an empty list is passed all hostgroups will be removed. from the rule
- If an empty list is passed all hostgroups will be removed from the rule.
- If option is omitted hostgroups will not be checked or changed.
type: list
elements: str
@ -57,7 +56,7 @@ options:
type: list
elements: str
servicecategory:
description: Service category
description: Service category.
choices: ['all']
type: str
servicegroup:
@ -75,7 +74,7 @@ options:
type: list
elements: str
sourcehostcategory:
description: Source host category
description: Source host category.
choices: ['all']
type: str
sourcehostgroup:
@ -86,9 +85,9 @@ options:
type: list
elements: str
state:
description: State to ensure
description: State to ensure.
default: "present"
choices: ["absent", "disabled", "enabled","present"]
choices: ["absent", "disabled", "enabled", "present"]
type: str
user:
description:
@ -98,7 +97,7 @@ options:
type: list
elements: str
usercategory:
description: User category
description: User category.
choices: ['all']
type: str
usergroup:
@ -111,10 +110,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure rule to allow all users to access any host from any host
community.general.ipa_hbacrule:
name: allow_all
@ -147,14 +145,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
hbacrule:
description: HBAC rule as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,8 +7,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_host
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA host
@ -51,17 +50,17 @@ options:
elements: str
ns_host_location:
description:
- Host location (e.g. "Lab 2")
- Host location (for example V(Lab 2)).
aliases: ["nshostlocation"]
type: str
ns_hardware_platform:
description:
- Host hardware platform (e.g. "Lenovo T61")
- Host hardware platform (for example V(Lenovo T61")).
aliases: ["nshardwareplatform"]
type: str
ns_os_version:
description:
- Host operating system and version (e.g. "Fedora 9")
- Host operating system and version (for example V(Fedora 9)).
aliases: ["nsosversion"]
type: str
user_certificate:
@ -88,7 +87,7 @@ options:
update_dns:
description:
- If set V(true) with O(state=absent), then removes DNS records of the host managed by FreeIPA DNS.
- This option has no effect for states other than "absent".
- This option has no effect for states other than V(absent).
type: bool
random_password:
description: Generate a random password to be used in bulk enrollment.
@ -96,10 +95,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure host is present
community.general.ipa_host:
name: host01.example.com
@ -159,18 +157,18 @@ EXAMPLES = r'''
ipa_user: admin
ipa_pass: topsecret
update_dns: true
'''
"""
RETURN = r'''
RETURN = r"""
host:
description: Host as returned by IPA API.
returned: always
type: dict
host_diff:
description: List of options that differ and would be changed
description: List of options that differ and would be changed.
returned: if check mode and a difference is found
type: list
'''
"""
import traceback

View File

@ -7,8 +7,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_hostgroup
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA host-group
@ -65,9 +64,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure host-group databases is present
community.general.ipa_hostgroup:
name: databases
@ -88,14 +87,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
hostgroup:
description: Hostgroup as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_otpconfig
author: justchris1 (@justchris1)
short_description: Manage FreeIPA OTP Configuration Settings
@ -41,10 +40,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure the TOTP authentication window is set to 300 seconds
community.general.ipa_otpconfig:
ipatokentotpauthwindow: '300'
@ -72,14 +70,14 @@ EXAMPLES = r'''
ipa_host: localhost
ipa_user: admin
ipa_pass: supersecret
'''
"""
RETURN = r'''
RETURN = r"""
otpconfig:
description: OTP configuration as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,8 +7,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_otptoken
author: justchris1 (@justchris1)
short_description: Manage FreeIPA OTPs
@ -32,14 +31,14 @@ options:
otptype:
description:
- Type of OTP.
- "B(Note:) Cannot be modified after OTP is created."
- B(Note:) Cannot be modified after OTP is created.
type: str
choices: [ totp, hotp ]
choices: [totp, hotp]
secretkey:
description:
- Token secret (Base64).
- If OTP is created and this is not specified, a random secret will be generated by IPA.
- "B(Note:) Cannot be modified after OTP is created."
- B(Note:) Cannot be modified after OTP is created.
type: str
description:
description: Description of the token (informational only).
@ -55,13 +54,13 @@ options:
description:
- First date/time the token can be used.
- In the format C(YYYYMMddHHmmss).
- For example, C(20180121182022) will allow the token to be used starting on 21 January 2018 at 18:20:22.
- For example, V(20180121182022) will allow the token to be used starting on 21 January 2018 at 18:20:22.
type: str
notafter:
description:
- Last date/time the token can be used.
- In the format C(YYYYMMddHHmmss).
- For example, C(20200121182022) will allow the token to be used until 21 January 2020 at 18:20:22.
- For example, V(20200121182022) will allow the token to be used until 21 January 2020 at 18:20:22.
type: str
vendor:
description: Token vendor name (informational only).
@ -80,36 +79,36 @@ options:
algorithm:
description:
- Token hash algorithm.
- "B(Note:) Cannot be modified after OTP is created."
- B(Note:) Cannot be modified after OTP is created.
choices: ['sha1', 'sha256', 'sha384', 'sha512']
type: str
digits:
description:
- Number of digits each token code will have.
- "B(Note:) Cannot be modified after OTP is created."
choices: [ 6, 8 ]
- B(Note:) Cannot be modified after OTP is created.
choices: [6, 8]
type: int
offset:
description:
- TOTP token / IPA server time difference.
- "B(Note:) Cannot be modified after OTP is created."
- B(Note:) Cannot be modified after OTP is created.
type: int
interval:
description:
- Length of TOTP token code validity in seconds.
- "B(Note:) Cannot be modified after OTP is created."
- B(Note:) Cannot be modified after OTP is created.
type: int
counter:
description:
- Initial counter for the HOTP token.
- "B(Note:) Cannot be modified after OTP is created."
- B(Note:) Cannot be modified after OTP is created.
type: int
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Create a totp for pinky, allowing the IPA server to generate using defaults
community.general.ipa_otptoken:
uniqueid: Token123
@ -161,14 +160,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
otptoken:
description: OTP Token as returned by IPA API
description: OTP Token as returned by IPA API.
returned: always
type: dict
'''
"""
import base64
import traceback

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_pwpolicy
author: Adralioh (@adralioh)
short_description: Manage FreeIPA password policies
description:
- Add, modify, or delete a password policy using the IPA API.
- Add, modify, or delete a password policy using the IPA API.
version_added: 2.0.0
attributes:
check_mode:
@ -73,7 +72,8 @@ options:
type: int
version_added: 8.2.0
maxsequence:
description: Maximum length of monotonic character sequences in the new password. An example of a monotonic sequence of length 5 is V(12345).
description: Maximum length of monotonic character sequences in the new password. An example of a monotonic sequence of
length 5 is V(12345).
type: int
version_added: 8.2.0
dictcheck:
@ -81,15 +81,16 @@ options:
type: bool
version_added: 8.2.0
usercheck:
description: Check whether the password (with possible modifications) contains the user name in some form (if the name has > 3 characters).
description: Check whether the password (with possible modifications) contains the user name in some form (if the name
has > 3 characters).
type: bool
version_added: 8.2.0
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Modify the global password policy
community.general.ipa_pwpolicy:
maxpwdlife: '90'
@ -133,9 +134,9 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
pwpolicy:
description: Password policy as returned by IPA API.
returned: always
@ -152,7 +153,7 @@ pwpolicy:
krbpwdmaxfailure: ['4']
krbpwdmindiffchars: ['4']
objectclass: ['top', 'nscontainer', 'krbpwdpolicy']
'''
"""
import traceback

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_role
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA role
description:
- Add, modify and delete a role within FreeIPA server using FreeIPA API.
- Add, modify and delete a role within FreeIPA server using FreeIPA API.
attributes:
check_mode:
support: full
@ -86,10 +85,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure role is present
community.general.ipa_role:
name: dba
@ -125,14 +123,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
role:
description: Role as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_service
author: Cédric Parent (@cprh)
short_description: Manage FreeIPA service
description:
- Add and delete an IPA service using IPA API.
- Add and delete an IPA service using IPA API.
attributes:
check_mode:
support: full
@ -29,7 +28,7 @@ options:
type: str
hosts:
description:
- Defines the list of 'ManagedBy' hosts.
- Defines the list of C(ManagedBy) hosts.
required: false
type: list
elements: str
@ -55,10 +54,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure service is present
community.general.ipa_service:
name: http/host01.example.com
@ -84,14 +82,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
service:
description: Service as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_subca
author: Abhijeet Kasurde (@Akasurde)
short_description: Manage FreeIPA Lightweight Sub Certificate Authorities
description:
- Add, modify, enable, disable and delete an IPA Lightweight Sub Certificate Authorities using IPA API.
- Add, modify, enable, disable and delete an IPA Lightweight Sub Certificate Authorities using IPA API.
attributes:
check_mode:
support: full
@ -28,7 +27,7 @@ options:
type: str
subca_subject:
description:
- The Sub Certificate Authority's Subject. e.g., 'CN=SampleSubCA1,O=testrelm.test'.
- The Sub Certificate Authority's Subject, for example V(CN=SampleSubCA1,O=testrelm.test).
required: true
type: str
subca_desc:
@ -38,7 +37,7 @@ options:
state:
description:
- State to ensure.
- State 'disable' and 'enable' is available for FreeIPA 4.4.2 version and onwards.
- States V(disable) and V(enable) are available for FreeIPA 4.4.2 version and onwards.
required: false
default: present
choices: ["absent", "disabled", "enabled", "present"]
@ -46,10 +45,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = '''
EXAMPLES = r"""
- name: Ensure IPA Sub CA is present
community.general.ipa_subca:
ipa_host: spider.example.com
@ -72,14 +70,14 @@ EXAMPLES = '''
ipa_pass: Passw0rd!
state: disable
subca_name: AnsibleSubCA1
'''
"""
RETURN = r'''
RETURN = r"""
subca:
description: IPA Sub CA record as returned by IPA API.
returned: always
type: dict
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ipa import IPAClient, ipa_argument_spec

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_sudocmd
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA sudo command
description:
- Add, modify or delete sudo command within FreeIPA server using FreeIPA API.
- Add, modify or delete sudo command within FreeIPA server using FreeIPA API.
attributes:
check_mode:
support: full
@ -38,10 +37,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure sudo command exists
community.general.ipa_sudocmd:
name: su
@ -57,14 +55,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
sudocmd:
description: Sudo command as return from IPA API
description: Sudo command as return from IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_sudocmdgroup
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA sudo command group
description:
- Add, modify or delete sudo command group within IPA server using IPA API.
- Add, modify or delete sudo command group within IPA server using IPA API.
attributes:
check_mode:
support: full
@ -45,10 +44,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure sudo command group exists
community.general.ipa_sudocmdgroup:
name: group01
@ -66,14 +64,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
sudocmdgroup:
description: Sudo command group as returned by IPA API
description: Sudo command group as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_sudorule
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA sudo rule
description:
- Add, modify or delete sudo rule within IPA server using IPA API.
- Add, modify or delete sudo rule within IPA server using IPA API.
attributes:
check_mode:
support: full
@ -92,7 +91,7 @@ options:
elements: str
runasextusers:
description:
- List of external RunAs users
- List of external RunAs users.
type: list
elements: str
version_added: 2.3.0
@ -138,11 +137,11 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
- name: Ensure sudo rule is present that's allows all every body to execute any command on any host without being asked for a password.
EXAMPLES = r"""
- name: Ensure sudo rule is present that's allows all every body to execute any command on any host without being asked
for a password.
community.general.ipa_sudorule:
name: sudo_all_nopasswd
cmdcategory: all
@ -188,14 +187,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
sudorule:
description: Sudorule as returned by IPA
description: Sudorule as returned by IPA.
returned: always
type: dict
'''
"""
import traceback

View File

@ -7,13 +7,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_user
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA users
description:
- Add, modify and delete user within IPA server.
- Add, modify and delete user within IPA server.
attributes:
check_mode:
support: full
@ -28,7 +27,7 @@ options:
- Set password for a user.
type: str
default: 'always'
choices: [ always, on_create ]
choices: [always, on_create]
givenname:
description:
- First name.
@ -38,7 +37,7 @@ options:
description:
- Date at which the user password will expire.
- In the format YYYYMMddHHmmss.
- e.g. 20180121182022 will expire on 21 January 2018 at 18:20:22.
- For example V(20180121182022) will expire on 21 January 2018 at 18:20:22.
type: str
loginshell:
description: Login shell.
@ -83,7 +82,7 @@ options:
description: Title.
type: str
uid:
description: uid of the user.
description: Uid of the user.
required: true
aliases: ["name"]
type: str
@ -114,11 +113,11 @@ extends_documentation_fragment:
- community.general.attributes
requirements:
- base64
- hashlib
'''
- base64
- hashlib
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure pinky is present and always reset password
community.general.ipa_user:
name: pinky
@ -170,14 +169,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
user:
description: User as returned by IPA API
description: User as returned by IPA API.
returned: always
type: dict
'''
"""
import base64
import hashlib

View File

@ -7,14 +7,13 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipa_vault
author: Juan Manuel Parrilla (@jparrill)
short_description: Manage FreeIPA vaults
description:
- Add, modify and delete vaults and secret vaults.
- KRA service should be enabled to use this module.
- Add, modify and delete vaults and secret vaults.
- KRA service should be enabled to use this module.
attributes:
check_mode:
support: full
@ -52,14 +51,14 @@ options:
username:
description:
- Any user can own one or more user vaults.
- Mutually exclusive with service.
- Mutually exclusive with O(service).
aliases: ["user"]
type: list
elements: str
service:
description:
- Any service can own one or more service vaults.
- Mutually exclusive with user.
- Mutually exclusive with O(user).
type: str
state:
description:
@ -81,10 +80,9 @@ options:
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes
"""
'''
EXAMPLES = r'''
EXAMPLES = r"""
- name: Ensure vault is present
community.general.ipa_vault:
name: vault01
@ -128,14 +126,14 @@ EXAMPLES = r'''
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: topsecret
'''
"""
RETURN = r'''
RETURN = r"""
vault:
description: Vault as returned by IPA API
description: Vault as returned by IPA API.
returned: always
type: dict
'''
"""
import traceback

View File

@ -8,13 +8,12 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: "ipbase_info"
version_added: "7.0.0"
short_description: "Retrieve IP geolocation and other facts of a host's IP address using the ipbase.com API"
description:
- "Retrieve IP geolocation and other facts of a host's IP address using the ipbase.com API"
- Retrieve IP geolocation and other facts of a host's IP address using the ipbase.com API.
author: "Dominik Kukacka (@dominikkukacka)"
extends_documentation_fragment:
- "community.general.attributes"
@ -22,31 +21,31 @@ extends_documentation_fragment:
options:
ip:
description:
- "The IP you want to get the info for. If not specified the API will detect the IP automatically."
- The IP you want to get the info for. If not specified the API will detect the IP automatically.
required: false
type: str
apikey:
description:
- "The API key for the request if you need more requests."
- The API key for the request if you need more requests.
required: false
type: str
hostname:
description:
- "If the O(hostname) parameter is set to V(true), the API response will contain the hostname of the IP."
- If the O(hostname) parameter is set to V(true), the API response will contain the hostname of the IP.
required: false
type: bool
default: false
language:
description:
- "An ISO Alpha 2 Language Code for localizing the IP data"
- An ISO Alpha 2 Language Code for localizing the IP data.
required: false
type: str
default: "en"
notes:
- "Check U(https://ipbase.com/) for more information."
'''
- Check U(https://ipbase.com/) for more information.
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: "Get IP geolocation information of the primary outgoing IP"
community.general.ipbase_info:
register: my_ip_info
@ -64,12 +63,12 @@ EXAMPLES = '''
hostname: true
language: "de"
register: my_ip_info
"""
'''
RETURN = '''
RETURN = r"""
data:
description: "JSON parsed response from ipbase.com. Please refer to U(https://ipbase.com/docs/info) for the detailed structure of the response."
description: "JSON parsed response from ipbase.com. Please refer to U(https://ipbase.com/docs/info) for the detailed structure
of the response."
returned: success
type: dict
sample: {
@ -213,7 +212,7 @@ data:
]
}
}
'''
"""
from ansible.module_utils.basic import AnsibleModule

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: ipify_facts
short_description: Retrieve the public IP of your internet gateway
description:
- If behind NAT and need to know the public IP of your internet gateway.
author:
- René Moser (@resmo)
- René Moser (@resmo)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
@ -40,9 +39,9 @@ options:
default: true
notes:
- Visit https://www.ipify.org to get more information.
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
# Gather IP facts from ipify.org
- name: Get my public IP
community.general.ipify_facts:
@ -52,16 +51,15 @@ EXAMPLES = r'''
community.general.ipify_facts:
api_url: http://api.example.com/ipify
timeout: 20
'''
"""
RETURN = r'''
---
RETURN = r"""
ipify_public_ip:
description: Public IP of the internet gateway.
returned: success
type: str
sample: 1.2.3.4
'''
"""
import json

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: ipinfoio_facts
short_description: Retrieve IP geolocation facts of a host's IP address
description:
- "Gather IP geolocation facts of a host's IP address using ipinfo.io API"
- Gather IP geolocation facts of a host's IP address using ipinfo.io API.
author: "Aleksei Kostiuk (@akostyuk)"
extends_documentation_fragment:
- community.general.attributes
@ -23,65 +22,65 @@ extends_documentation_fragment:
options:
timeout:
description:
- HTTP connection timeout in seconds
- HTTP connection timeout in seconds.
required: false
default: 10
type: int
http_agent:
description:
- Set http user agent
- Set http user agent.
required: false
default: "ansible-ipinfoio-module/0.0.1"
type: str
notes:
- "Check http://ipinfo.io/ for more information"
'''
- Check http://ipinfo.io/ for more information.
"""
EXAMPLES = '''
EXAMPLES = r"""
# Retrieve geolocation data of a host's IP address
- name: Get IP geolocation data
community.general.ipinfoio_facts:
'''
"""
RETURN = '''
RETURN = r"""
ansible_facts:
description: "Dictionary of ip geolocation facts for a host's IP address"
description: "Dictionary of ip geolocation facts for a host's IP address."
returned: changed
type: complex
contains:
ip:
description: "Public IP address of a host"
description: "Public IP address of a host."
type: str
sample: "8.8.8.8"
hostname:
description: Domain name
description: Domain name.
type: str
sample: "google-public-dns-a.google.com"
country:
description: ISO 3166-1 alpha-2 country code
description: ISO 3166-1 alpha-2 country code.
type: str
sample: "US"
region:
description: State or province name
description: State or province name.
type: str
sample: "California"
city:
description: City name
description: City name.
type: str
sample: "Mountain View"
loc:
description: Latitude and Longitude of the location
description: Latitude and Longitude of the location.
type: str
sample: "37.3860,-122.0838"
org:
description: "organization's name"
description: "Organization's name."
type: str
sample: "AS3356 Level 3 Communications, Inc."
postal:
description: Postal code
description: Postal code.
type: str
sample: "94035"
'''
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: ipmi_boot
short_description: Management of order of boot devices
description:
- Use this module to manage order of boot devices
- Use this module to manage order of boot devices.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -52,14 +51,14 @@ options:
bootdev:
description:
- Set boot device to use on next reboot
- "The choices for the device are:
- network -- Request network boot
- floppy -- Boot from floppy
- hd -- Boot from hard drive
- safe -- Boot from hard drive, requesting 'safe mode'
- optical -- boot from CD/DVD/BD drive
- setup -- Boot into setup utility
- default -- remove any IPMI directed boot device request"
- "The choices for the device are:"
- V(network) -- Request network boot
- V(floppy) -- Boot from floppy
- V(hd) -- Boot from hard drive
- "V(safe) -- Boot from hard drive, requesting 'safe mode'"
- V(optical) -- boot from CD/DVD/BD drive
- V(setup) -- Boot into setup utility
- V(default) -- remove any IPMI directed boot device request
required: true
choices:
- network
@ -73,31 +72,28 @@ options:
state:
description:
- Whether to ensure that boot devices is desired.
- "The choices for the state are:
- present -- Request system turn on
- absent -- Request system turn on"
- 'The choices for the state are: - present -- Request system turn on - absent -- Request system turn on.'
default: present
choices: [ present, absent ]
choices: [present, absent]
type: str
persistent:
description:
- If set, ask that system firmware uses this device beyond next boot.
Be aware many systems do not honor this.
- If set, ask that system firmware uses this device beyond next boot. Be aware many systems do not honor this.
type: bool
default: false
uefiboot:
description:
- If set, request UEFI boot explicitly.
Strictly speaking, the spec suggests that if not set, the system should BIOS boot and offers no "don't care" option.
In practice, this flag not being set does not preclude UEFI boot on any system I've encountered.
- If set, request UEFI boot explicitly. Strictly speaking, the spec suggests that if not set, the system should BIOS
boot and offers no "do not care" option. In practice, this flag not being set does not preclude UEFI boot on any system
I have encountered.
type: bool
default: false
requirements:
- pyghmi
author: "Bulat Gaifullin (@bgaifullin) <gaifullinbf@gmail.com>"
'''
"""
RETURN = '''
RETURN = r"""
bootdev:
description: The boot device name which will be used beyond next boot.
returned: success
@ -113,9 +109,9 @@ uefimode:
returned: success
type: bool
sample: false
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Ensure bootdevice is HD
community.general.ipmi_boot:
name: test.testdomain.com
@ -131,7 +127,7 @@ EXAMPLES = '''
key: 1234567890AABBCCDEFF000000EEEE12
bootdev: network
state: absent
'''
"""
import traceback
import binascii

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: ipmi_power
short_description: Power management for machine
description:
- Use this module for power management
- Use this module for power management.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -52,12 +51,12 @@ options:
state:
description:
- Whether to ensure that the machine in desired state.
- "The choices for state are:
- on -- Request system turn on
- off -- Request system turn off without waiting for OS to shutdown
- shutdown -- Have system request OS proper shutdown
- reset -- Request system reset without waiting for OS
- boot -- If system is off, then 'on', else 'reset'"
- "The choices for state are:"
- V(on) -- Request system turn on
- V(off) -- Request system turn off without waiting for OS to shutdown
- V(shutdown) -- Have system request OS proper shutdown
- V(reset) -- Request system reset without waiting for OS
- "V(boot) -- If system is off, then V(on), else V(reset)"
- Either this option or O(machine) is required.
choices: ['on', 'off', shutdown, reset, boot]
type: str
@ -68,8 +67,7 @@ options:
type: int
machine:
description:
- Provide a list of the remote target address for the bridge IPMI request,
and the power status.
- Provide a list of the remote target address for the bridge IPMI request, and the power status.
- Either this option or O(state) is required.
required: false
type: list
@ -92,9 +90,9 @@ options:
requirements:
- pyghmi
author: "Bulat Gaifullin (@bgaifullin) <gaifullinbf@gmail.com>"
'''
"""
RETURN = '''
RETURN = r"""
powerstate:
description: The current power state of the machine.
returned: success and O(machine) is not provided
@ -113,19 +111,10 @@ status:
targetAddress:
description: The remote target address.
type: int
sample: [
{
"powerstate": "on",
"targetAddress": 48,
},
{
"powerstate": "on",
"targetAddress": 50,
},
]
'''
sample: [{"powerstate": "on", "targetAddress": 48}, {"powerstate": "on", "targetAddress": 50}]
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Ensure machine is powered on
community.general.ipmi_power:
name: test.testdomain.com
@ -153,7 +142,7 @@ EXAMPLES = '''
state: 'on'
- targetAddress: 50
state: 'off'
'''
"""
import traceback
import binascii

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: iptables_state
short_description: Save iptables state into a file or restore it from a file
version_added: '1.1.0'
@ -19,26 +18,17 @@ extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.flow
description:
- C(iptables) is used to set up, maintain, and inspect the tables of IP
packet filter rules in the Linux kernel.
- This module handles the saving and/or loading of rules. This is the same
as the behaviour of the C(iptables-save) and C(iptables-restore) (or
C(ip6tables-save) and C(ip6tables-restore) for IPv6) commands which this
module uses internally.
- Modifying the state of the firewall remotely may lead to loose access to
the host in case of mistake in new ruleset. This module embeds a rollback
feature to avoid this, by telling the host to restore previous rules if a
cookie is still there after a given delay, and all this time telling the
controller to try to remove this cookie on the host through a new
connection.
- C(iptables) is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.
- This module handles the saving and/or loading of rules. This is the same as the behaviour of the C(iptables-save) and
C(iptables-restore) (or C(ip6tables-save) and C(ip6tables-restore) for IPv6) commands which this module uses internally.
- Modifying the state of the firewall remotely may lead to loose access to the host in case of mistake in new ruleset. This
module embeds a rollback feature to avoid this, by telling the host to restore previous rules if a cookie is still there
after a given delay, and all this time telling the controller to try to remove this cookie on the host through a new connection.
notes:
- The rollback feature is not a module option and depends on task's
attributes. To enable it, the module must be played asynchronously, i.e.
by setting task attributes C(poll) to V(0), and C(async) to a value less
or equal to C(ANSIBLE_TIMEOUT). If C(async) is greater, the rollback will
still happen if it shall happen, but you will experience a connection
timeout instead of more relevant info returned by the module after its
failure.
- The rollback feature is not a module option and depends on task's attributes. To enable it, the module must be played
asynchronously, in other words by setting task attributes C(poll) to V(0), and C(async) to a value less or equal to C(ANSIBLE_TIMEOUT).
If C(async) is greater, the rollback will still happen if it shall happen, but you will experience a connection timeout
instead of more relevant info returned by the module after its failure.
attributes:
check_mode:
support: full
@ -59,22 +49,18 @@ options:
description:
- Which version of the IP protocol this module should apply to.
type: str
choices: [ ipv4, ipv6 ]
choices: [ipv4, ipv6]
default: ipv4
modprobe:
description:
- Specify the path to the C(modprobe) program internally used by iptables
related commands to load kernel modules.
- By default, V(/proc/sys/kernel/modprobe) is inspected to determine the
executable's path.
- Specify the path to the C(modprobe) program internally used by iptables related commands to load kernel modules.
- By default, V(/proc/sys/kernel/modprobe) is inspected to determine the executable's path.
type: path
noflush:
description:
- For O(state=restored), ignored otherwise.
- If V(false), restoring iptables rules from a file flushes (deletes)
all previous contents of the respective table(s). If V(true), the
previous rules are left untouched (but policies are updated anyway,
for all built-in chains).
- If V(false), restoring iptables rules from a file flushes (deletes) all previous contents of the respective table(s).
If V(true), the previous rules are left untouched (but policies are updated anyway, for all built-in chains).
type: bool
default: false
path:
@ -85,29 +71,26 @@ options:
required: true
state:
description:
- Whether the firewall state should be saved (into a file) or restored
(from a file).
- Whether the firewall state should be saved (into a file) or restored (from a file).
type: str
choices: [ saved, restored ]
choices: [saved, restored]
required: true
table:
description:
- When O(state=restored), restore only the named table even if the input
file contains other tables. Fail if the named table is not declared in
the file.
- When O(state=saved), restrict output to the specified table. If not
specified, output includes all active tables.
- When O(state=restored), restore only the named table even if the input file contains other tables. Fail if the named
table is not declared in the file.
- When O(state=saved), restrict output to the specified table. If not specified, output includes all active tables.
type: str
choices: [ filter, nat, mangle, raw, security ]
choices: [filter, nat, mangle, raw, security]
wait:
description:
- Wait N seconds for the xtables lock to prevent instant failure in case
multiple instances of the program are running concurrently.
- Wait N seconds for the xtables lock to prevent instant failure in case multiple instances of the program are running
concurrently.
type: int
requirements: [iptables, ip6tables]
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
# This will apply to all loaded/active IPv4 tables.
- name: Save current state of the firewall in system file
community.general.iptables_state:
@ -151,9 +134,9 @@ EXAMPLES = r'''
- name: show current state of the firewall
ansible.builtin.debug:
var: iptables_state.initial_state
'''
"""
RETURN = r'''
RETURN = r"""
applied:
description: Whether or not the wanted state has been successfully restored.
type: bool
@ -235,7 +218,7 @@ tables:
]
}
returned: always
'''
"""
import re

View File

@ -8,23 +8,20 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: ipwcli_dns
short_description: Manage DNS Records for Ericsson IPWorks via ipwcli
short_description: Manage DNS Records for Ericsson IPWorks using C(ipwcli)
version_added: '0.2.0'
description:
- "Manage DNS records for the Ericsson IPWorks DNS server. The module will use the ipwcli to deploy the DNS records."
- Manage DNS records for the Ericsson IPWorks DNS server. The module will use the C(ipwcli) to deploy the DNS records.
requirements:
- ipwcli (installed on Ericsson IPWorks)
notes:
- To make the DNS record changes effective, you need to run C(update dnsserver) on the ipwcli.
extends_documentation_fragment:
- community.general.attributes
@ -45,7 +42,7 @@ options:
- Type of the record.
required: true
type: str
choices: [ NAPTR, SRV, A, AAAA ]
choices: [NAPTR, SRV, A, AAAA]
container:
description:
- Sets the container zone for the record.
@ -65,7 +62,7 @@ options:
description:
- Whether the record should exist or not.
type: str
choices: [ absent, present ]
choices: [absent, present]
default: present
priority:
description:
@ -126,9 +123,9 @@ options:
author:
- Christian Wollinger (@cwollinger)
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create A record
community.general.ipwcli_dns:
dnsname: example.com
@ -157,14 +154,14 @@ EXAMPLES = '''
service: 'SIP+D2T'
replacement: '_sip._tcp.test.example.com.'
flags: S
'''
"""
RETURN = '''
RETURN = r"""
record:
description: The created record from the input params
description: The created record from the input params.
type: str
returned: always
'''
"""
from ansible.module_utils.basic import AnsibleModule

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: irc
short_description: Send a message to an IRC channel or a nick
description:
@ -26,12 +25,12 @@ options:
server:
type: str
description:
- IRC server name/address
- IRC server name/address.
default: localhost
port:
type: int
description:
- IRC server port number
- IRC server port number.
default: 6667
nick:
type: str
@ -46,14 +45,14 @@ options:
topic:
type: str
description:
- Set the channel topic
- Set the channel topic.
color:
type: str
description:
- Text color for the message.
default: "none"
choices: [ "none", "white", "black", "blue", "green", "red", "brown", "purple", "orange", "yellow", "light_green", "teal", "light_cyan",
"light_blue", "pink", "gray", "light_gray"]
choices: ["none", "white", "black", "blue", "green", "red", "brown", "purple", "orange", "yellow", "light_green", "teal",
"light_cyan", "light_blue", "pink", "gray", "light_gray"]
aliases: [colour]
channel:
type: str
@ -63,28 +62,27 @@ options:
type: list
elements: str
description:
- A list of nicknames to send the message to. One of nick_to or channel needs to be set. When both are defined, the message will be sent to both of them.
- A list of nicknames to send the message to. One of nick_to or channel needs to be set. When both are defined, the
message will be sent to both of them.
key:
type: str
description:
- Channel key
- Channel key.
passwd:
type: str
description:
- Server password
- Server password.
timeout:
type: int
description:
- Timeout to use while waiting for successful registration and join
messages, this is to prevent an endless loop
- Timeout to use while waiting for successful registration and join messages, this is to prevent an endless loop.
default: 30
use_tls:
description:
- Designates whether TLS/SSL should be used when connecting to the IRC server
- O(use_tls) is available since community.general 8.1.0, before the option
was exlusively called O(use_ssl). The latter is now an alias of O(use_tls).
- B(Note:) for security reasons, you should always set O(use_tls=true) and
O(validate_certs=true) whenever possible.
- Designates whether TLS/SSL should be used when connecting to the IRC server.
- O(use_tls) is available since community.general 8.1.0, before the option was exlusively called O(use_ssl). The latter
is now an alias of O(use_tls).
- B(Note:) for security reasons, you should always set O(use_tls=true) and O(validate_certs=true) whenever possible.
- The default of this option changed to V(true) in community.general 10.0.0.
type: bool
default: true
@ -92,36 +90,35 @@ options:
- use_ssl
part:
description:
- Designates whether user should part from channel after sending message or not.
Useful for when using a faux bot and not wanting join/parts between messages.
- Designates whether user should part from channel after sending message or not. Useful for when using a mock bot and
not wanting join/parts between messages.
type: bool
default: true
style:
type: str
description:
- Text style for the message. Note italic does not work on some clients
choices: [ "bold", "underline", "reverse", "italic", "none" ]
- Text style for the message. Note italic does not work on some clients.
choices: ["bold", "underline", "reverse", "italic", "none"]
default: none
validate_certs:
description:
- If set to V(false), the SSL certificates will not be validated.
- This should always be set to V(true). Using V(false) is unsafe and should only be done
if the network between between Ansible and the IRC server is known to be safe.
- B(Note:) for security reasons, you should always set O(use_tls=true) and
O(validate_certs=true) whenever possible.
- This should always be set to V(true). Using V(false) is unsafe and should only be done if the network between between
Ansible and the IRC server is known to be safe.
- B(Note:) for security reasons, you should always set O(use_tls=true) and O(validate_certs=true) whenever possible.
- The default of this option changed to V(true) in community.general 10.0.0.
type: bool
default: true
version_added: 8.1.0
# informational: requirements for nodes
requirements: [ socket ]
requirements: [socket]
author:
- "Jan-Piet Mens (@jpmens)"
- "Matt Martz (@sivel)"
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Send a message to an IRC channel from nick ansible
community.general.irc:
server: irc.example.net
@ -156,7 +153,7 @@ EXAMPLES = '''
msg: 'All finished at {{ ansible_date_time.iso8601 }}'
color: red
nick: ansibleIRC
'''
"""
# ===========================================
# IRC module support methods.

View File

@ -9,8 +9,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: iso_create
short_description: Generate ISO file with specified files or folders
description:
@ -35,9 +34,9 @@ options:
description:
- This is a list of absolute paths of source files or folders which will be contained in the new generated ISO file.
- Will fail if specified file or folder in O(src_files) does not exist on local machine.
- 'Note: With all ISO9660 levels from 1 to 3, all file names are restricted to uppercase letters, numbers and
underscores (_). File names are limited to 31 characters, directory nesting is limited to 8 levels, and path
names are limited to 255 characters.'
- 'Note: With all ISO9660 levels from 1 to 3, all file names are restricted to uppercase letters, numbers and underscores
(_). File names are limited to 31 characters, directory nesting is limited to 8 levels, and path names are limited
to 255 characters.'
type: list
required: true
elements: path
@ -82,9 +81,9 @@ options:
- If not specified or set to V(false), then no UDF support is added.
type: bool
default: false
'''
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Create an ISO file
community.general.iso_create:
src_files:
@ -109,9 +108,9 @@ EXAMPLES = r'''
interchange_level: 3
joliet: 3
vol_ident: WIN_AUTOINSTALL
'''
"""
RETURN = r'''
RETURN = r"""
source_file:
description: Configured source files or directories list.
returned: on success
@ -148,7 +147,7 @@ udf:
returned: on success
type: bool
sample: false
'''
"""
import os
import traceback

View File

@ -9,8 +9,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: iso_customize
short_description: Add/remove/change files in ISO file
description:
@ -69,14 +68,13 @@ options:
type: str
required: true
notes:
- The C(pycdlib) library states it supports Python 2.7 and 3.4+.
- >
The function C(add_file) in pycdlib will overwrite the existing file in ISO with type ISO9660 / Rock Ridge 1.12 / Joliet / UDF.
But it will not overwrite the existing file in ISO with Rock Ridge 1.09 / 1.10.
So we take workaround "delete the existing file and then add file for ISO with Rock Ridge".
'''
- The C(pycdlib) library states it supports Python 2.7 and 3.4+.
- The function C(add_file) in pycdlib will overwrite the existing file in ISO with type ISO9660 / Rock Ridge 1.12 / Joliet
/ UDF. But it will not overwrite the existing file in ISO with Rock Ridge 1.09 / 1.10. So we take workaround "delete the
existing file and then add file for ISO with Rock Ridge".
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: "Customize ISO file"
community.general.iso_customize:
src_iso: "/path/to/ubuntu-22.04-desktop-amd64.iso"
@ -89,9 +87,9 @@ EXAMPLES = r'''
- src_file: "/path/to/ubuntu.seed"
dest_file: "/preseed/ubuntu.seed"
register: customize_iso_result
'''
"""
RETURN = r'''
RETURN = r"""
src_iso:
description: Path of source ISO file.
returned: on success
@ -102,7 +100,7 @@ dest_iso:
returned: on success
type: str
sample: "/path/to/customized.iso"
'''
"""
import os

View File

@ -11,8 +11,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
author:
- Jeroen Hoekx (@jhoekx)
- Matt Robinson (@ribbons)
@ -21,12 +20,10 @@ module: iso_extract
short_description: Extract files from an ISO image
description:
- This module has two possible ways of operation.
- If 7zip is installed on the system, this module extracts files from an ISO
into a temporary directory and copies files to a given destination,
if needed.
- If the user has mount-capabilities (CAP_SYS_ADMIN on Linux) this module
mounts the ISO image to a temporary location, and copies files to a given
destination, if needed.
- If 7zip is installed on the system, this module extracts files from an ISO into a temporary directory and copies files
to a given destination, if needed.
- If the user has mount-capabilities (CAP_SYS_ADMIN on Linux) this module mounts the ISO image to a temporary location,
and copies files to a given destination, if needed.
requirements:
- Either 7z (from C(7zip) or C(p7zip) package)
- Or mount capabilities (root-access, or CAP_SYS_ADMIN capability on Linux)
@ -43,7 +40,7 @@ options:
- The ISO image to extract files from.
type: path
required: true
aliases: [ path, src ]
aliases: [path, src]
dest:
description:
- The destination directory to extract files to.
@ -71,17 +68,16 @@ options:
description:
- Password used to decrypt files from the ISO.
- Will only be used if 7z is used.
- The password is used as a command line argument to 7z. This is a B(potential security risk) that
allows passwords to be revealed if someone else can list running processes on the same machine
in the right moment.
- The password is used as a command line argument to 7z. This is a B(potential security risk) that allows passwords
to be revealed if someone else can list running processes on the same machine in the right moment.
type: str
version_added: 10.1.0
notes:
- Only the file checksum (content) is taken into account when extracting files
from the ISO image. If O(force=false), only checks the presence of the file.
'''
- Only the file checksum (content) is taken into account when extracting files from the ISO image. If O(force=false), only
checks the presence of the file.
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Extract kernel and ramdisk from a LiveCD
community.general.iso_extract:
image: /tmp/rear-test.iso
@ -89,11 +85,11 @@ EXAMPLES = r'''
files:
- isolinux/kernel
- isolinux/initrd.cgz
'''
"""
RETURN = r'''
RETURN = r"""
#
'''
"""
import os.path
import shutil

View File

@ -9,12 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: jabber
short_description: Send a message to jabber user or chat room
description:
- Send a message to jabber
- Send a message to jabber.
extends_documentation_fragment:
- community.general.attributes
attributes:
@ -26,17 +25,17 @@ options:
user:
type: str
description:
- User as which to connect
- User as which to connect.
required: true
password:
type: str
description:
- password for user to connect
- Password for user to connect.
required: true
to:
type: str
description:
- user ID or name of the room, when using room use a slash to indicate your nick.
- User ID or name of the room, when using room use a slash to indicate your nick.
required: true
msg:
type: str
@ -46,24 +45,22 @@ options:
host:
type: str
description:
- host to connect, overrides user info
- Host to connect, overrides user info.
port:
type: int
description:
- port to connect to, overrides default
- Port to connect to, overrides default.
default: 5222
encoding:
type: str
description:
- message encoding
# informational: requirements for nodes
- Message encoding.
requirements:
- python xmpp (xmpppy)
author: "Brian Coca (@bcoca)"
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Send a message to a user
community.general.jabber:
user: mybot@example.net
@ -86,7 +83,7 @@ EXAMPLES = '''
password: secret
to: mychaps@example.net
msg: Ansible task finished
'''
"""
import time
import traceback

View File

@ -8,14 +8,13 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
DOCUMENTATION = r"""
module: java_cert
short_description: Uses keytool to import/remove certificate to/from java keystore (cacerts)
description:
- This is a wrapper module around keytool, which can be used to import certificates
and optionally private keys to a given java keystore, or remove them from it.
- This is a wrapper module around keytool, which can be used to import certificates and optionally private keys to a given
java keystore, or remove them from it.
extends_documentation_fragment:
- community.general.attributes
- ansible.builtin.files
@ -61,9 +60,8 @@ options:
pkcs12_path:
description:
- Local path to load PKCS12 keystore from.
- Unlike O(cert_url), O(cert_path) and O(cert_content), the PKCS12 keystore embeds the private key matching
the certificate, and is used to import both the certificate and its private key into the
java keystore.
- Unlike O(cert_url), O(cert_path) and O(cert_content), the PKCS12 keystore embeds the private key matching the certificate,
and is used to import both the certificate and its private key into the java keystore.
- Exactly one of O(cert_url), O(cert_path), O(cert_content), or O(pkcs12_path) is required to load certificate.
type: path
pkcs12_password:
@ -100,10 +98,10 @@ options:
state:
description:
- Defines action which can be either certificate import or removal.
- When state is present, the certificate will always idempotently be inserted
into the keystore, even if there already exists a cert alias that is different.
- When state is present, the certificate will always idempotently be inserted into the keystore, even if there already
exists a cert alias that is different.
type: str
choices: [ absent, present ]
choices: [absent, present]
default: present
mode:
version_added: 8.5.0
@ -125,10 +123,10 @@ options:
version_added: 8.5.0
requirements: [openssl, keytool]
author:
- Adam Hamsik (@haad)
'''
- Adam Hamsik (@haad)
"""
EXAMPLES = r'''
EXAMPLES = r"""
- name: Import SSL certificate from google.com to a given cacerts keystore
community.general.java_cert:
cert_url: google.com
@ -196,9 +194,9 @@ EXAMPLES = r'''
keystore_pass: changeit
keystore_create: true
state: present
'''
"""
RETURN = r'''
RETURN = r"""
msg:
description: Output from stdout of keytool command after execution of given command.
returned: success
@ -216,7 +214,7 @@ cmd:
returned: success
type: str
sample: "keytool -importcert -noprompt -keystore"
'''
"""
import os
import tempfile

View File

@ -10,8 +10,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: java_keystore
short_description: Create a Java keystore in JKS format
description:
@ -25,25 +24,22 @@ options:
name:
description:
- Name of the certificate in the keystore.
- If the provided name does not exist in the keystore, the module
will re-create the keystore. This behavior changed in community.general 3.0.0,
before that the module would fail when the name did not match.
- If the provided name does not exist in the keystore, the module will re-create the keystore. This behavior changed
in community.general 3.0.0, before that the module would fail when the name did not match.
type: str
required: true
certificate:
description:
- Content of the certificate used to create the keystore.
- If the fingerprint of the provided certificate does not match the
fingerprint of the certificate bundled in the keystore, the keystore
is regenerated with the provided certificate.
- If the fingerprint of the provided certificate does not match the fingerprint of the certificate bundled in the keystore,
the keystore is regenerated with the provided certificate.
- Exactly one of O(certificate) or O(certificate_path) is required.
type: str
certificate_path:
description:
- Location of the certificate used to create the keystore.
- If the fingerprint of the provided certificate does not match the
fingerprint of the certificate bundled in the keystore, the keystore
is regenerated with the provided certificate.
- If the fingerprint of the provided certificate does not match the fingerprint of the certificate bundled in the keystore,
the keystore is regenerated with the provided certificate.
- Exactly one of O(certificate) or O(certificate_path) is required.
type: path
version_added: '3.0.0'
@ -66,10 +62,8 @@ options:
password:
description:
- Password that should be used to secure the keystore.
- If the provided password fails to unlock the keystore, the module
will re-create the keystore with the new passphrase. This behavior
changed in community.general 3.0.0, before that the module would fail
when the password did not match.
- If the provided password fails to unlock the keystore, the module will re-create the keystore with the new passphrase.
This behavior changed in community.general 3.0.0, before that the module would fail when the password did not match.
type: str
required: true
dest:
@ -106,16 +100,13 @@ options:
keystore_type:
description:
- Type of the Java keystore.
- When this option is omitted and the keystore doesn't already exist, the
behavior follows C(keytool)'s default store type which depends on
Java version; V(pkcs12) since Java 9 and V(jks) prior (may also
be V(pkcs12) if new default has been backported to this version).
- When this option is omitted and the keystore already exists, the current
type is left untouched, unless another option leads to overwrite the
keystore (in that case, this option behaves like for keystore creation).
- When O(keystore_type) is set, the keystore is created with this type if
it does not already exist, or is overwritten to match the given type in
case of mismatch.
- When this option is omitted and the keystore does not already exist, the behavior follows C(keytool)'s default store
type which depends on Java version; V(pkcs12) since Java 9 and V(jks) prior (may also be V(pkcs12) if new default
has been backported to this version).
- When this option is omitted and the keystore already exists, the current type is left untouched, unless another option
leads to overwrite the keystore (in that case, this option behaves like for keystore creation).
- When O(keystore_type) is set, the keystore is created with this type if it does not already exist, or is overwritten
to match the given type in case of mismatch.
type: str
choices:
- jks
@ -135,16 +126,14 @@ seealso:
- module: community.crypto.openssl_pkcs12
- module: community.general.java_cert
notes:
- O(certificate) and O(private_key) require that their contents are available
on the controller (either inline in a playbook, or with the P(ansible.builtin.file#lookup) lookup),
while O(certificate_path) and O(private_key_path) require that the files are
available on the target host.
- By design, any change of a value of options O(keystore_type), O(name) or
O(password), as well as changes of key or certificate materials will cause
the existing O(dest) to be overwritten.
'''
- O(certificate) and O(private_key) require that their contents are available on the controller (either inline in a playbook,
or with the P(ansible.builtin.file#lookup) lookup), while O(certificate_path) and O(private_key_path) require that the
files are available on the target host.
- By design, any change of a value of options O(keystore_type), O(name) or O(password), as well as changes of key or certificate
materials will cause the existing O(dest) to be overwritten.
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a keystore for the given certificate/private key pair (inline)
community.general.java_keystore:
name: example
@ -174,9 +163,9 @@ EXAMPLES = '''
private_key_path: /etc/ssl/private/ssl-cert-snakeoil.key
password: changeit
dest: /etc/security/keystore.jks
'''
"""
RETURN = '''
RETURN = r"""
msg:
description: Output from stdout of keytool/openssl command after execution of given command or an error.
returned: changed and failure
@ -190,17 +179,17 @@ err:
sample: "Keystore password is too short - must be at least 6 characters\n"
rc:
description: keytool/openssl command execution return value
description: Keytool/openssl command execution return value.
returned: changed and failure
type: int
sample: "0"
cmd:
description: Executed command to get action done
description: Executed command to get action done.
returned: changed and failure
type: str
sample: "/usr/bin/openssl x509 -noout -in /tmp/user/1000/tmp8jd_lh23 -fingerprint -sha256"
'''
"""
import os

View File

@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
DOCUMENTATION = r"""
module: jboss
short_description: Deploy applications to JBoss
description:
@ -39,23 +39,23 @@ options:
- The location in the filesystem where the deployment scanner listens.
type: path
state:
choices: [ present, absent ]
choices: [present, absent]
default: "present"
description:
- Whether the application should be deployed or undeployed.
type: str
notes:
- The JBoss standalone deployment-scanner has to be enabled in standalone.xml
- The module can wait until O(deployment) file is deployed/undeployed by deployment-scanner.
Duration of waiting time depends on scan-interval parameter from standalone.xml.
- Ensure no identically named application is deployed through the JBoss CLI
- The JBoss standalone deployment-scanner has to be enabled in C(standalone.xml).
- The module can wait until O(deployment) file is deployed/undeployed by deployment-scanner. Duration of waiting time depends
on scan-interval parameter from C(standalone.xml).
- Ensure no identically named application is deployed through the JBoss CLI.
seealso:
- name: WildFly reference
- name: WildFly reference
description: Complete reference of the WildFly documentation.
link: https://docs.wildfly.org
author:
- Jeroen Hoekx (@jhoekx)
'''
"""
EXAMPLES = r"""
- name: Deploy a hello world application to the default deploy_path

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: jenkins_build
short_description: Manage jenkins builds
version_added: 2.2.0
@ -79,9 +78,9 @@ options:
default: 10
type: int
version_added: 7.4.0
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a jenkins build using basic authentication
community.general.jenkins_build:
name: "test-check"
@ -108,10 +107,9 @@ EXAMPLES = '''
user: Jenkins
token: abcdefghijklmnopqrstuvwxyz123456
url: http://localhost:8080
'''
"""
RETURN = '''
---
RETURN = r"""
name:
description: Name of the jenkins job.
returned: success
@ -136,7 +134,7 @@ build_info:
description: Build info of the jenkins job.
returned: success
type: dict
'''
"""
import traceback
from time import sleep

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: jenkins_build_info
short_description: Get information about Jenkins builds
version_added: 7.4.0
@ -50,9 +49,9 @@ options:
description:
- User to authenticate with the Jenkins server.
type: str
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Get information about a jenkins build using basic authentication
community.general.jenkins_build_info:
name: "test-check"
@ -74,10 +73,9 @@ EXAMPLES = '''
user: Jenkins
token: abcdefghijklmnopqrstuvwxyz123456
url: http://localhost:8080
'''
"""
RETURN = '''
---
RETURN = r"""
name:
description: Name of the jenkins job.
returned: success
@ -102,7 +100,7 @@ build_info:
description: Build info of the jenkins job.
returned: success
type: dict
'''
"""
import traceback

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: jenkins_job
short_description: Manage jenkins jobs
description:
@ -28,7 +27,7 @@ options:
config:
type: str
description:
- config in XML format.
- Config in XML format.
- Required if job does not yet exist.
- Mutually exclusive with O(enabled).
- Considered if O(state=present).
@ -77,14 +76,13 @@ options:
type: bool
default: true
description:
- If set to V(false), the SSL certificates will not be validated.
This should only set to V(false) used on personally controlled sites
using self-signed certificates as it avoids verifying the source site.
- If set to V(false), the SSL certificates will not be validated. This should only set to V(false) used on personally
controlled sites using self-signed certificates as it avoids verifying the source site.
- The C(python-jenkins) library only handles this by using the environment variable E(PYTHONHTTPSVERIFY).
version_added: 2.3.0
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a jenkins job using basic authentication
community.general.jenkins_job:
config: "{{ lookup('file', 'templates/test.xml') }}"
@ -132,10 +130,9 @@ EXAMPLES = '''
enabled: false
url: http://localhost:8080
user: admin
'''
"""
RETURN = '''
---
RETURN = r"""
name:
description: Name of the jenkins job.
returned: success
@ -161,7 +158,7 @@ url:
returned: success
type: str
sample: https://jenkins.mydomain.com
'''
"""
import os
import traceback

View File

@ -9,8 +9,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: jenkins_job_info
short_description: Get information about Jenkins jobs
description:
@ -60,9 +59,9 @@ options:
type: bool
author:
- "Chris St. Pierre (@stpierre)"
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
# Get all Jenkins jobs anonymously
- community.general.jenkins_job_info:
user: admin
@ -122,12 +121,11 @@ EXAMPLES = '''
token: 126df5c60d66c66e3b75b11104a16a8a
url: https://jenkins.example.com
register: my_jenkins_job_info
'''
"""
RETURN = '''
---
RETURN = r"""
jobs:
description: All jobs found matching the specified criteria
description: All jobs found matching the specified criteria.
returned: success
type: list
sample:
@ -139,7 +137,7 @@ jobs:
"color": "blue"
},
]
'''
"""
import ssl
import fnmatch

View File

@ -8,8 +8,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: jenkins_node
short_description: Manage Jenkins nodes
version_added: 10.0.0
@ -25,8 +24,7 @@ attributes:
check_mode:
support: partial
details:
- Check mode is unable to show configuration changes for a node that is not yet
present.
- Check mode is unable to show configuration changes for a node that is not yet present.
diff_mode:
support: none
options:
@ -50,8 +48,8 @@ options:
type: str
state:
description:
- Specifies whether the Jenkins node should be V(present) (created), V(absent)
(deleted), V(enabled) (online) or V(disabled) (offline).
- Specifies whether the Jenkins node should be V(present) (created), V(absent) (deleted), V(enabled) (online) or V(disabled)
(offline).
default: present
choices: ['enabled', 'disabled', 'present', 'absent']
type: str
@ -66,18 +64,15 @@ options:
elements: str
offline_message:
description:
- Specifies the offline reason message to be set when configuring the Jenkins node
state.
- If O(offline_message) is given and requested O(state) is not V(disabled), an
error will be raised.
- Internally O(offline_message) is set via the V(toggleOffline) API, so updating
the message when the node is already offline (current state V(disabled)) is not
possible. In this case, a warning will be issued.
- Specifies the offline reason message to be set when configuring the Jenkins node state.
- If O(offline_message) is given and requested O(state) is not V(disabled), an error will be raised.
- Internally O(offline_message) is set using the V(toggleOffline) API, so updating the message when the node is already
offline (current state V(disabled)) is not possible. In this case, a warning will be issued.
type: str
version_added: 10.0.0
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Create a Jenkins node using token authentication
community.general.jenkins_node:
url: http://localhost:8080
@ -105,12 +100,11 @@ EXAMPLES = '''
community.general.jenkins_node:
name: my-node
state: disabled
offline_message: >
offline_message: >-
This node is offline for some reason.
'''
"""
RETURN = '''
---
RETURN = r"""
url:
description: URL used to connect to the Jenkins server.
returned: success
@ -151,7 +145,7 @@ configured:
description: Whether or not the Jenkins node was configured by the task.
returned: success
type: bool
'''
"""
import sys
import traceback

View File

@ -9,14 +9,12 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: jenkins_plugin
author: Jiri Tyr (@jtyr)
short_description: Add or remove Jenkins plugin
description:
- Ansible module which helps to manage Jenkins plugins.
attributes:
check_mode:
support: full
@ -53,8 +51,7 @@ options:
type: str
description:
- Desired plugin state.
- If set to V(latest), the check for new version will be performed
every time. This is suitable to keep the plugin up-to-date.
- If set to V(latest), the check for new version will be performed every time. This is suitable to keep the plugin up-to-date.
choices: [absent, present, pinned, unpinned, enabled, disabled, latest]
default: present
timeout:
@ -65,12 +62,10 @@ options:
updates_expiration:
type: int
description:
- Number of seconds after which a new copy of the C(update-center.json)
file is downloaded. This is used to avoid the need to download the
plugin to calculate its checksum when O(state=latest) is specified.
- Set it to V(0) if no cache file should be used. In that case, the
plugin file will always be downloaded to calculate its checksum when
O(state=latest) is specified.
- Number of seconds after which a new copy of the C(update-center.json) file is downloaded. This is used to avoid the
need to download the plugin to calculate its checksum when O(state=latest) is specified.
- Set it to V(0) if no cache file should be used. In that case, the plugin file will always be downloaded to calculate
its checksum when O(state=latest) is specified.
default: 86400
updates_url:
type: list
@ -109,12 +104,11 @@ options:
type: str
description:
- Plugin version number.
- If this option is specified, all plugin dependencies must be installed
manually.
- It might take longer to verify that the correct version is installed.
This is especially true if a specific version number is specified.
- Quote the version to prevent the value to be interpreted as float. For
example if V(1.20) would be unquoted, it would become V(1.2).
- If this option is specified, all plugin dependencies must be installed manually.
- It might take longer to verify that the correct version is installed. This is especially true if a specific version
number is specified.
- Quote the version to prevent the value to be interpreted as float. For example if V(1.20) would be unquoted, it would
become V(1.2).
with_dependencies:
description:
- Defines whether to install plugin dependencies.
@ -123,24 +117,20 @@ options:
default: true
notes:
- Plugin installation should be run under root or the same user which owns
the plugin files on the disk. Only if the plugin is not installed yet and
no version is specified, the API installation is performed which requires
only the Web UI credentials.
- It is necessary to notify the handler or call the M(ansible.builtin.service) module to
restart the Jenkins service after a new plugin was installed.
- Pinning works only if the plugin is installed and Jenkins service was
successfully restarted after the plugin installation.
- It is not possible to run the module remotely by changing the O(url)
parameter to point to the Jenkins server. The module must be used on the
host where Jenkins runs as it needs direct access to the plugin files.
- Plugin installation should be run under root or the same user which owns the plugin files on the disk. Only if the plugin
is not installed yet and no version is specified, the API installation is performed which requires only the Web UI credentials.
- It is necessary to notify the handler or call the M(ansible.builtin.service) module to restart the Jenkins service after
a new plugin was installed.
- Pinning works only if the plugin is installed and Jenkins service was successfully restarted after the plugin installation.
- It is not possible to run the module remotely by changing the O(url) parameter to point to the Jenkins server. The module
must be used on the host where Jenkins runs as it needs direct access to the plugin files.
extends_documentation_fragment:
- ansible.builtin.url
- ansible.builtin.files
- community.general.attributes
'''
"""
EXAMPLES = '''
EXAMPLES = r"""
- name: Install plugin
community.general.jenkins_plugin:
name: build-pipeline-plugin
@ -305,20 +295,20 @@ EXAMPLES = '''
when: >
'enabled' in item.value
with_dict: "{{ my_jenkins_plugins }}"
'''
"""
RETURN = '''
RETURN = r"""
plugin:
description: plugin name
description: Plugin name.
returned: success
type: str
sample: build-pipeline-plugin
state:
description: state of the target, after execution
description: State of the target, after execution.
returned: success
type: str
sample: "present"
'''
"""
import hashlib
import io

View File

@ -9,15 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
author: James Hogarth (@hogarthj)
module: jenkins_script
short_description: Executes a groovy script in the jenkins instance
description:
- The C(jenkins_script) module takes a script plus a dict of values
to use within the script and returns the result of the script being run.
- The C(jenkins_script) module takes a script plus a dict of values to use within the script and returns the result of the
script being run.
extends_documentation_fragment:
- community.general.attributes
@ -31,20 +29,18 @@ options:
script:
type: str
description:
- The groovy script to be executed.
This gets passed as a string Template if args is defined.
- The groovy script to be executed. This gets passed as a string Template if args is defined.
required: true
url:
type: str
description:
- The jenkins server to execute the script against. The default is a local
jenkins instance that is not being proxied through a webserver.
- The jenkins server to execute the script against. The default is a local jenkins instance that is not being proxied
through a webserver.
default: http://localhost:8080
validate_certs:
description:
- If set to V(false), the SSL certificates will not be validated.
This should only set to V(false) used on personally controlled sites
using self-signed certificates as it avoids verifying the source site.
- If set to V(false), the SSL certificates will not be validated. This should only set to V(false) used on personally
controlled sites using self-signed certificates as it avoids verifying the source site.
type: bool
default: true
user:
@ -58,21 +54,18 @@ options:
timeout:
type: int
description:
- The request timeout in seconds
- The request timeout in seconds.
default: 10
args:
type: dict
description:
- A dict of key-value pairs used in formatting the script using string.Template (see https://docs.python.org/2/library/string.html#template-strings).
notes:
- Since the script can do anything this does not report on changes.
Knowing the script is being run it's important to set changed_when
for the ansible output to be clear on any alterations made.
- Since the script can do anything this does not report on changes. Knowing the script is being run it's important to set
changed_when for the ansible output to be clear on any alterations made.
"""
'''
EXAMPLES = '''
EXAMPLES = r"""
- name: Obtaining a list of plugins
community.general.jenkins_script:
script: 'println(Jenkins.instance.pluginManager.plugins)'
@ -100,15 +93,15 @@ EXAMPLES = '''
password: admin
url: https://localhost
validate_certs: false # only do this when you trust the network!
'''
"""
RETURN = '''
RETURN = r"""
output:
description: Result of script
description: Result of script.
returned: success
type: str
sample: 'Result: true'
'''
"""
import json

View File

@ -20,7 +20,6 @@ module: jira
short_description: Create and modify issues in a JIRA instance
description:
- Create and modify issues in a JIRA instance.
extends_documentation_fragment:
- community.general.attributes
@ -36,28 +35,24 @@ options:
required: true
description:
- Base URI for the JIRA instance.
operation:
type: str
required: true
aliases: [ command ]
choices: [ attach, comment, create, edit, fetch, link, search, transition, update, worklog ]
aliases: [command]
choices: [attach, comment, create, edit, fetch, link, search, transition, update, worklog]
description:
- The operation to perform.
- V(worklog) was added in community.general 6.5.0.
username:
type: str
description:
- The username to log-in with.
- Must be used with O(password). Mutually exclusive with O(token).
password:
type: str
description:
- The password to log-in with.
- Must be used with O(username). Mutually exclusive with O(token).
token:
type: str
description:
@ -70,27 +65,23 @@ options:
required: false
description:
- The project for this operation. Required for issue creation.
summary:
type: str
required: false
description:
- The issue summary, where appropriate.
- Note that JIRA may not allow changing field values on specific transitions or states.
description:
type: str
required: false
description:
- The issue description, where appropriate.
- Note that JIRA may not allow changing field values on specific transitions or states.
issuetype:
type: str
required: false
description:
- The issue type, for issue creation.
issue:
type: str
required: false
@ -104,12 +95,13 @@ options:
description:
- The comment text to add.
- Note that JIRA may not allow changing field values on specific transitions or states.
comment_visibility:
type: dict
description:
- Used to specify comment comment visibility.
- See U(https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-comments/#api-rest-api-2-issue-issueidorkey-comment-post) for details.
- See
U(https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-comments/#api-rest-api-2-issue-issueidorkey-comment-post)
for details.
suboptions:
type:
description:
@ -119,7 +111,8 @@ options:
choices: [group, role]
value:
description:
- Use value to specify value corresponding to the type of visibility restriction. For example name of the group or role.
- Use value to specify value corresponding to the type of visibility restriction. For example name of the group
or role.
type: str
required: true
version_added: '3.2.0'
@ -129,7 +122,6 @@ options:
required: false
description:
- Only used when O(operation) is V(transition), and a bit of a misnomer, it actually refers to the transition name.
assignee:
type: str
required: false
@ -137,7 +129,6 @@ options:
- Sets the the assignee when O(operation) is V(create), V(transition), or V(edit).
- Recent versions of JIRA no longer accept a user name as a user identifier. In that case, use O(account_id) instead.
- Note that JIRA may not allow changing field values on specific transitions or states.
account_id:
type: str
description:
@ -150,33 +141,31 @@ options:
required: false
description:
- Set type of link, when action 'link' selected.
inwardissue:
type: str
required: false
description:
- Set issue from which link will be created.
outwardissue:
type: str
required: false
description:
- Set issue to which link will be created.
fields:
type: dict
required: false
description:
- This is a free-form data structure that can contain arbitrary data. This is passed directly to the JIRA REST API
(possibly after merging with other required data, as when passed to create). See examples for more information,
and the JIRA REST API for the structure required for various fields.
- When passed to comment, the data structure is merged at the first level since community.general 4.6.0. Useful to add JIRA properties for example.
- This is a free-form data structure that can contain arbitrary data. This is passed directly to the JIRA REST API (possibly
after merging with other required data, as when passed to create). See examples for more information, and the JIRA
REST API for the structure required for various fields.
- When passed to comment, the data structure is merged at the first level since community.general 4.6.0. Useful to add
JIRA properties for example.
- Note that JIRA may not allow changing field values on specific transitions or states.
default: {}
jql:
required: false
description:
- Query JIRA in JQL Syntax, e.g. 'CMDB Hostname'='test.example.com'.
- Query JIRA in JQL Syntax, for example V("CMDB Hostname" = test.example.com).
type: str
version_added: '0.2.0'
@ -198,7 +187,7 @@ options:
validate_certs:
required: false
description:
- Require valid SSL certificates (set to V(false) if you would like to use self-signed certificates)
- Require valid SSL certificates (set to V(false) if you would like to use self-signed certificates).
default: true
type: bool
@ -212,27 +201,24 @@ options:
required: true
type: path
description:
- The path to the file to upload (from the remote node) or, if O(attachment.content) is specified,
the filename to use for the attachment.
- The path to the file to upload (from the remote node) or, if O(attachment.content) is specified, the filename
to use for the attachment.
content:
type: str
description:
- The Base64 encoded contents of the file to attach. If not specified, the contents of O(attachment.filename) will be
used instead.
- The Base64 encoded contents of the file to attach. If not specified, the contents of O(attachment.filename) will
be used instead.
mimetype:
type: str
description:
- The MIME type to supply for the upload. If not specified, best-effort detection will be
done.
- The MIME type to supply for the upload. If not specified, best-effort detection will be done.
notes:
- "Currently this only works with basic-auth, or tokens."
- "To use with JIRA Cloud, pass the login e-mail as the O(username) and the API token as O(password)."
- Currently this only works with basic-auth, or tokens.
- To use with JIRA Cloud, pass the login e-mail as the O(username) and the API token as O(password).
author:
- "Steve Smith (@tarka)"
- "Per Abildgaard Toft (@pertoft)"
- "Brandon McNama (@DWSR)"
- "Steve Smith (@tarka)"
- "Per Abildgaard Toft (@pertoft)"
- "Brandon McNama (@DWSR)"
"""
EXAMPLES = r"""
@ -376,8 +362,8 @@ EXAMPLES = r"""
operation: update
args:
fields:
customfield_12931: [ {'set': {'value': 'Virtual'}} ]
customfield_13820: [ {'set': {'value':'Manually'}} ]
customfield_12931: ['set': {'value': 'Virtual'}]
customfield_13820: ['set': {'value': 'Manually'}]
register: cmdb_issue
delegate_to: localhost
@ -406,7 +392,7 @@ EXAMPLES = r"""
jql: project=cmdb AND cf[13225]="test"
args:
fields:
lastViewed: null
lastViewed:
register: issue
- name: Create a unix account for the reporter