c*.py: normalize docs (#9418)

* c*.py: normalize docs

* fix copy/paste mistake

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
pull/9433/head
Alexei Znamensky 2024-12-28 02:29:05 +13:00 committed by GitHub
parent 912065ad0e
commit 43599c6850
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 1437 additions and 1614 deletions

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: campfire module: campfire
short_description: Send a message to Campfire short_description: Send a message to Campfire
description: description:
@ -49,22 +48,17 @@ options:
description: description:
- Send a notification sound before the message. - Send a notification sound before the message.
required: false required: false
choices: ["56k", "bell", "bezos", "bueller", "clowntown", choices: ["56k", "bell", "bezos", "bueller", "clowntown", "cottoneyejoe", "crickets", "dadgummit", "dangerzone", "danielsan",
"cottoneyejoe", "crickets", "dadgummit", "dangerzone", "deeper", "drama", "greatjob", "greyjoy", "guarantee", "heygirl", "horn", "horror", "inconceivable", "live", "loggins",
"danielsan", "deeper", "drama", "greatjob", "greyjoy", "makeitso", "noooo", "nyan", "ohmy", "ohyeah", "pushit", "rimshot", "rollout", "rumble", "sax", "secret", "sexyback",
"guarantee", "heygirl", "horn", "horror", "story", "tada", "tmyk", "trololo", "trombone", "unix", "vuvuzela", "what", "whoomp", "yeah", "yodel"]
"inconceivable", "live", "loggins", "makeitso", "noooo",
"nyan", "ohmy", "ohyeah", "pushit", "rimshot",
"rollout", "rumble", "sax", "secret", "sexyback",
"story", "tada", "tmyk", "trololo", "trombone", "unix",
"vuvuzela", "what", "whoomp", "yeah", "yodel"]
# informational: requirements for nodes # informational: requirements for nodes
requirements: [] requirements: []
author: "Adam Garside (@fabulops)" author: "Adam Garside (@fabulops)"
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Send a message to Campfire - name: Send a message to Campfire
community.general.campfire: community.general.campfire:
subscription: foo subscription: foo
@ -79,7 +73,7 @@ EXAMPLES = '''
room: 123 room: 123
notify: loggins notify: loggins
msg: Task completed ... with feeling. msg: Task completed ... with feeling.
''' """
try: try:
from html import escape as html_escape from html import escape as html_escape

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: capabilities module: capabilities
short_description: Manage Linux capabilities short_description: Manage Linux capabilities
description: description:
@ -30,7 +29,7 @@ options:
aliases: [key] aliases: [key]
capability: capability:
description: description:
- Desired capability to set (with operator and flags, if O(state=present)) or remove (if O(state=absent)) - Desired capability to set (with operator and flags, if O(state=present)) or remove (if O(state=absent)).
type: str type: str
required: true required: true
aliases: [cap] aliases: [cap]
@ -41,15 +40,15 @@ options:
choices: [absent, present] choices: [absent, present]
default: present default: present
notes: notes:
- The capabilities system will automatically transform operators and flags into the effective set, - The capabilities system will automatically transform operators and flags into the effective set, so for example, C(cap_foo=ep)
so for example, C(cap_foo=ep) will probably become C(cap_foo+ep). will probably become C(cap_foo+ep).
- This module does not attempt to determine the final operator and flags to compare, - This module does not attempt to determine the final operator and flags to compare, so you will want to ensure that your
so you will want to ensure that your capabilities argument matches the final capabilities. capabilities argument matches the final capabilities.
author: author:
- Nate Coraor (@natefoo) - Nate Coraor (@natefoo)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Set cap_sys_chroot+ep on /foo - name: Set cap_sys_chroot+ep on /foo
community.general.capabilities: community.general.capabilities:
path: /foo path: /foo
@ -61,7 +60,7 @@ EXAMPLES = r'''
path: /bar path: /bar
capability: cap_net_bind_service capability: cap_net_bind_service
state: absent state: absent
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -11,7 +11,6 @@ __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = r"""
---
module: cargo module: cargo
short_description: Manage Rust packages with cargo short_description: Manage Rust packages with cargo
version_added: 4.3.0 version_added: 4.3.0
@ -39,16 +38,12 @@ options:
elements: str elements: str
required: true required: true
path: path:
description: description: The base path where to install the Rust packages. Cargo automatically appends V(/bin). In other words,
-> V(/usr/local) will become V(/usr/local/bin).
The base path where to install the Rust packages. Cargo automatically appends
V(/bin). In other words, V(/usr/local) will become V(/usr/local/bin).
type: path type: path
version: version:
description: description: The version to install. If O(name) contains multiple values, the module will try to install all of them
-> in this version.
The version to install. If O(name) contains multiple values, the module will
try to install all of them in this version.
type: str type: str
required: false required: false
locked: locked:

View File

@ -11,12 +11,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: catapult module: catapult
short_description: Send a sms / mms using the catapult bandwidth api short_description: Send a sms / mms using the catapult bandwidth API
description: description:
- Allows notifications to be sent using sms / mms via the catapult bandwidth api. - Allows notifications to be sent using SMS / MMS using the catapult bandwidth API.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -44,31 +43,30 @@ options:
media: media:
type: str type: str
description: description:
- For MMS messages, a media url to the location of the media to be sent with the message. - For MMS messages, a media URL to the location of the media to be sent with the message.
user_id: user_id:
type: str type: str
description: description:
- User Id from Api account page. - User Id from API account page.
required: true required: true
api_token: api_token:
type: str type: str
description: description:
- Api Token from Api account page. - API Token from API account page.
required: true required: true
api_secret: api_secret:
type: str type: str
description: description:
- Api Secret from Api account page. - API Secret from API account page.
required: true required: true
author: "Jonathan Mainguy (@Jmainguy)" author: "Jonathan Mainguy (@Jmainguy)"
notes: notes:
- Will return changed even if the media url is wrong. - Will return changed even if the media url is wrong.
- Will return changed if the destination number is invalid. - Will return changed if the destination number is invalid.
"""
''' EXAMPLES = r"""
EXAMPLES = '''
- name: Send a mms to multiple users - name: Send a mms to multiple users
community.general.catapult: community.general.catapult:
src: "+15035555555" src: "+15035555555"
@ -89,16 +87,15 @@ EXAMPLES = '''
user_id: "{{ user_id }}" user_id: "{{ user_id }}"
api_token: "{{ api_token }}" api_token: "{{ api_token }}"
api_secret: "{{ api_secret }}" api_secret: "{{ api_secret }}"
"""
''' RETURN = r"""
RETURN = '''
changed: changed:
description: Whether the api accepted the message. description: Whether the API accepted the message.
returned: always returned: always
type: bool type: bool
sample: true sample: true
''' """
import json import json

View File

@ -9,17 +9,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: circonus_annotation module: circonus_annotation
short_description: Create an annotation in circonus short_description: Create an annotation in Circonus
description: description:
- Create an annotation event with a given category, title and description. Optionally start, end or durations can be provided - Create an annotation event with a given category, title and description. Optionally start, end or durations can be provided.
author: "Nick Harring (@NickatEpic)" author: "Nick Harring (@NickatEpic)"
requirements: requirements:
- requests (either >= 2.0.0 for Python 3, or >= 1.0.0 for Python 2) - requests (either >= 2.0.0 for Python 3, or >= 1.0.0 for Python 2)
notes:
- Check mode isn't supported.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -31,40 +28,40 @@ options:
api_key: api_key:
type: str type: str
description: description:
- Circonus API key - Circonus API key.
required: true required: true
category: category:
type: str type: str
description: description:
- Annotation Category - Annotation Category.
required: true required: true
description: description:
type: str type: str
description: description:
- Description of annotation - Description of annotation.
required: true required: true
title: title:
type: str type: str
description: description:
- Title of annotation - Title of annotation.
required: true required: true
start: start:
type: int type: int
description: description:
- Unix timestamp of event start - Unix timestamp of event start.
- If not specified, it defaults to "now". - If not specified, it defaults to "now".
stop: stop:
type: int type: int
description: description:
- Unix timestamp of event end - Unix timestamp of event end.
- If not specified, it defaults to "now" + O(duration). - If not specified, it defaults to "now" + O(duration).
duration: duration:
type: int type: int
description: description:
- Duration in seconds of annotation - Duration in seconds of annotation.
default: 0 default: 0
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Create a simple annotation event with a source, defaults to start and end time of now - name: Create a simple annotation event with a source, defaults to start and end time of now
community.general.circonus_annotation: community.general.circonus_annotation:
api_key: XXXXXXXXXXXXXXXXX api_key: XXXXXXXXXXXXXXXXX
@ -88,56 +85,56 @@ EXAMPLES = '''
category: This category groups like annotations category: This category groups like annotations
start_time: 1395940006 start_time: 1395940006
end_time: 1395954407 end_time: 1395954407
''' """
RETURN = ''' RETURN = r"""
annotation: annotation:
description: details about the created annotation description: Details about the created annotation.
returned: success returned: success
type: complex type: complex
contains: contains:
_cid: _cid:
description: annotation identifier description: Annotation identifier.
returned: success returned: success
type: str type: str
sample: /annotation/100000 sample: /annotation/100000
_created: _created:
description: creation timestamp description: Creation timestamp.
returned: success returned: success
type: int type: int
sample: 1502236928 sample: 1502236928
_last_modified: _last_modified:
description: last modification timestamp description: Last modification timestamp.
returned: success returned: success
type: int type: int
sample: 1502236928 sample: 1502236928
_last_modified_by: _last_modified_by:
description: last modified by description: Last modified by.
returned: success returned: success
type: str type: str
sample: /user/1000 sample: /user/1000
category: category:
description: category of the created annotation description: Category of the created annotation.
returned: success returned: success
type: str type: str
sample: alerts sample: alerts
title: title:
description: title of the created annotation description: Title of the created annotation.
returned: success returned: success
type: str type: str
sample: WARNING sample: WARNING
description: description:
description: description of the created annotation description: Description of the created annotation.
returned: success returned: success
type: str type: str
sample: Host is down. sample: Host is down.
start: start:
description: timestamp, since annotation applies description: Timestamp, since annotation applies.
returned: success returned: success
type: int type: int
sample: Host is down. sample: Host is down.
stop: stop:
description: timestamp, since annotation ends description: Timestamp, since annotation ends.
returned: success returned: success
type: str type: str
sample: Host is down. sample: Host is down.
@ -147,7 +144,8 @@ annotation:
type: list type: list
sample: sample:
- 54321_kbps - 54321_kbps
''' """
import json import json
import time import time
import traceback import traceback

View File

@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: cisco_webex module: cisco_webex
short_description: Send a message to a Cisco Webex Teams Room or Individual short_description: Send a message to a Cisco Webex Teams Room or Individual
description: description:
@ -19,7 +18,6 @@ author: Drew Rusell (@drew-russell)
notes: notes:
- The O(recipient_type) must be valid for the supplied O(recipient_id). - The O(recipient_type) must be valid for the supplied O(recipient_id).
- Full API documentation can be found at U(https://developer.webex.com/docs/api/basics). - Full API documentation can be found at U(https://developer.webex.com/docs/api/basics).
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -64,9 +62,9 @@ options:
- The message you would like to send. - The message you would like to send.
required: true required: true
type: str type: str
''' """
EXAMPLES = """ EXAMPLES = r"""
# Note: The following examples assume a variable file has been imported # Note: The following examples assume a variable file has been imported
# that contains the appropriate information. # that contains the appropriate information.
@ -101,10 +99,9 @@ EXAMPLES = """
msg_type: text msg_type: text
personal_token: "{{ token }}" personal_token: "{{ token }}"
msg: "Cisco Webex Teams Ansible Module - Text Message to Individual by E-Mail" msg: "Cisco Webex Teams Ansible Module - Text Message to Individual by E-Mail"
""" """
RETURN = """ RETURN = r"""
status_code: status_code:
description: description:
- The Response Code returned by the Webex Teams API. - The Response Code returned by the Webex Teams API.

View File

@ -9,11 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_aa_policy module: clc_aa_policy
short_description: Create or Delete Anti Affinity Policies at CenturyLink Cloud short_description: Create or Delete Anti-Affinity Policies at CenturyLink Cloud
description: description:
- An Ansible module to Create or Delete Anti Affinity Policies at CenturyLink Cloud. - An Ansible module to Create or Delete Anti-Affinity Policies at CenturyLink Cloud.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -24,7 +24,7 @@ attributes:
options: options:
name: name:
description: description:
- The name of the Anti Affinity Policy. - The name of the Anti-Affinity Policy.
type: str type: str
required: true required: true
location: location:
@ -40,26 +40,21 @@ options:
default: present default: present
choices: ['present', 'absent'] choices: ['present', 'absent']
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
---
- name: Create AA Policy - name: Create AA Policy
hosts: localhost hosts: localhost
gather_facts: false gather_facts: false
@ -91,11 +86,11 @@ EXAMPLES = '''
- name: Debug - name: Debug
ansible.builtin.debug: ansible.builtin.debug:
var: policy var: policy
''' """
RETURN = ''' RETURN = r"""
policy: policy:
description: The anti affinity policy information description: The anti-affinity policy information.
returned: success returned: success
type: dict type: dict
sample: sample:
@ -121,7 +116,7 @@ policy:
} }
] ]
} }
''' """
__version__ = '${version}' __version__ = '${version}'

View File

@ -10,7 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_alert_policy module: clc_alert_policy
short_description: Create or Delete Alert Policies at CenturyLink Cloud short_description: Create or Delete Alert Policies at CenturyLink Cloud
description: description:
@ -25,39 +25,35 @@ attributes:
options: options:
alias: alias:
description: description:
- The alias of your CLC Account - The alias of your CLC Account.
type: str type: str
required: true required: true
name: name:
description: description:
- The name of the alert policy. This is mutually exclusive with id - The name of the alert policy. This is mutually exclusive with O(id).
type: str type: str
id: id:
description: description:
- The alert policy id. This is mutually exclusive with name - The alert policy id. This is mutually exclusive with O(name).
type: str type: str
alert_recipients: alert_recipients:
description: description:
- A list of recipient email ids to notify the alert. - A list of recipient email ids to notify the alert. This is required for O(state=present).
This is required for state 'present'
type: list type: list
elements: str elements: str
metric: metric:
description: description:
- The metric on which to measure the condition that will trigger the alert. - The metric on which to measure the condition that will trigger the alert. This is required for O(state=present).
This is required for state 'present'
type: str type: str
choices: ['cpu', 'memory', 'disk'] choices: ['cpu', 'memory', 'disk']
duration: duration:
description: description:
- The length of time in minutes that the condition must exceed the threshold. - The length of time in minutes that the condition must exceed the threshold. This is required for O(state=present).
This is required for state 'present'
type: str type: str
threshold: threshold:
description: description:
- The threshold that will trigger the alert when the metric equals or exceeds it. - The threshold that will trigger the alert when the metric equals or exceeds it. This is required for O(state=present).
This is required for state 'present' This number represents a percentage and must be a value between 5.0 - 95.0 that is a multiple of 5.0.
This number represents a percentage and must be a value between 5.0 - 95.0 that is a multiple of 5.0
type: int type: int
state: state:
description: description:
@ -66,26 +62,21 @@ options:
default: present default: present
choices: ['present', 'absent'] choices: ['present', 'absent']
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
---
- name: Create Alert Policy Example - name: Create Alert Policy Example
hosts: localhost hosts: localhost
gather_facts: false gather_facts: false
@ -121,11 +112,11 @@ EXAMPLES = '''
- name: Debug - name: Debug
ansible.builtin.debug: var=policy ansible.builtin.debug: var=policy
''' """
RETURN = ''' RETURN = r"""
policy: policy:
description: The alert policy information description: The alert policy information.
returned: success returned: success
type: dict type: dict
sample: sample:
@ -162,7 +153,7 @@ policy:
} }
] ]
} }
''' """
__version__ = '${version}' __version__ = '${version}'

View File

@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_blueprint_package module: clc_blueprint_package
short_description: Deploys a blue print package on a set of servers in CenturyLink Cloud short_description: Deploys a blue print package on a set of servers in CenturyLink Cloud
description: description:
@ -41,7 +41,7 @@ options:
required: false required: false
state: state:
description: description:
- Whether to install or uninstall the package. Currently it supports only "present" for install action. - Whether to install or uninstall the package. Currently it supports only V(present) for install action.
type: str type: str
required: false required: false
default: present default: present
@ -53,23 +53,21 @@ options:
default: 'True' default: 'True'
required: false required: false
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples # Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
- name: Deploy package - name: Deploy package
@ -79,19 +77,15 @@ EXAMPLES = '''
- UC1TEST-SERVER2 - UC1TEST-SERVER2
package_id: 77abb844-579d-478d-3955-c69ab4a7ba1a package_id: 77abb844-579d-478d-3955-c69ab4a7ba1a
package_params: {} package_params: {}
''' """
RETURN = ''' RETURN = r"""
server_ids: server_ids:
description: The list of server ids that are changed description: The list of server ids that are changed.
returned: success returned: success
type: list type: list
sample: sample: ["UC1TEST-SERVER1", "UC1TEST-SERVER2"]
[ """
"UC1TEST-SERVER1",
"UC1TEST-SERVER2"
]
'''
__version__ = '${version}' __version__ = '${version}'

View File

@ -9,11 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_firewall_policy module: clc_firewall_policy
short_description: Create/delete/update firewall policies short_description: Create/delete/update firewall policies
description: description:
- Create or delete or update firewall policies on Centurylink Cloud - Create or delete or update firewall policies on Centurylink Cloud.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -24,46 +24,43 @@ attributes:
options: options:
location: location:
description: description:
- Target datacenter for the firewall policy - Target datacenter for the firewall policy.
type: str type: str
required: true required: true
state: state:
description: description:
- Whether to create or delete the firewall policy - Whether to create or delete the firewall policy.
type: str type: str
default: present default: present
choices: ['present', 'absent'] choices: ['present', 'absent']
source: source:
description: description:
- The list of source addresses for traffic on the originating firewall. - The list of source addresses for traffic on the originating firewall. This is required when O(state=present).
This is required when state is 'present'
type: list type: list
elements: str elements: str
destination: destination:
description: description:
- The list of destination addresses for traffic on the terminating firewall. - The list of destination addresses for traffic on the terminating firewall. This is required when O(state=present).
This is required when state is 'present'
type: list type: list
elements: str elements: str
ports: ports:
description: description:
- The list of ports associated with the policy. - The list of ports associated with the policy. TCP and UDP can take in single ports or port ranges.
TCP and UDP can take in single ports or port ranges.
- "Example: V(['any', 'icmp', 'TCP/123', 'UDP/123', 'TCP/123-456', 'UDP/123-456'])." - "Example: V(['any', 'icmp', 'TCP/123', 'UDP/123', 'TCP/123-456', 'UDP/123-456'])."
type: list type: list
elements: str elements: str
firewall_policy_id: firewall_policy_id:
description: description:
- Id of the firewall policy. This is required to update or delete an existing firewall policy - Id of the firewall policy. This is required to update or delete an existing firewall policy.
type: str type: str
source_account_alias: source_account_alias:
description: description:
- CLC alias for the source account - CLC alias for the source account.
type: str type: str
required: true required: true
destination_account_alias: destination_account_alias:
description: description:
- CLC alias for the destination account - CLC alias for the destination account.
type: str type: str
wait: wait:
description: description:
@ -72,29 +69,26 @@ options:
default: 'True' default: 'True'
enabled: enabled:
description: description:
- Whether the firewall policy is enabled or disabled - Whether the firewall policy is enabled or disabled.
type: str type: str
choices: ['True', 'False'] choices: ['True', 'False']
default: 'True' default: 'True'
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
---
- name: Create Firewall Policy - name: Create Firewall Policy
hosts: localhost hosts: localhost
gather_facts: false gather_facts: false
@ -121,16 +115,16 @@ EXAMPLES = '''
location: VA1 location: VA1
state: absent state: absent
firewall_policy_id: c62105233d7a4231bd2e91b9c791e43e1 firewall_policy_id: c62105233d7a4231bd2e91b9c791e43e1
''' """
RETURN = ''' RETURN = r"""
firewall_policy_id: firewall_policy_id:
description: The fire wall policy id description: The firewall policy id.
returned: success returned: success
type: str type: str
sample: fc36f1bfd47242e488a9c44346438c05 sample: fc36f1bfd47242e488a9c44346438c05
firewall_policy: firewall_policy:
description: The fire wall policy information description: The firewall policy information.
returned: success returned: success
type: dict type: dict
sample: sample:
@ -162,7 +156,7 @@ firewall_policy:
], ],
"status":"active" "status":"active"
} }
''' """
__version__ = '${version}' __version__ = '${version}'

View File

@ -10,11 +10,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_group module: clc_group
short_description: Create/delete Server Groups at Centurylink Cloud short_description: Create/delete Server Groups at Centurylink Cloud
description: description:
- Create or delete Server Groups at Centurylink Centurylink Cloud - Create or delete Server Groups at Centurylink Centurylink Cloud.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -25,12 +25,12 @@ attributes:
options: options:
name: name:
description: description:
- The name of the Server Group - The name of the Server Group.
type: str type: str
required: true required: true
description: description:
description: description:
- A description of the Server Group - A description of the Server Group.
type: str type: str
required: false required: false
parent: parent:
@ -40,13 +40,13 @@ options:
required: false required: false
location: location:
description: description:
- Datacenter to create the group in. If location is not provided, the group gets created in the default datacenter - Datacenter to create the group in. If location is not provided, the group gets created in the default datacenter associated
associated with the account with the account.
type: str type: str
required: false required: false
state: state:
description: description:
- Whether to create or delete the group - Whether to create or delete the group.
type: str type: str
default: present default: present
choices: ['present', 'absent'] choices: ['present', 'absent']
@ -57,27 +57,22 @@ options:
default: true default: true
required: false required: false
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = '''
EXAMPLES = r"""
# Create a Server Group # Create a Server Group
---
- name: Create Server Group - name: Create Server Group
hosts: localhost hosts: localhost
gather_facts: false gather_facts: false
@ -110,11 +105,11 @@ EXAMPLES = '''
- name: Debug - name: Debug
ansible.builtin.debug: ansible.builtin.debug:
var: clc var: clc
''' """
RETURN = ''' RETURN = r"""
group: group:
description: The group information description: The group information.
returned: success returned: success
type: dict type: dict
sample: sample:
@ -209,7 +204,7 @@ group:
"status":"active", "status":"active",
"type":"default" "type":"default"
} }
''' """
__version__ = '${version}' __version__ = '${version}'

View File

@ -10,7 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_loadbalancer module: clc_loadbalancer
short_description: Create, Delete shared loadbalancers in CenturyLink Cloud short_description: Create, Delete shared loadbalancers in CenturyLink Cloud
description: description:
@ -25,74 +25,72 @@ attributes:
options: options:
name: name:
description: description:
- The name of the loadbalancer - The name of the loadbalancer.
type: str type: str
required: true required: true
description: description:
description: description:
- A description for the loadbalancer - A description for the loadbalancer.
type: str type: str
alias: alias:
description: description:
- The alias of your CLC Account - The alias of your CLC Account.
type: str type: str
required: true required: true
location: location:
description: description:
- The location of the datacenter where the load balancer resides in - The location of the datacenter where the load balancer resides in.
type: str type: str
required: true required: true
method: method:
description: description:
-The balancing method for the load balancer pool - The balancing method for the load balancer pool.
type: str type: str
choices: ['leastConnection', 'roundRobin'] choices: ['leastConnection', 'roundRobin']
persistence: persistence:
description: description:
- The persistence method for the load balancer - The persistence method for the load balancer.
type: str type: str
choices: ['standard', 'sticky'] choices: ['standard', 'sticky']
port: port:
description: description:
- Port to configure on the public-facing side of the load balancer pool - Port to configure on the public-facing side of the load balancer pool.
type: str type: str
choices: ['80', '443'] choices: ['80', '443']
nodes: nodes:
description: description:
- A list of nodes that needs to be added to the load balancer pool - A list of nodes that needs to be added to the load balancer pool.
type: list type: list
default: [] default: []
elements: dict elements: dict
status: status:
description: description:
- The status of the loadbalancer - The status of the loadbalancer.
type: str type: str
default: enabled default: enabled
choices: ['enabled', 'disabled'] choices: ['enabled', 'disabled']
state: state:
description: description:
- Whether to create or delete the load balancer pool - Whether to create or delete the load balancer pool.
type: str type: str
default: present default: present
choices: ['present', 'absent', 'port_absent', 'nodes_present', 'nodes_absent'] choices: ['present', 'absent', 'port_absent', 'nodes_present', 'nodes_absent']
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples # Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
- name: Create Loadbalancer - name: Create Loadbalancer
hosts: localhost hosts: localhost
@ -173,11 +171,11 @@ EXAMPLES = '''
- ipAddress: 10.11.22.123 - ipAddress: 10.11.22.123
privatePort: 80 privatePort: 80
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
loadbalancer: loadbalancer:
description: The load balancer result object from CLC description: The load balancer result object from CLC.
returned: success returned: success
type: dict type: dict
sample: sample:
@ -210,7 +208,7 @@ loadbalancer:
], ],
"status":"enabled" "status":"enabled"
} }
''' """
__version__ = '${version}' __version__ = '${version}'

View File

@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_modify_server module: clc_modify_server
short_description: Modify servers in CenturyLink Cloud short_description: Modify servers in CenturyLink Cloud
description: description:
@ -30,7 +30,7 @@ options:
elements: str elements: str
cpu: cpu:
description: description:
- How many CPUs to update on the server - How many CPUs to update on the server.
type: str type: str
memory: memory:
description: description:
@ -38,23 +38,19 @@ options:
type: str type: str
anti_affinity_policy_id: anti_affinity_policy_id:
description: description:
- The anti affinity policy id to be set for a hyper scale server. - The anti affinity policy id to be set for a hyper scale server. This is mutually exclusive with O(anti_affinity_policy_name).
This is mutually exclusive with 'anti_affinity_policy_name'
type: str type: str
anti_affinity_policy_name: anti_affinity_policy_name:
description: description:
- The anti affinity policy name to be set for a hyper scale server. - The anti affinity policy name to be set for a hyper scale server. This is mutually exclusive with O(anti_affinity_policy_id).
This is mutually exclusive with 'anti_affinity_policy_id'
type: str type: str
alert_policy_id: alert_policy_id:
description: description:
- The alert policy id to be associated to the server. - The alert policy id to be associated to the server. This is mutually exclusive with O(alert_policy_name).
This is mutually exclusive with 'alert_policy_name'
type: str type: str
alert_policy_name: alert_policy_name:
description: description:
- The alert policy name to be associated to the server. - The alert policy name to be associated to the server. This is mutually exclusive with O(alert_policy_id).
This is mutually exclusive with 'alert_policy_id'
type: str type: str
state: state:
description: description:
@ -68,23 +64,21 @@ options:
type: bool type: bool
default: true default: true
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples # Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
- name: Set the cpu count to 4 on a server - name: Set the cpu count to 4 on a server
@ -143,20 +137,16 @@ EXAMPLES = '''
cpu: 8 cpu: 8
memory: 16 memory: 16
state: present state: present
''' """
RETURN = ''' RETURN = r"""
server_ids: server_ids:
description: The list of server ids that are changed description: The list of server ids that are changed.
returned: success returned: success
type: list type: list
sample: sample: ["UC1TEST-SVR01", "UC1TEST-SVR02"]
[
"UC1TEST-SVR01",
"UC1TEST-SVR02"
]
servers: servers:
description: The list of server objects that are changed description: The list of server objects that are changed.
returned: success returned: success
type: list type: list
sample: sample:
@ -312,7 +302,7 @@ servers:
"type":"standard" "type":"standard"
} }
] ]
''' """
__version__ = '${version}' __version__ = '${version}'

View File

@ -9,11 +9,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_publicip module: clc_publicip
short_description: Add and Delete public ips on servers in CenturyLink Cloud short_description: Add and Delete public IPs on servers in CenturyLink Cloud
description: description:
- An Ansible module to add or delete public ip addresses on an existing server or servers in CenturyLink Cloud. - An Ansible module to add or delete public IP addresses on an existing server or servers in CenturyLink Cloud.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -30,7 +30,7 @@ options:
choices: ['TCP', 'UDP', 'ICMP'] choices: ['TCP', 'UDP', 'ICMP']
ports: ports:
description: description:
- A list of ports to expose. This is required when state is 'present' - A list of ports to expose. This is required when O(state=present).
type: list type: list
elements: int elements: int
server_ids: server_ids:
@ -41,8 +41,8 @@ options:
elements: str elements: str
state: state:
description: description:
- Determine whether to create or delete public IPs. If present module will not create a second public ip if one - Determine whether to create or delete public IPs. If V(present) module will not create a second public ip if one already
already exists. exists.
type: str type: str
default: present default: present
choices: ['present', 'absent'] choices: ['present', 'absent']
@ -52,23 +52,21 @@ options:
type: bool type: bool
default: true default: true
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples # Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
- name: Add Public IP to Server - name: Add Public IP to Server
@ -107,19 +105,15 @@ EXAMPLES = '''
- name: Debug - name: Debug
ansible.builtin.debug: ansible.builtin.debug:
var: clc var: clc
''' """
RETURN = ''' RETURN = r"""
server_ids: server_ids:
description: The list of server ids that are changed description: The list of server ids that are changed.
returned: success returned: success
type: list type: list
sample: sample: ["UC1TEST-SVR01", "UC1TEST-SVR02"]
[ """
"UC1TEST-SVR01",
"UC1TEST-SVR02"
]
'''
__version__ = '${version}' __version__ = '${version}'

View File

@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_server module: clc_server
short_description: Create, Delete, Start and Stop servers in CenturyLink Cloud short_description: Create, Delete, Start and Stop servers in CenturyLink Cloud
description: description:
@ -24,13 +24,13 @@ attributes:
options: options:
additional_disks: additional_disks:
description: description:
- The list of additional disks for the server - The list of additional disks for the server.
type: list type: list
elements: dict elements: dict
default: [] default: []
add_public_ip: add_public_ip:
description: description:
- Whether to add a public ip to the server - Whether to add a public ip to the server.
type: bool type: bool
default: false default: false
alias: alias:
@ -39,23 +39,23 @@ options:
type: str type: str
anti_affinity_policy_id: anti_affinity_policy_id:
description: description:
- The anti-affinity policy to assign to the server. This is mutually exclusive with 'anti_affinity_policy_name'. - The anti-affinity policy to assign to the server. This is mutually exclusive with O(anti_affinity_policy_name).
type: str type: str
anti_affinity_policy_name: anti_affinity_policy_name:
description: description:
- The anti-affinity policy to assign to the server. This is mutually exclusive with 'anti_affinity_policy_id'. - The anti-affinity policy to assign to the server. This is mutually exclusive with O(anti_affinity_policy_id).
type: str type: str
alert_policy_id: alert_policy_id:
description: description:
- The alert policy to assign to the server. This is mutually exclusive with 'alert_policy_name'. - The alert policy to assign to the server. This is mutually exclusive with O(alert_policy_name).
type: str type: str
alert_policy_name: alert_policy_name:
description: description:
- The alert policy to assign to the server. This is mutually exclusive with 'alert_policy_id'. - The alert policy to assign to the server. This is mutually exclusive with O(alert_policy_id).
type: str type: str
count: count:
description: description:
- The number of servers to build (mutually exclusive with exact_count) - The number of servers to build (mutually exclusive with O(exact_count)).
default: 1 default: 1
type: int type: int
count_group: count_group:
@ -64,7 +64,7 @@ options:
type: str type: str
cpu: cpu:
description: description:
- How many CPUs to provision on the server - How many CPUs to provision on the server.
default: 1 default: 1
type: int type: int
cpu_autoscale_policy_id: cpu_autoscale_policy_id:
@ -83,8 +83,8 @@ options:
type: str type: str
exact_count: exact_count:
description: description:
- Run in idempotent mode. Will insure that this exact number of servers are running in the provided group, - Run in idempotent mode. Will insure that this exact number of servers are running in the provided group, creating
creating and deleting them to reach that count. Requires count_group to be set. and deleting them to reach that count. Requires O(count_group) to be set.
type: int type: int
group: group:
description: description:
@ -112,7 +112,7 @@ options:
default: 1 default: 1
name: name:
description: description:
- A 1 to 6 character identifier to use for the server. This is required when state is 'present' - A 1 to 6 character identifier to use for the server. This is required when O(state=present).
type: str type: str
network_id: network_id:
description: description:
@ -126,7 +126,7 @@ options:
default: [] default: []
password: password:
description: description:
- Password for the administrator / root user - Password for the administrator / root user.
type: str type: str
primary_dns: primary_dns:
description: description:
@ -150,8 +150,7 @@ options:
type: str type: str
server_ids: server_ids:
description: description:
- Required for started, stopped, and absent states. - Required for started, stopped, and absent states. A list of server Ids to insure are started, stopped, or absent.
A list of server Ids to insure are started, stopped, or absent.
type: list type: list
default: [] default: []
elements: str elements: str
@ -173,8 +172,8 @@ options:
choices: ['standard', 'hyperscale'] choices: ['standard', 'hyperscale']
template: template:
description: description:
- The template to use for server creation. Will search for a template if a partial string is provided. - The template to use for server creation. Will search for a template if a partial string is provided. This is required
This is required when state is 'present' when O(state=present).
type: str type: str
ttl: ttl:
description: description:
@ -188,13 +187,12 @@ options:
choices: ['standard', 'hyperscale', 'bareMetal'] choices: ['standard', 'hyperscale', 'bareMetal']
configuration_id: configuration_id:
description: description:
- Only required for bare metal servers. - Only required for bare metal servers. Specifies the identifier for the specific configuration type of bare metal server
Specifies the identifier for the specific configuration type of bare metal server to deploy. to deploy.
type: str type: str
os_type: os_type:
description: description:
- Only required for bare metal servers. - Only required for bare metal servers. Specifies the OS to provision with the bare metal server.
Specifies the OS to provision with the bare metal server.
type: str type: str
choices: ['redHat6_64Bit', 'centOS6_64Bit', 'windows2012R2Standard_64Bit', 'ubuntu14_64Bit'] choices: ['redHat6_64Bit', 'centOS6_64Bit', 'windows2012R2Standard_64Bit', 'ubuntu14_64Bit']
wait: wait:
@ -203,23 +201,21 @@ options:
type: bool type: bool
default: true default: true
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples # Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
- name: Provision a single Ubuntu Server - name: Provision a single Ubuntu Server
@ -255,29 +251,21 @@ EXAMPLES = '''
server_ids: server_ids:
- UC1ACCT-TEST01 - UC1ACCT-TEST01
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
server_ids: server_ids:
description: The list of server ids that are created description: The list of server ids that are created.
returned: success returned: success
type: list type: list
sample: sample: ["UC1TEST-SVR01", "UC1TEST-SVR02"]
[
"UC1TEST-SVR01",
"UC1TEST-SVR02"
]
partially_created_server_ids: partially_created_server_ids:
description: The list of server ids that are partially created description: The list of server ids that are partially created.
returned: success returned: success
type: list type: list
sample: sample: ["UC1TEST-SVR01", "UC1TEST-SVR02"]
[
"UC1TEST-SVR01",
"UC1TEST-SVR02"
]
servers: servers:
description: The list of server objects returned from CLC description: The list of server objects returned from CLC.
returned: success returned: success
type: list type: list
sample: sample:
@ -433,7 +421,7 @@ servers:
"type":"standard" "type":"standard"
} }
] ]
''' """
__version__ = '${version}' __version__ = '${version}'

View File

@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: clc_server_snapshot module: clc_server_snapshot
short_description: Create, Delete and Restore server snapshots in CenturyLink Cloud short_description: Create, Delete and Restore server snapshots in CenturyLink Cloud
description: description:
@ -48,23 +48,21 @@ options:
required: false required: false
type: str type: str
requirements: requirements:
- python = 2.7
- requests >= 2.5.0 - requests >= 2.5.0
- clc-sdk - clc-sdk
author: "CLC Runner (@clc-runner)" author: "CLC Runner (@clc-runner)"
notes: notes:
- To use this module, it is required to set the below environment variables which enables access to the - To use this module, it is required to set the below environment variables which enables access to the Centurylink Cloud.
Centurylink Cloud - E(CLC_V2_API_USERNAME), the account login id for the Centurylink Cloud.
- CLC_V2_API_USERNAME, the account login id for the centurylink cloud - E(CLC_V2_API_PASSWORD), the account password for the Centurylink Cloud.
- CLC_V2_API_PASSWORD, the account password for the centurylink cloud - Alternatively, the module accepts the API token and account alias. The API token can be generated using the CLC account
- Alternatively, the module accepts the API token and account alias. The API token can be generated using the login and password using the HTTP API call @ https://api.ctl.io/v2/authentication/login
CLC account login and password via the HTTP api call @ https://api.ctl.io/v2/authentication/login - E(CLC_V2_API_TOKEN), the API token generated from https://api.ctl.io/v2/authentication/login
- CLC_V2_API_TOKEN, the API token generated from https://api.ctl.io/v2/authentication/login - E(CLC_ACCT_ALIAS), the account alias associated with the Centurylink Cloud.
- CLC_ACCT_ALIAS, the account alias associated with the centurylink cloud - Users can set E(CLC_V2_API_URL) to specify an endpoint for pointing to a different CLC environment.
- Users can set CLC_V2_API_URL to specify an endpoint for pointing to a different CLC environment. """
'''
EXAMPLES = ''' EXAMPLES = r"""
# Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples # Note - You must set the CLC_V2_API_USERNAME And CLC_V2_API_PASSWD Environment variables before running these examples
- name: Create server snapshot - name: Create server snapshot
@ -91,19 +89,15 @@ EXAMPLES = '''
- UC1TEST-SVR02 - UC1TEST-SVR02
wait: true wait: true
state: absent state: absent
''' """
RETURN = ''' RETURN = r"""
server_ids: server_ids:
description: The list of server ids that are changed description: The list of server ids that are changed.
returned: success returned: success
type: list type: list
sample: sample: ["UC1TEST-SVR01", "UC1TEST-SVR02"]
[ """
"UC1TEST-SVR01",
"UC1TEST-SVR02"
]
'''
__version__ = '${version}' __version__ = '${version}'

View File

@ -8,12 +8,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: cloud_init_data_facts module: cloud_init_data_facts
short_description: Retrieve facts of cloud-init short_description: Retrieve facts of cloud-init
description: description:
- Gathers facts by reading the status.json and result.json of cloud-init. - Gathers facts by reading the C(status.json) and C(result.json) of cloud-init.
author: René Moser (@resmo) author: René Moser (@resmo)
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
@ -22,14 +21,14 @@ extends_documentation_fragment:
options: options:
filter: filter:
description: description:
- Filter facts - Filter facts.
type: str type: str
choices: [status, result] choices: [status, result]
notes: notes:
- See http://cloudinit.readthedocs.io/ for more information about cloud-init. - See http://cloudinit.readthedocs.io/ for more information about cloud-init.
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Gather all facts of cloud init - name: Gather all facts of cloud init
community.general.cloud_init_data_facts: community.general.cloud_init_data_facts:
register: result register: result
@ -44,10 +43,9 @@ EXAMPLES = '''
until: "res.cloud_init_data_facts.status.v1.stage is defined and not res.cloud_init_data_facts.status.v1.stage" until: "res.cloud_init_data_facts.status.v1.stage is defined and not res.cloud_init_data_facts.status.v1.stage"
retries: 50 retries: 50
delay: 5 delay: 5
''' """
RETURN = ''' RETURN = r"""
---
cloud_init_data_facts: cloud_init_data_facts:
description: Facts of result and status. description: Facts of result and status.
returned: success returned: success
@ -84,7 +82,7 @@ cloud_init_data_facts:
"stage": null "stage": null
} }
}' }'
''' """
import os import os

View File

@ -8,14 +8,13 @@
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: cloudflare_dns module: cloudflare_dns
author: author:
- Michael Gruener (@mgruener) - Michael Gruener (@mgruener)
short_description: Manage Cloudflare DNS records short_description: Manage Cloudflare DNS records
description: description:
- "Manages dns records via the Cloudflare API, see the docs: U(https://api.cloudflare.com/)." - 'Manages dns records using the Cloudflare API, see the docs: U(https://api.cloudflare.com/).'
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -92,7 +91,7 @@ options:
priority: priority:
description: description:
- Record priority. - Record priority.
- Required for O(type=MX) and O(type=SRV) - Required for O(type=MX) and O(type=SRV).
default: 1 default: 1
type: int type: int
proto: proto:
@ -150,13 +149,14 @@ options:
ttl: ttl:
description: description:
- The TTL to give the new record. - The TTL to give the new record.
- Must be between 120 and 2,147,483,647 seconds, or 1 for automatic. - Must be between V(120) and V(2,147,483,647) seconds, or V(1) for automatic.
type: int type: int
default: 1 default: 1
type: type:
description: description:
- The type of DNS record to create. Required if O(state=present). - The type of DNS record to create. Required if O(state=present).
- Support for V(SPF) has been removed from community.general 9.0.0 since that record type is no longer supported by CloudFlare. - Support for V(SPF) has been removed from community.general 9.0.0 since that record type is no longer supported by
CloudFlare.
type: str type: str
choices: [A, AAAA, CNAME, DS, MX, NS, SRV, SSHFP, TLSA, CAA, TXT] choices: [A, AAAA, CNAME, DS, MX, NS, SRV, SSHFP, TLSA, CAA, TXT]
value: value:
@ -173,14 +173,14 @@ options:
default: 1 default: 1
zone: zone:
description: description:
- The name of the Zone to work with (e.g. "example.com"). - The name of the Zone to work with (for example V(example.com)).
- The Zone must already exist. - The Zone must already exist.
type: str type: str
required: true required: true
aliases: [domain] aliases: [domain]
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Create a test.example.net A record to point to 127.0.0.1 - name: Create a test.example.net A record to point to 127.0.0.1
community.general.cloudflare_dns: community.general.cloudflare_dns:
zone: example.net zone: example.net
@ -311,9 +311,9 @@ EXAMPLES = r'''
algorithm: 8 algorithm: 8
hash_type: 2 hash_type: 2
value: B4EB5AC4467D2DFB3BAF9FB9961DC1B6FED54A58CDFAA3E465081EC86F89BFAB value: B4EB5AC4467D2DFB3BAF9FB9961DC1B6FED54A58CDFAA3E465081EC86F89BFAB
''' """
RETURN = r''' RETURN = r"""
record: record:
description: A dictionary containing the record data. description: A dictionary containing the record data.
returned: success, except on record deletion returned: success, except on record deletion
@ -345,15 +345,8 @@ record:
description: Additional record data. description: Additional record data.
returned: success, if type is SRV, DS, SSHFP TLSA or CAA returned: success, if type is SRV, DS, SSHFP TLSA or CAA
type: dict type: dict
sample: { sample: {name: "jabber", port: 8080, priority: 10, proto: "_tcp", service: "_xmpp", target: "jabberhost.sample.com",
name: "jabber", weight: 5}
port: 8080,
priority: 10,
proto: "_tcp",
service: "_xmpp",
target: "jabberhost.sample.com",
weight: 5,
}
id: id:
description: The record ID. description: The record ID.
returned: success returned: success
@ -427,7 +420,7 @@ record:
returned: success returned: success
type: str type: str
sample: sample.com sample: sample.com
''' """
import json import json

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: cobbler_sync module: cobbler_sync
short_description: Sync Cobbler short_description: Sync Cobbler
description: description:
@ -57,11 +56,11 @@ author:
todo: todo:
notes: notes:
- Concurrently syncing Cobbler is bound to fail with weird errors. - Concurrently syncing Cobbler is bound to fail with weird errors.
- On python 2.7.8 and older (i.e. on RHEL7) you may need to tweak the python behaviour to disable certificate validation. - On Python 2.7.8 and older (such as RHEL7) you may need to tweak the Python behaviour to disable certificate validation.
More information at L(Certificate verification in Python standard library HTTP clients,https://access.redhat.com/articles/2039753). More information at L(Certificate verification in Python standard library HTTP clients,https://access.redhat.com/articles/2039753).
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Commit Cobbler changes - name: Commit Cobbler changes
community.general.cobbler_sync: community.general.cobbler_sync:
host: cobbler01 host: cobbler01
@ -69,11 +68,11 @@ EXAMPLES = r'''
password: MySuperSecureP4sswOrd password: MySuperSecureP4sswOrd
run_once: true run_once: true
delegate_to: localhost delegate_to: localhost
''' """
RETURN = r''' RETURN = r"""
# Default return values # Default return values
''' """
import ssl import ssl

View File

@ -8,12 +8,11 @@
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: cobbler_system module: cobbler_system
short_description: Manage system objects in Cobbler short_description: Manage system objects in Cobbler
description: description:
- Add, modify or remove systems in Cobbler - Add, modify or remove systems in Cobbler.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -80,11 +79,11 @@ author:
- Dag Wieers (@dagwieers) - Dag Wieers (@dagwieers)
notes: notes:
- Concurrently syncing Cobbler is bound to fail with weird errors. - Concurrently syncing Cobbler is bound to fail with weird errors.
- On python 2.7.8 and older (i.e. on RHEL7) you may need to tweak the python behaviour to disable certificate validation. - On Python 2.7.8 and older (such as RHEL7) you may need to tweak the Python behaviour to disable certificate validation.
More information at L(Certificate verification in Python standard library HTTP clients,https://access.redhat.com/articles/2039753). More information at L(Certificate verification in Python standard library HTTP clients,https://access.redhat.com/articles/2039753).
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Ensure the system exists in Cobbler - name: Ensure the system exists in Cobbler
community.general.cobbler_system: community.general.cobbler_system:
host: cobbler01 host: cobbler01
@ -139,18 +138,18 @@ EXAMPLES = r'''
name: myhost name: myhost
state: absent state: absent
delegate_to: localhost delegate_to: localhost
''' """
RETURN = r''' RETURN = r"""
systems: systems:
description: List of systems description: List of systems.
returned: O(state=query) and O(name) is not provided returned: O(state=query) and O(name) is not provided
type: list type: list
system: system:
description: (Resulting) information about the system we are working with description: (Resulting) information about the system we are working with.
returned: when O(name) is provided returned: when O(name) is provided
type: dict type: dict
''' """
import ssl import ssl

View File

@ -9,18 +9,15 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
---
module: composer module: composer
author: author:
- "Dimitrios Tydeas Mengidis (@dmtrs)" - "Dimitrios Tydeas Mengidis (@dmtrs)"
- "René Moser (@resmo)" - "René Moser (@resmo)"
short_description: Dependency Manager for PHP short_description: Dependency Manager for PHP
description: description:
- > - Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs
Composer is a tool for dependency management in PHP. It allows you to and it will install them in your project for you.
declare the dependent libraries your project needs and it will install
them in your project for you.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -32,7 +29,7 @@ options:
command: command:
type: str type: str
description: description:
- Composer command like "install", "update" and so on. - Composer command like V(install), V(update) and so on.
default: install default: install
arguments: arguments:
type: str type: str
@ -42,13 +39,12 @@ options:
executable: executable:
type: path type: path
description: description:
- Path to PHP Executable on the remote host, if PHP is not in PATH. - Path to PHP executable on the remote host, if PHP is not in E(PATH).
aliases: [php_path] aliases: [php_path]
working_dir: working_dir:
type: path type: path
description: description:
- Directory of your project (see --working-dir). This is required when - Directory of your project (see C(--working-dir)). This is required when the command is not run globally.
the command is not run globally.
- Will be ignored if O(global_command=true). - Will be ignored if O(global_command=true).
global_command: global_command:
description: description:
@ -57,32 +53,32 @@ options:
default: false default: false
prefer_source: prefer_source:
description: description:
- Forces installation from package sources when possible (see --prefer-source). - Forces installation from package sources when possible (see C(--prefer-source)).
default: false default: false
type: bool type: bool
prefer_dist: prefer_dist:
description: description:
- Forces installation from package dist even for dev versions (see --prefer-dist). - Forces installation from package dist even for dev versions (see C(--prefer-dist)).
default: false default: false
type: bool type: bool
no_dev: no_dev:
description: description:
- Disables installation of require-dev packages (see --no-dev). - Disables installation of require-dev packages (see C(--no-dev)).
default: true default: true
type: bool type: bool
no_scripts: no_scripts:
description: description:
- Skips the execution of all scripts defined in composer.json (see --no-scripts). - Skips the execution of all scripts defined in composer.json (see C(--no-scripts)).
default: false default: false
type: bool type: bool
no_plugins: no_plugins:
description: description:
- Disables all plugins (see --no-plugins). - Disables all plugins (see C(--no-plugins)).
default: false default: false
type: bool type: bool
optimize_autoloader: optimize_autoloader:
description: description:
- Optimize autoloader during autoloader dump (see --optimize-autoloader). - Optimize autoloader during autoloader dump (see C(--optimize-autoloader)).
- Convert PSR-0/4 autoloading to classmap to get a faster autoloader. - Convert PSR-0/4 autoloading to classmap to get a faster autoloader.
- Recommended especially for production, but can take a bit of time to run. - Recommended especially for production, but can take a bit of time to run.
default: true default: true
@ -96,12 +92,13 @@ options:
type: bool type: bool
apcu_autoloader: apcu_autoloader:
description: description:
- Uses APCu to cache found/not-found classes - Uses APCu to cache found/not-found classes.
default: false default: false
type: bool type: bool
ignore_platform_reqs: ignore_platform_reqs:
description: description:
- Ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill these. - Ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill
these.
default: false default: false
type: bool type: bool
composer_executable: composer_executable:
@ -111,13 +108,14 @@ options:
version_added: 3.2.0 version_added: 3.2.0
requirements: requirements:
- php - php
- composer installed in bin path (recommended /usr/local/bin) or specified in O(composer_executable) - composer installed in bin path (recommended C(/usr/local/bin)) or specified in O(composer_executable)
notes: notes:
- Default options that are always appended in each execution are --no-ansi, --no-interaction and --no-progress if available. - Default options that are always appended in each execution are C(--no-ansi), C(--no-interaction) and C(--no-progress) if available.
- We received reports about issues on macOS if composer was installed by Homebrew. Please use the official install method to avoid issues. - We received reports about issues on macOS if composer was installed by Homebrew. Please use the official install method
''' to avoid issues.
"""
EXAMPLES = ''' EXAMPLES = r"""
- name: Download and installs all libs and dependencies outlined in the /path/to/project/composer.lock - name: Download and installs all libs and dependencies outlined in the /path/to/project/composer.lock
community.general.composer: community.general.composer:
command: install command: install
@ -141,7 +139,7 @@ EXAMPLES = '''
command: require command: require
global_command: true global_command: true
arguments: my/package arguments: my/package
''' """
import re import re
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule

View File

@ -9,26 +9,21 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: consul module: consul
short_description: Add, modify & delete services within a consul cluster short_description: Add, modify & delete services within a Consul cluster
description: description:
- Registers services and checks for an agent with a consul cluster. - Registers services and checks for an agent with a Consul cluster. A service is some process running on the agent node
A service is some process running on the agent node that should be advertised by that should be advertised by Consul's discovery mechanism. It may optionally supply a check definition, a periodic service
consul's discovery mechanism. It may optionally supply a check definition, test to notify the Consul cluster of service's health.
a periodic service test to notify the consul cluster of service's health. - Checks may also be registered per node, for example disk usage, or cpu usage and notify the health of the entire node to the cluster.
- "Checks may also be registered per node e.g. disk usage, or cpu usage and Service level checks do not require a check name or id as these are derived by Consul from the Service name and id respectively
notify the health of the entire node to the cluster. by appending V(service:) Node level checks require a O(check_name) and optionally a O(check_id).
Service level checks do not require a check name or id as these are derived - Currently, there is no complete way to retrieve the script, interval or TTL metadata for a registered check. Without this
by Consul from the Service name and id respectively by appending 'service:' metadata it is not possible to tell if the data supplied with ansible represents a change to a check. As a result this
Node level checks require a O(check_name) and optionally a O(check_id)." does not attempt to determine changes and will always report a changed occurred. An API method is planned to supply this
- Currently, there is no complete way to retrieve the script, interval or TTL metadata so at that stage change management will be added.
metadata for a registered check. Without this metadata it is not possible to - See U(http://consul.io) for more details.
tell if the data supplied with ansible represents a change to a check. As a
result this does not attempt to determine changes and will always report a
changed occurred. An API method is planned to supply this metadata so at that
stage change management will be added.
- "See U(http://consul.io) for more details."
requirements: requirements:
- python-consul - python-consul
- requests - requests
@ -44,38 +39,36 @@ options:
state: state:
type: str type: str
description: description:
- Register or deregister the consul service, defaults to present. - Register or deregister the Consul service, defaults to present.
default: present default: present
choices: ['present', 'absent'] choices: ['present', 'absent']
service_name: service_name:
type: str type: str
description: description:
- Unique name for the service on a node, must be unique per node, - Unique name for the service on a node, must be unique per node, required if registering a service. May be omitted
required if registering a service. May be omitted if registering if registering a node level check.
a node level check.
service_id: service_id:
type: str type: str
description: description:
- The ID for the service, must be unique per node. If O(state=absent), - The ID for the service, must be unique per node. If O(state=absent), defaults to the service name if supplied.
defaults to the service name if supplied.
host: host:
type: str type: str
description: description:
- Host of the consul agent defaults to localhost. - Host of the Consul agent defaults to localhost.
default: localhost default: localhost
port: port:
type: int type: int
description: description:
- The port on which the consul agent is running. - The port on which the Consul agent is running.
default: 8500 default: 8500
scheme: scheme:
type: str type: str
description: description:
- The protocol scheme on which the consul agent is running. - The protocol scheme on which the Consul agent is running.
default: http default: http
validate_certs: validate_certs:
description: description:
- Whether to verify the TLS certificate of the consul agent. - Whether to verify the TLS certificate of the Consul agent.
type: bool type: bool
default: true default: true
notes: notes:
@ -85,15 +78,13 @@ options:
service_port: service_port:
type: int type: int
description: description:
- The port on which the service is listening. Can optionally be supplied for - The port on which the service is listening. Can optionally be supplied for registration of a service, that is if O(service_name)
registration of a service, that is if O(service_name) or O(service_id) is set. or O(service_id) is set.
service_address: service_address:
type: str type: str
description: description:
- The address to advertise that the service will be listening on. - The address to advertise that the service will be listening on. This value will be passed as the C(address) parameter
This value will be passed as the C(address) parameter to Consul's to Consul's C(/v1/agent/service/register) API method, so refer to the Consul API documentation for further details.
C(/v1/agent/service/register) API method, so refer to the Consul API
documentation for further details.
tags: tags:
type: list type: list
elements: str elements: str
@ -108,72 +99,64 @@ options:
interval: interval:
type: str type: str
description: description:
- The interval at which the service check will be run. - The interval at which the service check will be run. This is a number with a V(s) or V(m) suffix to signify the units
This is a number with a V(s) or V(m) suffix to signify the units of seconds or minutes, for example V(15s) or V(1m). of seconds or minutes, for example V(15s) or V(1m). If no suffix is supplied V(s) will be used by default, for example
If no suffix is supplied V(s) will be used by default, for example V(10) will be V(10s). V(10) will be V(10s).
- Required if one of the parameters O(script), O(http), or O(tcp) is specified. - Required if one of the parameters O(script), O(http), or O(tcp) is specified.
check_id: check_id:
type: str type: str
description: description:
- An ID for the service check. If O(state=absent), defaults to - An ID for the service check. If O(state=absent), defaults to O(check_name). Ignored if part of a service definition.
O(check_name). Ignored if part of a service definition.
check_name: check_name:
type: str type: str
description: description:
- Name for the service check. Required if standalone, ignored if - Name for the service check. Required if standalone, ignored if part of service definition.
part of service definition.
check_node: check_node:
description: description:
- Node name. - Node name.
# TODO: properly document!
type: str type: str
check_host: check_host:
description: description:
- Host name. - Host name.
# TODO: properly document!
type: str type: str
ttl: ttl:
type: str type: str
description: description:
- Checks can be registered with a TTL instead of a O(script) and O(interval) - Checks can be registered with a TTL instead of a O(script) and O(interval) this means that the service will check
this means that the service will check in with the agent before the in with the agent before the TTL expires. If it does not the check will be considered failed. Required if registering
TTL expires. If it doesn't the check will be considered failed. a check and the script an interval are missing Similar to the interval this is a number with a V(s) or V(m) suffix
Required if registering a check and the script an interval are missing to signify the units of seconds or minutes, for example V(15s) or V(1m). If no suffix is supplied V(s) will be used
Similar to the interval this is a number with a V(s) or V(m) suffix to by default, for example V(10) will be V(10s).
signify the units of seconds or minutes, for example V(15s) or V(1m).
If no suffix is supplied V(s) will be used by default, for example V(10) will be V(10s).
- Mutually exclusive with O(script), O(tcp) and O(http). - Mutually exclusive with O(script), O(tcp) and O(http).
tcp: tcp:
type: str type: str
description: description:
- Checks can be registered with a TCP port. This means that consul - Checks can be registered with a TCP port. This means that Consul will check if the connection attempt to that port
will check if the connection attempt to that port is successful (that is, the port is currently accepting connections). is successful (that is, the port is currently accepting connections). The format is V(host:port), for example V(localhost:80).
The format is V(host:port), for example V(localhost:80).
- Requires O(interval) to be provided. - Requires O(interval) to be provided.
- Mutually exclusive with O(script), O(ttl) and O(http). - Mutually exclusive with O(script), O(ttl) and O(http).
version_added: '1.3.0' version_added: '1.3.0'
http: http:
type: str type: str
description: description:
- Checks can be registered with an HTTP endpoint. This means that consul - Checks can be registered with an HTTP endpoint. This means that Consul will check that the http endpoint returns a
will check that the http endpoint returns a successful HTTP status. successful HTTP status.
- Requires O(interval) to be provided. - Requires O(interval) to be provided.
- Mutually exclusive with O(script), O(ttl) and O(tcp). - Mutually exclusive with O(script), O(ttl) and O(tcp).
timeout: timeout:
type: str type: str
description: description:
- A custom HTTP check timeout. The consul default is 10 seconds. - A custom HTTP check timeout. The Consul default is 10 seconds. Similar to the interval this is a number with a V(s)
Similar to the interval this is a number with a V(s) or V(m) suffix to or V(m) suffix to signify the units of seconds or minutes, for example V(15s) or V(1m). If no suffix is supplied V(s)
signify the units of seconds or minutes, for example V(15s) or V(1m). will be used by default, for example V(10) will be V(10s).
If no suffix is supplied V(s) will be used by default, for example V(10) will be V(10s).
token: token:
type: str type: str
description: description:
- The token key identifying an ACL rule set. May be required to register services. - The token key identifying an ACL rule set. May be required to register services.
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Register nginx service with the local consul agent - name: Register nginx service with the local Consul agent
community.general.consul: community.general.consul:
service_name: nginx service_name: nginx
service_port: 80 service_port: 80
@ -239,7 +222,7 @@ EXAMPLES = '''
service_id: nginx service_id: nginx
interval: 60s interval: 60s
http: http://localhost:80/morestatus http: http://localhost:80/morestatus
''' """
try: try:
import consul import consul

View File

@ -9,13 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
module: consul_acl_bootstrap module: consul_acl_bootstrap
short_description: Bootstrap ACLs in Consul short_description: Bootstrap ACLs in Consul
version_added: 8.3.0 version_added: 8.3.0
description: description:
- Allows bootstrapping of ACLs in a Consul cluster, see - Allows bootstrapping of ACLs in a Consul cluster, see U(https://developer.hashicorp.com/consul/api-docs/acl#bootstrap-acls)
U(https://developer.hashicorp.com/consul/api-docs/acl#bootstrap-acls) for details. for details.
author: author:
- Florian Apolloner (@apollo13) - Florian Apolloner (@apollo13)
extends_documentation_fragment: extends_documentation_fragment:
@ -40,20 +40,18 @@ options:
type: str type: str
""" """
EXAMPLES = """ EXAMPLES = r"""
- name: Bootstrap the ACL system - name: Bootstrap the ACL system
community.general.consul_acl_bootstrap: community.general.consul_acl_bootstrap:
bootstrap_secret: 22eaeed1-bdbd-4651-724e-42ae6c43e387 bootstrap_secret: 22eaeed1-bdbd-4651-724e-42ae6c43e387
""" """
RETURN = """ RETURN = r"""
result: result:
description: description:
- The bootstrap result as returned by the consul HTTP API. - The bootstrap result as returned by the Consul HTTP API.
- "B(Note:) If O(bootstrap_secret) has been specified the C(SecretID) and - B(Note:) If O(bootstrap_secret) has been specified the C(SecretID) and C(ID) will not contain the secret but C(VALUE_SPECIFIED_IN_NO_LOG_PARAMETER).
C(ID) will not contain the secret but C(VALUE_SPECIFIED_IN_NO_LOG_PARAMETER). If you pass O(bootstrap_secret), make sure your playbook/role does not depend on this return value!
If you pass O(bootstrap_secret), make sure your playbook/role does not depend
on this return value!"
returned: changed returned: changed
type: dict type: dict
sample: sample:

View File

@ -9,20 +9,17 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: consul_agent_check module: consul_agent_check
short_description: Add, modify, and delete checks within a consul cluster short_description: Add, modify, and delete checks within a Consul cluster
version_added: 9.1.0 version_added: 9.1.0
description: description:
- Allows the addition, modification and deletion of checks in a consul - Allows the addition, modification and deletion of checks in a Consul cluster using the agent. For more details on using
cluster via the agent. For more details on using and configuring Checks, and configuring Checks, see U(https://developer.hashicorp.com/consul/api-docs/agent/check).
see U(https://developer.hashicorp.com/consul/api-docs/agent/check). - Currently, there is no complete way to retrieve the script, interval or TTL metadata for a registered check. Without this
- Currently, there is no complete way to retrieve the script, interval or TTL metadata it is not possible to tell if the data supplied with ansible represents a change to a check. As a result this
metadata for a registered check. Without this metadata it is not possible to does not attempt to determine changes and will always report a changed occurred. An API method is planned to supply this
tell if the data supplied with ansible represents a change to a check. As a metadata so at that stage change management will be added.
result this does not attempt to determine changes and will always report a
changed occurred. An API method is planned to supply this metadata so at that
stage change management will be added.
author: author:
- Michael Ilg (@Ilgmi) - Michael Ilg (@Ilgmi)
extends_documentation_fragment: extends_documentation_fragment:
@ -34,13 +31,13 @@ attributes:
check_mode: check_mode:
support: full support: full
details: details:
- The result is the object as it is defined in the module options and not the object structure of the consul API. - The result is the object as it is defined in the module options and not the object structure of the Consul API. For
For a better overview of what the object structure looks like, a better overview of what the object structure looks like, take a look at U(https://developer.hashicorp.com/consul/api-docs/agent/check#list-checks).
take a look at U(https://developer.hashicorp.com/consul/api-docs/agent/check#list-checks).
diff_mode: diff_mode:
support: partial support: partial
details: details:
- In check mode the diff will show the object as it is defined in the module options and not the object structure of the consul API. - In check mode the diff will show the object as it is defined in the module options and not the object structure of
the Consul API.
options: options:
state: state:
description: description:
@ -54,14 +51,14 @@ options:
type: str type: str
id: id:
description: description:
- Specifies a unique ID for this check on the node. This defaults to the O(name) parameter, but it may be necessary to provide - Specifies a unique ID for this check on the node. This defaults to the O(name) parameter, but it may be necessary
an ID for uniqueness. This value will return in the response as "CheckId". to provide an ID for uniqueness. This value will return in the response as "CheckId".
type: str type: str
interval: interval:
description: description:
- The interval at which the service check will be run. - The interval at which the service check will be run. This is a number with a V(s) or V(m) suffix to signify the units
This is a number with a V(s) or V(m) suffix to signify the units of seconds or minutes, for example V(15s) or V(1m). of seconds or minutes, for example V(15s) or V(1m). If no suffix is supplied V(s) will be used by default, for example
If no suffix is supplied V(s) will be used by default, for example V(10) will be V(10s). V(10) will be V(10s).
- Required if one of the parameters O(args), O(http), or O(tcp) is specified. - Required if one of the parameters O(args), O(http), or O(tcp) is specified.
type: str type: str
notes: notes:
@ -77,46 +74,41 @@ options:
elements: str elements: str
ttl: ttl:
description: description:
- Checks can be registered with a TTL instead of a O(args) and O(interval) - Checks can be registered with a TTL instead of a O(args) and O(interval) this means that the service will check in
this means that the service will check in with the agent before the with the agent before the TTL expires. If it does not the check will be considered failed. Required if registering
TTL expires. If it doesn't the check will be considered failed. a check and the script an interval are missing Similar to the interval this is a number with a V(s) or V(m) suffix
Required if registering a check and the script an interval are missing to signify the units of seconds or minutes, for example V(15s) or V(1m). If no suffix is supplied V(s) will be used
Similar to the interval this is a number with a V(s) or V(m) suffix to by default, for example V(10) will be V(10s).
signify the units of seconds or minutes, for example V(15s) or V(1m).
If no suffix is supplied V(s) will be used by default, for example V(10) will be V(10s).
- Mutually exclusive with O(args), O(tcp) and O(http). - Mutually exclusive with O(args), O(tcp) and O(http).
type: str type: str
tcp: tcp:
description: description:
- Checks can be registered with a TCP port. This means that consul - Checks can be registered with a TCP port. This means that Consul will check if the connection attempt to that port
will check if the connection attempt to that port is successful (that is, the port is currently accepting connections). is successful (that is, the port is currently accepting connections). The format is V(host:port), for example V(localhost:80).
The format is V(host:port), for example V(localhost:80).
- Requires O(interval) to be provided. - Requires O(interval) to be provided.
- Mutually exclusive with O(args), O(ttl) and O(http). - Mutually exclusive with O(args), O(ttl) and O(http).
type: str type: str
version_added: '1.3.0' version_added: '1.3.0'
http: http:
description: description:
- Checks can be registered with an HTTP endpoint. This means that consul - Checks can be registered with an HTTP endpoint. This means that Consul will check that the http endpoint returns a
will check that the http endpoint returns a successful HTTP status. successful HTTP status.
- Requires O(interval) to be provided. - Requires O(interval) to be provided.
- Mutually exclusive with O(args), O(ttl) and O(tcp). - Mutually exclusive with O(args), O(ttl) and O(tcp).
type: str type: str
timeout: timeout:
description: description:
- A custom HTTP check timeout. The consul default is 10 seconds. - A custom HTTP check timeout. The Consul default is 10 seconds. Similar to the interval this is a number with a V(s)
Similar to the interval this is a number with a V(s) or V(m) suffix to or V(m) suffix to signify the units of seconds or minutes, for example V(15s) or V(1m). If no suffix is supplied V(s)
signify the units of seconds or minutes, for example V(15s) or V(1m). will be used by default, for example V(10) will be V(10s).
If no suffix is supplied V(s) will be used by default, for example V(10) will be V(10s).
type: str type: str
service_id: service_id:
description: description:
- The ID for the service, must be unique per node. If O(state=absent), - The ID for the service, must be unique per node. If O(state=absent), defaults to the service name if supplied.
defaults to the service name if supplied.
type: str type: str
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Register tcp check for service 'nginx' - name: Register tcp check for service 'nginx'
community.general.consul_agent_check: community.general.consul_agent_check:
name: nginx_tcp_check name: nginx_tcp_check
@ -138,11 +130,11 @@ EXAMPLES = '''
state: absent state: absent
id: nginx_http_check id: nginx_http_check
service_id: "{{ nginx_service.ID }}" service_id: "{{ nginx_service.ID }}"
''' """
RETURN = """ RETURN = r"""
check: check:
description: The check as returned by the consul HTTP API. description: The check as returned by the Consul HTTP API.
returned: always returned: always
type: dict type: dict
sample: sample:

View File

@ -9,17 +9,15 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: consul_agent_service module: consul_agent_service
short_description: Add, modify and delete services within a consul cluster short_description: Add, modify and delete services within a Consul cluster
version_added: 9.1.0 version_added: 9.1.0
description: description:
- Allows the addition, modification and deletion of services in a consul - Allows the addition, modification and deletion of services in a Consul cluster using the agent.
cluster via the agent. - There are currently no plans to create services and checks in one. This is because the Consul API does not provide checks
- There are currently no plans to create services and checks in one. for a service and the checks themselves do not match the module parameters. Therefore, only a service without checks can
This is because the Consul API does not provide checks for a service and be created in this module.
the checks themselves do not match the module parameters.
Therefore, only a service without checks can be created in this module.
author: author:
- Michael Ilg (@Ilgmi) - Michael Ilg (@Ilgmi)
extends_documentation_fragment: extends_documentation_fragment:
@ -43,13 +41,12 @@ options:
type: str type: str
name: name:
description: description:
- Unique name for the service on a node, must be unique per node, - Unique name for the service on a node, must be unique per node, required if registering a service.
required if registering a service.
type: str type: str
id: id:
description: description:
- Specifies a unique ID for this service. This must be unique per agent. This defaults to the O(name) parameter if not provided. - Specifies a unique ID for this service. This must be unique per agent. This defaults to the O(name) parameter if not
If O(state=absent), defaults to the service name if supplied. provided. If O(state=absent), defaults to the service name if supplied.
type: str type: str
tags: tags:
description: description:
@ -58,31 +55,28 @@ options:
elements: str elements: str
address: address:
description: description:
- The address to advertise that the service will be listening on. - The address to advertise that the service will be listening on. This value will be passed as the C(address) parameter
This value will be passed as the C(address) parameter to Consul's to Consul's C(/v1/agent/service/register) API method, so refer to the Consul API documentation for further details.
C(/v1/agent/service/register) API method, so refer to the Consul API
documentation for further details.
type: str type: str
meta: meta:
description: description:
- Optional meta data used for filtering. - Optional meta data used for filtering. For keys, the characters C(A-Z), C(a-z), C(0-9), C(_), C(-) are allowed. Not
For keys, the characters C(A-Z), C(a-z), C(0-9), C(_), C(-) are allowed. allowed characters are replaced with underscores.
Not allowed characters are replaced with underscores.
type: dict type: dict
service_port: service_port:
description: description:
- The port on which the service is listening. Can optionally be supplied for - The port on which the service is listening. Can optionally be supplied for registration of a service, that is if O(name)
registration of a service, that is if O(name) or O(id) is set. or O(id) is set.
type: int type: int
enable_tag_override: enable_tag_override:
description: description:
- Specifies to disable the anti-entropy feature for this service's tags. - Specifies to disable the anti-entropy feature for this service's tags. If C(EnableTagOverride) is set to true then external
If EnableTagOverride is set to true then external agents can update this service in the catalog and modify the tags. agents can update this service in the catalog and modify the tags.
type: bool type: bool
default: False default: false
weights: weights:
description: description:
- Specifies weights for the service - Specifies weights for the service.
type: dict type: dict
suboptions: suboptions:
passing: passing:
@ -96,10 +90,10 @@ options:
type: int type: int
default: 1 default: 1
default: {"passing": 1, "warning": 1} default: {"passing": 1, "warning": 1}
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Register nginx service with the local consul agent - name: Register nginx service with the local Consul agent
community.general.consul_agent_service: community.general.consul_agent_service:
host: consul1.example.com host: consul1.example.com
token: some_management_acl token: some_management_acl
@ -162,11 +156,11 @@ EXAMPLES = '''
tags: tags:
- prod - prod
- worker - worker
''' """
RETURN = """ RETURN = r"""
service: service:
description: The service as returned by the consul HTTP API. description: The service as returned by the Consul HTTP API.
returned: always returned: always
type: dict type: dict
sample: sample:

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
module: consul_auth_method module: consul_auth_method
short_description: Manipulate Consul auth methods short_description: Manipulate Consul auth methods
version_added: 8.3.0 version_added: 8.3.0
description: description:
- Allows the addition, modification and deletion of auth methods in a consul - Allows the addition, modification and deletion of auth methods in a Consul cluster using the agent. For more details on
cluster via the agent. For more details on using and configuring ACLs, using and configuring ACLs, see U(https://www.consul.io/docs/guides/acl.html).
see U(https://www.consul.io/docs/guides/acl.html).
author: author:
- Florian Apolloner (@apollo13) - Florian Apolloner (@apollo13)
extends_documentation_fragment: extends_documentation_fragment:
@ -77,7 +76,7 @@ options:
type: dict type: dict
""" """
EXAMPLES = """ EXAMPLES = r"""
- name: Create an auth method - name: Create an auth method
community.general.consul_auth_method: community.general.consul_auth_method:
name: test name: test
@ -103,9 +102,9 @@ EXAMPLES = """
token: "{{ consul_management_token }}" token: "{{ consul_management_token }}"
""" """
RETURN = """ RETURN = r"""
auth_method: auth_method:
description: The auth method as returned by the consul HTTP API. description: The auth method as returned by the Consul HTTP API.
returned: always returned: always
type: dict type: dict
sample: sample:

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
module: consul_binding_rule module: consul_binding_rule
short_description: Manipulate Consul binding rules short_description: Manipulate Consul binding rules
version_added: 8.3.0 version_added: 8.3.0
description: description:
- Allows the addition, modification and deletion of binding rules in a consul - Allows the addition, modification and deletion of binding rules in a Consul cluster using the agent. For more details on
cluster via the agent. For more details on using and configuring binding rules, using and configuring binding rules, see U(https://developer.hashicorp.com/consul/api-docs/acl/binding-rules).
see U(https://developer.hashicorp.com/consul/api-docs/acl/binding-rules).
author: author:
- Florian Apolloner (@apollo13) - Florian Apolloner (@apollo13)
extends_documentation_fragment: extends_documentation_fragment:
@ -41,7 +40,8 @@ options:
name: name:
description: description:
- Specifies a name for the binding rule. - Specifies a name for the binding rule.
- 'Note: This is used to identify the binding rule. But since the API does not support a name, it is prefixed to the description.' - 'Note: This is used to identify the binding rule. But since the API does not support a name, it is prefixed to the
description.'
type: str type: str
required: true required: true
description: description:
@ -74,7 +74,7 @@ options:
type: dict type: dict
""" """
EXAMPLES = """ EXAMPLES = r"""
- name: Create a binding rule - name: Create a binding rule
community.general.consul_binding_rule: community.general.consul_binding_rule:
name: my_name name: my_name
@ -91,9 +91,9 @@ EXAMPLES = """
state: absent state: absent
""" """
RETURN = """ RETURN = r"""
binding_rule: binding_rule:
description: The binding rule as returned by the consul HTTP API. description: The binding rule as returned by the Consul HTTP API.
returned: always returned: always
type: dict type: dict
sample: sample:

View File

@ -10,15 +10,14 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: consul_kv module: consul_kv
short_description: Manipulate entries in the key/value store of a consul cluster short_description: Manipulate entries in the key/value store of a Consul cluster
description: description:
- Allows the retrieval, addition, modification and deletion of key/value entries in a - Allows the retrieval, addition, modification and deletion of key/value entries in a Consul cluster using the agent. The
consul cluster via the agent. The entire contents of the record, including entire contents of the record, including the indices, flags and session are returned as C(value).
the indices, flags and session are returned as C(value). - If the O(key) represents a prefix then note that when a value is removed, the existing value if any is returned as part
- If the O(key) represents a prefix then note that when a value is removed, the existing of the results.
value if any is returned as part of the results.
- See http://www.consul.io/docs/agent/http.html#kv for more details. - See http://www.consul.io/docs/agent/http.html#kv for more details.
requirements: requirements:
- python-consul - python-consul
@ -36,16 +35,13 @@ attributes:
options: options:
state: state:
description: description:
- The action to take with the supplied key and value. If the state is V(present) and O(value) is set, the key - The action to take with the supplied key and value. If the state is V(present) and O(value) is set, the key contents
contents will be set to the value supplied and C(changed) will be set to V(true) only if the value was will be set to the value supplied and C(changed) will be set to V(true) only if the value was different to the current
different to the current contents. If the state is V(present) and O(value) is not set, the existing value contents. If the state is V(present) and O(value) is not set, the existing value associated to the key will be returned.
associated to the key will be returned. The state V(absent) will remove the key/value pair, The state V(absent) will remove the key/value pair, again C(changed) will be set to V(true) only if the key actually
again C(changed) will be set to V(true) only if the key actually existed existed prior to the removal. An attempt can be made to obtain or free the lock associated with a key/value pair with
prior to the removal. An attempt can be made to obtain or free the the states V(acquire) or V(release) respectively. A valid session must be supplied to make the attempt C(changed) will
lock associated with a key/value pair with the states V(acquire) or be V(true) if the attempt is successful, V(false) otherwise.
V(release) respectively. a valid session must be supplied to make the
attempt changed will be true if the attempt is successful, false
otherwise.
type: str type: str
choices: [absent, acquire, present, release] choices: [absent, acquire, present, release]
default: present default: present
@ -56,36 +52,30 @@ options:
required: true required: true
value: value:
description: description:
- The value should be associated with the given key, required if O(state) - The value should be associated with the given key, required if O(state) is V(present).
is V(present).
type: str type: str
recurse: recurse:
description: description:
- If the key represents a prefix, each entry with the prefix can be - If the key represents a prefix, each entry with the prefix can be retrieved by setting this to V(true).
retrieved by setting this to V(true).
type: bool type: bool
retrieve: retrieve:
description: description:
- If the O(state) is V(present) and O(value) is set, perform a - If the O(state) is V(present) and O(value) is set, perform a read after setting the value and return this value.
read after setting the value and return this value.
default: true default: true
type: bool type: bool
session: session:
description: description:
- The session that should be used to acquire or release a lock - The session that should be used to acquire or release a lock associated with a key/value pair.
associated with a key/value pair.
type: str type: str
token: token:
description: description:
- The token key identifying an ACL rule set that controls access to - The token key identifying an ACL rule set that controls access to the key value pair.
the key value pair
type: str type: str
cas: cas:
description: description:
- Used when acquiring a lock with a session. If the O(cas) is V(0), then - Used when acquiring a lock with a session. If the O(cas) is V(0), then Consul will only put the key if it does not
Consul will only put the key if it does not already exist. If the already exist. If the O(cas) value is non-zero, then the key is only set if the index matches the ModifyIndex of that
O(cas) value is non-zero, then the key is only set if the index matches key.
the ModifyIndex of that key.
type: str type: str
flags: flags:
description: description:
@ -93,34 +83,34 @@ options:
type: str type: str
host: host:
description: description:
- Host of the consul agent. - Host of the Consul agent.
type: str type: str
default: localhost default: localhost
port: port:
description: description:
- The port on which the consul agent is running. - The port on which the Consul agent is running.
type: int type: int
default: 8500 default: 8500
scheme: scheme:
description: description:
- The protocol scheme on which the consul agent is running. - The protocol scheme on which the Consul agent is running.
type: str type: str
default: http default: http
validate_certs: validate_certs:
description: description:
- Whether to verify the tls certificate of the consul agent. - Whether to verify the tls certificate of the Consul agent.
type: bool type: bool
default: true default: true
datacenter: datacenter:
description: description:
- The name of the datacenter to query. If unspecified, the query will default - The name of the datacenter to query. If unspecified, the query will default to the datacenter of the Consul agent
to the datacenter of the Consul agent on O(host). on O(host).
type: str type: str
version_added: 10.0.0 version_added: 10.0.0
''' """
EXAMPLES = ''' EXAMPLES = r"""
# If the key does not exist, the value associated to the "data" property in `retrieved_key` will be `None` # If the key does not exist, the value associated to the "data" property in `retrieved_key` will be `None`
# If the key value is empty string, `retrieved_key["data"]["Value"]` will be `None` # If the key value is empty string, `retrieved_key["data"]["Value"]` will be `None`
- name: Retrieve a value from the key/value store - name: Retrieve a value from the key/value store
@ -138,7 +128,7 @@ EXAMPLES = '''
key: somekey key: somekey
state: absent state: absent
- name: Add a node to an arbitrary group via consul inventory (see consul.ini) - name: Add a node to an arbitrary group using Consul inventory (see consul.ini)
community.general.consul_kv: community.general.consul_kv:
key: ansible/groups/dc1/somenode key: ansible/groups/dc1/somenode
value: top_secret value: top_secret
@ -149,7 +139,7 @@ EXAMPLES = '''
value: 20160509 value: 20160509
session: "{{ sessionid }}" session: "{{ sessionid }}"
state: acquire state: acquire
''' """
from ansible.module_utils.common.text.converters import to_text from ansible.module_utils.common.text.converters import to_text

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
module: consul_policy module: consul_policy
short_description: Manipulate Consul policies short_description: Manipulate Consul policies
version_added: 7.2.0 version_added: 7.2.0
description: description:
- Allows the addition, modification and deletion of policies in a consul - Allows the addition, modification and deletion of policies in a Consul cluster using the agent. For more details on using
cluster via the agent. For more details on using and configuring ACLs, and configuring ACLs, see U(https://www.consul.io/docs/guides/acl.html).
see U(https://www.consul.io/docs/guides/acl.html).
author: author:
- Håkon Lerring (@Hakon) - Håkon Lerring (@Hakon)
extends_documentation_fragment: extends_documentation_fragment:
@ -49,8 +48,7 @@ options:
elements: str elements: str
name: name:
description: description:
- The name that should be associated with the policy, this is opaque - The name that should be associated with the policy, this is opaque to Consul.
to Consul.
required: true required: true
type: str type: str
description: description:
@ -63,7 +61,7 @@ options:
- Rule document that should be associated with the current policy. - Rule document that should be associated with the current policy.
""" """
EXAMPLES = """ EXAMPLES = r"""
- name: Create a policy with rules - name: Create a policy with rules
community.general.consul_policy: community.general.consul_policy:
host: consul1.example.com host: consul1.example.com
@ -101,9 +99,9 @@ EXAMPLES = """
state: absent state: absent
""" """
RETURN = """ RETURN = r"""
policy: policy:
description: The policy as returned by the consul HTTP API. description: The policy as returned by the Consul HTTP API.
returned: always returned: always
type: dict type: dict
sample: sample:

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
module: consul_role module: consul_role
short_description: Manipulate Consul roles short_description: Manipulate Consul roles
version_added: 7.5.0 version_added: 7.5.0
description: description:
- Allows the addition, modification and deletion of roles in a consul - Allows the addition, modification and deletion of roles in a Consul cluster using the agent. For more details on using and
cluster via the agent. For more details on using and configuring ACLs, configuring ACLs, see U(https://www.consul.io/docs/guides/acl.html).
see U(https://www.consul.io/docs/guides/acl.html).
author: author:
- Håkon Lerring (@Hakon) - Håkon Lerring (@Hakon)
extends_documentation_fragment: extends_documentation_fragment:
@ -42,7 +41,7 @@ options:
type: str type: str
state: state:
description: description:
- whether the role should be present or absent. - Whether the role should be present or absent.
choices: ['present', 'absent'] choices: ['present', 'absent']
default: present default: present
type: str type: str
@ -98,9 +97,9 @@ options:
description: description:
- The name of the node. - The name of the node.
- Must not be longer than 256 characters, must start and end with a lowercase alphanumeric character. - Must not be longer than 256 characters, must start and end with a lowercase alphanumeric character.
- May only contain lowercase alphanumeric characters as well as - and _. - May only contain lowercase alphanumeric characters as well as V(-) and V(_).
- This suboption has been renamed from O(service_identities[].name) to O(service_identities[].service_name) - This suboption has been renamed from O(service_identities[].name) to O(service_identities[].service_name) in community.general
in community.general 8.3.0. The old name can still be used. 8.3.0. The old name can still be used.
type: str type: str
required: true required: true
aliases: aliases:
@ -110,7 +109,7 @@ options:
- The datacenters the policies will be effective. - The datacenters the policies will be effective.
- This will result in effective policy only being valid in this datacenter. - This will result in effective policy only being valid in this datacenter.
- If an empty array (V([])) is specified, the policies will valid in all datacenters. - If an empty array (V([])) is specified, the policies will valid in all datacenters.
- including those which do not yet exist but may in the future. - Including those which do not yet exist but may in the future.
type: list type: list
elements: str elements: str
node_identities: node_identities:
@ -125,9 +124,9 @@ options:
description: description:
- The name of the node. - The name of the node.
- Must not be longer than 256 characters, must start and end with a lowercase alphanumeric character. - Must not be longer than 256 characters, must start and end with a lowercase alphanumeric character.
- May only contain lowercase alphanumeric characters as well as - and _. - May only contain lowercase alphanumeric characters as well as V(-) and V(_).
- This suboption has been renamed from O(node_identities[].name) to O(node_identities[].node_name) - This suboption has been renamed from O(node_identities[].name) to O(node_identities[].node_name) in community.general
in community.general 8.3.0. The old name can still be used. 8.3.0. The old name can still be used.
type: str type: str
required: true required: true
aliases: aliases:
@ -140,7 +139,7 @@ options:
required: true required: true
""" """
EXAMPLES = """ EXAMPLES = r"""
- name: Create a role with 2 policies - name: Create a role with 2 policies
community.general.consul_role: community.general.consul_role:
host: consul1.example.com host: consul1.example.com
@ -177,7 +176,7 @@ EXAMPLES = """
state: absent state: absent
""" """
RETURN = """ RETURN = r"""
role: role:
description: The role object. description: The role object.
returned: success returned: success

View File

@ -8,14 +8,13 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r"""
module: consul_session module: consul_session
short_description: Manipulate consul sessions short_description: Manipulate Consul sessions
description: description:
- Allows the addition, modification and deletion of sessions in a consul - Allows the addition, modification and deletion of sessions in a Consul cluster. These sessions can then be used in conjunction
cluster. These sessions can then be used in conjunction with key value pairs with key value pairs to implement distributed locks. In depth documentation for working with sessions can be found at
to implement distributed locks. In depth documentation for working with U(http://www.consul.io/docs/internals/sessions.html).
sessions can be found at http://www.consul.io/docs/internals/sessions.html
author: author:
- Steve Gargan (@sgargan) - Steve Gargan (@sgargan)
- Håkon Lerring (@Hakon) - Håkon Lerring (@Hakon)
@ -34,55 +33,45 @@ attributes:
options: options:
id: id:
description: description:
- ID of the session, required when O(state) is either V(info) or - ID of the session, required when O(state) is either V(info) or V(remove).
V(remove).
type: str type: str
state: state:
description: description:
- Whether the session should be present i.e. created if it doesn't - Whether the session should be present, in other words it should be created if it does not exist, or absent, removed if present. If created,
exist, or absent, removed if present. If created, the O(id) for the the O(id) for the session is returned in the output. If V(absent), O(id) is required to remove the session. Info for
session is returned in the output. If V(absent), O(id) is a single session, all the sessions for a node or all available sessions can be retrieved by specifying V(info), V(node)
required to remove the session. Info for a single session, all the or V(list) for the O(state); for V(node) or V(info), the node O(name) or session O(id) is required as parameter.
sessions for a node or all available sessions can be retrieved by
specifying V(info), V(node) or V(list) for the O(state); for V(node)
or V(info), the node O(name) or session O(id) is required as parameter.
choices: [absent, info, list, node, present] choices: [absent, info, list, node, present]
type: str type: str
default: present default: present
name: name:
description: description:
- The name that should be associated with the session. Required when - The name that should be associated with the session. Required when O(state=node) is used.
O(state=node) is used.
type: str type: str
delay: delay:
description: description:
- The optional lock delay that can be attached to the session when it - The optional lock delay that can be attached to the session when it is created. Locks for invalidated sessions ar
is created. Locks for invalidated sessions ar blocked from being blocked from being acquired until this delay has expired. Durations are in seconds.
acquired until this delay has expired. Durations are in seconds.
type: int type: int
default: 15 default: 15
node: node:
description: description:
- The name of the node that with which the session will be associated. - The name of the node that with which the session will be associated. By default this is the name of the agent.
by default this is the name of the agent.
type: str type: str
datacenter: datacenter:
description: description:
- The name of the datacenter in which the session exists or should be - The name of the datacenter in which the session exists or should be created.
created.
type: str type: str
checks: checks:
description: description:
- Checks that will be used to verify the session health. If - Checks that will be used to verify the session health. If all the checks fail, the session will be invalidated and
all the checks fail, the session will be invalidated and any locks any locks associated with the session will be release and can be acquired once the associated lock delay has expired.
associated with the session will be release and can be acquired once
the associated lock delay has expired.
type: list type: list
elements: str elements: str
behavior: behavior:
description: description:
- The optional behavior that can be attached to the session when it - The optional behavior that can be attached to the session when it is created. This controls the behavior when a session
is created. This controls the behavior when a session is invalidated. is invalidated.
choices: [delete, release] choices: [delete, release]
type: str type: str
default: release default: release
@ -93,10 +82,10 @@ options:
version_added: 5.4.0 version_added: 5.4.0
token: token:
version_added: 5.6.0 version_added: 5.6.0
''' """
EXAMPLES = ''' EXAMPLES = r"""
- name: Register basic session with consul - name: Register basic session with Consul
community.general.consul_session: community.general.consul_session:
name: session1 name: session1
@ -124,7 +113,7 @@ EXAMPLES = '''
community.general.consul_session: community.general.consul_session:
name: session-with-ttl name: session-with-ttl
ttl: 600 # sec ttl: 600 # sec
''' """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.consul import ( from ansible_collections.community.general.plugins.module_utils.consul import (

View File

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
module: consul_token module: consul_token
short_description: Manipulate Consul tokens short_description: Manipulate Consul tokens
version_added: 8.3.0 version_added: 8.3.0
description: description:
- Allows the addition, modification and deletion of tokens in a consul - Allows the addition, modification and deletion of tokens in a Consul cluster using the agent. For more details on using
cluster via the agent. For more details on using and configuring ACLs, and configuring ACLs, see U(https://www.consul.io/docs/guides/acl.html).
see U(https://www.consul.io/docs/guides/acl.html).
author: author:
- Florian Apolloner (@apollo13) - Florian Apolloner (@apollo13)
extends_documentation_fragment: extends_documentation_fragment:
@ -42,13 +41,11 @@ options:
type: str type: str
accessor_id: accessor_id:
description: description:
- Specifies a UUID to use as the token's Accessor ID. - Specifies a UUID to use as the token's Accessor ID. If not specified a UUID will be generated for this field.
If not specified a UUID will be generated for this field.
type: str type: str
secret_id: secret_id:
description: description:
- Specifies a UUID to use as the token's Secret ID. - Specifies a UUID to use as the token's Secret ID. If not specified a UUID will be generated for this field.
If not specified a UUID will be generated for this field.
type: str type: str
description: description:
description: description:
@ -125,7 +122,7 @@ options:
description: description:
- The datacenters the token will be effective. - The datacenters the token will be effective.
- If an empty array (V([])) is specified, the token will valid in all datacenters. - If an empty array (V([])) is specified, the token will valid in all datacenters.
- including those which do not yet exist but may in the future. - Including those which do not yet exist but may in the future.
type: list type: list
elements: str elements: str
node_identities: node_identities:
@ -151,18 +148,16 @@ options:
required: true required: true
local: local:
description: description:
- If true, indicates that the token should not be replicated globally - If true, indicates that the token should not be replicated globally and instead be local to the current datacenter.
and instead be local to the current datacenter.
type: bool type: bool
expiration_ttl: expiration_ttl:
description: description:
- This is a convenience field and if set will initialize the C(expiration_time). - This is a convenience field and if set will initialize the C(expiration_time). Can be specified in the form of V(60s)
Can be specified in the form of V(60s) or V(5m) (that is, 60 seconds or 5 minutes, or V(5m) (that is, 60 seconds or 5 minutes, respectively). Ingored when the token is updated!
respectively). Ingored when the token is updated!
type: str type: str
""" """
EXAMPLES = """ EXAMPLES = r"""
- name: Create / Update a token by accessor_id - name: Create / Update a token by accessor_id
community.general.consul_token: community.general.consul_token:
state: present state: present
@ -186,9 +181,9 @@ EXAMPLES = """
token: 8adddd91-0bd6-d41d-ae1a-3b49cfa9a0e8 token: 8adddd91-0bd6-d41d-ae1a-3b49cfa9a0e8
""" """
RETURN = """ RETURN = r"""
token: token:
description: The token as returned by the consul HTTP API. description: The token as returned by the Consul HTTP API.
returned: always returned: always
type: dict type: dict
sample: sample:
@ -200,7 +195,7 @@ token:
Local: false Local: false
ModifyIndex: 633 ModifyIndex: 633
SecretID: bd380fba-da17-7cee-8576-8d6427c6c930 SecretID: bd380fba-da17-7cee-8576-8d6427c6c930
ServiceIdentities: [{"ServiceName": "test"}] ServiceIdentities: ["ServiceName": "test"]
operation: operation:
description: The operation performed. description: The operation performed.
returned: changed returned: changed

View File

@ -9,7 +9,6 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = r""" DOCUMENTATION = r"""
---
module: copr module: copr
short_description: Manage one of the Copr repositories short_description: Manage one of the Copr repositories
version_added: 2.0.0 version_added: 2.0.0
@ -48,9 +47,9 @@ options:
choices: [absent, enabled, disabled] choices: [absent, enabled, disabled]
chroot: chroot:
description: description:
- The name of the chroot that you want to enable/disable/remove in the project, - The name of the chroot that you want to enable/disable/remove in the project, for example V(epel-7-x86_64). Default
for example V(epel-7-x86_64). Default chroot is determined by the operating system, chroot is determined by the operating system, version of the operating system, and architecture on which the module
version of the operating system, and architecture on which the module is run. is run.
type: str type: str
includepkgs: includepkgs:
description: List of packages to include. description: List of packages to include.

View File

@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = r"""
---
module: cpanm module: cpanm
short_description: Manages Perl library dependencies short_description: Manages Perl library dependencies
description: description:
@ -75,23 +74,21 @@ options:
version_added: 3.0.0 version_added: 3.0.0
name_check: name_check:
description: description:
- When O(mode=new), this parameter can be used to check if there is a module O(name) installed (at O(version), when specified). - When O(mode=new), this parameter can be used to check if there is a module O(name) installed (at O(version), when
specified).
type: str type: str
version_added: 3.0.0 version_added: 3.0.0
notes: notes:
- Please note that U(http://search.cpan.org/dist/App-cpanminus/bin/cpanm, cpanm) must be installed on the remote host. - Please note that U(http://search.cpan.org/dist/App-cpanminus/bin/cpanm, cpanm) must be installed on the remote host.
- "This module now comes with a choice of execution O(mode): V(compatibility) or V(new)." - 'This module now comes with a choice of execution O(mode): V(compatibility) or V(new).'
- > - 'O(mode=compatibility): When using V(compatibility) mode, the module will keep backward compatibility. This was the default
O(mode=compatibility): When using V(compatibility) mode, the module will keep backward compatibility. mode before community.general 9.0.0. O(name) must be either a module name or a distribution file. If the perl module given
This was the default mode before community.general 9.0.0. by O(name) is installed (at the exact O(version) when specified), then nothing happens. Otherwise, it will be installed
O(name) must be either a module name or a distribution file. If the perl module given by O(name) is installed (at the exact O(version) using the C(cpanm) executable. O(name) cannot be an URL, or a git URL. C(cpanm) version specifiers do not work in this
when specified), then nothing happens. Otherwise, it will be installed using the C(cpanm) executable. O(name) cannot be an URL, or a git URL. mode.'
C(cpanm) version specifiers do not work in this mode. - 'O(mode=new): When using V(new) mode, the module will behave differently. The O(name) parameter may refer to a module
- > name, a distribution file, a HTTP URL or a git repository URL as described in C(cpanminus) documentation. C(cpanm) version
O(mode=new): When using V(new) mode, the module will behave differently. The O(name) parameter may refer to a module name, a distribution file, specifiers are recognized. This is the default mode from community.general 9.0.0 onwards.'
a HTTP URL or a git repository URL as described in C(cpanminus) documentation. C(cpanm) version specifiers are recognized.
This is the default mode from community.general 9.0.0 onwards.
seealso: seealso:
- name: C(cpanm) command manual page - name: C(cpanm) command manual page
description: Manual page for the command. description: Manual page for the command.
@ -101,8 +98,7 @@ author:
- "Alexei Znamensky (@russoz)" - "Alexei Znamensky (@russoz)"
""" """
EXAMPLES = """ EXAMPLES = r"""
---
- name: Install Dancer perl package - name: Install Dancer perl package
community.general.cpanm: community.general.cpanm:
name: Dancer name: Dancer
@ -142,8 +138,7 @@ EXAMPLES = """
version: '1.0' version: '1.0'
""" """
RETURN = """ RETURN = r"""
---
cpanm_version: cpanm_version:
description: Version of CPANMinus. description: Version of CPANMinus.
type: str type: str

View File

@ -17,8 +17,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: cronvar module: cronvar
short_description: Manage variables in crontabs short_description: Manage variables in crontabs
description: description:
@ -49,8 +48,7 @@ options:
type: str type: str
insertbefore: insertbefore:
description: description:
- Used with O(state=present). If specified, the variable will be inserted - Used with O(state=present). If specified, the variable will be inserted just before the variable specified.
just before the variable specified.
type: str type: str
state: state:
description: description:
@ -71,18 +69,17 @@ options:
type: str type: str
backup: backup:
description: description:
- If set, create a backup of the crontab before it is modified. - If set, create a backup of the crontab before it is modified. The location of the backup is returned in the C(backup)
The location of the backup is returned in the C(backup) variable by this module. variable by this module.
# TODO: C() above should be RV(), but return values have not been documented!
type: bool type: bool
default: false default: false
requirements: requirements:
- cron - cron
author: author:
- Doug Luce (@dougluce) - Doug Luce (@dougluce)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Ensure entry like "EMAIL=doug@ansibmod.con.com" exists - name: Ensure entry like "EMAIL=doug@ansibmod.con.com" exists
community.general.cronvar: community.general.cronvar:
name: EMAIL name: EMAIL
@ -99,7 +96,7 @@ EXAMPLES = r'''
value: /var/log/yum-autoupdate.log value: /var/log/yum-autoupdate.log
user: root user: root
cron_file: ansible_yum-autoupdate cron_file: ansible_yum-autoupdate
''' """
import os import os
import platform import platform

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: crypttab module: crypttab
short_description: Encrypted Linux block devices short_description: Encrypted Linux block devices
description: description:
@ -24,31 +23,27 @@ attributes:
options: options:
name: name:
description: description:
- Name of the encrypted block device as it appears in the C(/etc/crypttab) file, or - Name of the encrypted block device as it appears in the C(/etc/crypttab) file, or optionally prefixed with V(/dev/mapper/),
optionally prefixed with V(/dev/mapper/), as it appears in the filesystem. V(/dev/mapper/) as it appears in the filesystem. V(/dev/mapper/) will be stripped from O(name).
will be stripped from O(name).
type: str type: str
required: true required: true
state: state:
description: description:
- Use V(present) to add a line to C(/etc/crypttab) or update its definition - Use V(present) to add a line to C(/etc/crypttab) or update its definition if already present.
if already present.
- Use V(absent) to remove a line with matching O(name). - Use V(absent) to remove a line with matching O(name).
- Use V(opts_present) to add options to those already present; options with - Use V(opts_present) to add options to those already present; options with different values will be updated.
different values will be updated.
- Use V(opts_absent) to remove options from the existing set. - Use V(opts_absent) to remove options from the existing set.
type: str type: str
required: true required: true
choices: [absent, opts_absent, opts_present, present] choices: [absent, opts_absent, opts_present, present]
backing_device: backing_device:
description: description:
- Path to the underlying block device or file, or the UUID of a block-device - Path to the underlying block device or file, or the UUID of a block-device prefixed with V(UUID=).
prefixed with V(UUID=).
type: str type: str
password: password:
description: description:
- Encryption password, the path to a file containing the password, or - Encryption password, the path to a file containing the password, or V(-) or unset if the password should be entered
V(-) or unset if the password should be entered at boot. at boot.
type: path type: path
opts: opts:
description: description:
@ -62,9 +57,9 @@ options:
default: /etc/crypttab default: /etc/crypttab
author: author:
- Steve (@groks) - Steve (@groks)
''' """
EXAMPLES = r''' EXAMPLES = r"""
- name: Set the options explicitly a device which must already exist - name: Set the options explicitly a device which must already exist
community.general.crypttab: community.general.crypttab:
name: luks-home name: luks-home
@ -78,7 +73,7 @@ EXAMPLES = r'''
opts: discard opts: discard
loop: '{{ ansible_mounts }}' loop: '{{ ansible_mounts }}'
when: "'/dev/mapper/luks-' in {{ item.device }}" when: "'/dev/mapper/luks-' in {{ item.device }}"
''' """
import os import os
import traceback import traceback