1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cloudstack: streamline modules doc (part 6) (#54641)

* Parameter types added
* Copyright format fixes
* Doc style fixes
* Examples format fixes
* validate-module errors fixes
This commit is contained in:
David Passante 2019-03-31 11:09:15 +02:00 committed by René Moser
parent 6a27e308dd
commit eff1f8851c
9 changed files with 185 additions and 145 deletions

View file

@ -17,51 +17,60 @@ short_description: Manages users on Apache CloudStack based clouds.
description: description:
- Create, update, disable, lock, enable and remove users. - Create, update, disable, lock, enable and remove users.
version_added: '2.0' version_added: '2.0'
author: "René Moser (@resmo)" author: René Moser (@resmo)
options: options:
username: username:
description: description:
- Username of the user. - Username of the user.
type: str
required: true required: true
account: account:
description: description:
- Account the user will be created under. - Account the user will be created under.
- Required on C(state=present). - Required on I(state=present).
type: str
password: password:
description: description:
- Password of the user to be created. - Password of the user to be created.
- Required on C(state=present). - Required on I(state=present).
- Only considered on creation and will not be updated if user exists. - Only considered on creation and will not be updated if user exists.
type: str
first_name: first_name:
description: description:
- First name of the user. - First name of the user.
- Required on C(state=present). - Required on I(state=present).
type: str
last_name: last_name:
description: description:
- Last name of the user. - Last name of the user.
- Required on C(state=present). - Required on I(state=present).
type: str
email: email:
description: description:
- Email of the user. - Email of the user.
- Required on C(state=present). - Required on I(state=present).
type: str
timezone: timezone:
description: description:
- Timezone of the user. - Timezone of the user.
type: str
keys_registered: keys_registered:
description: description:
- If API keys of the user should be generated. - If API keys of the user should be generated.
- "Note: Keys can not be removed by the API again." - "Note: Keys can not be removed by the API again."
version_added: "2.4" version_added: '2.4'
type: bool type: bool
default: no default: no
domain: domain:
description: description:
- Domain the user is related to. - Domain the user is related to.
type: str
default: ROOT default: ROOT
state: state:
description: description:
- State of the user. - State of the user.
- C(unlocked) is an alias for C(enabled). - C(unlocked) is an alias for C(enabled).
type: str
default: present default: present
choices: [ present, absent, enabled, disabled, locked, unlocked ] choices: [ present, absent, enabled, disabled, locked, unlocked ]
poll_async: poll_async:
@ -74,8 +83,7 @@ extends_documentation_fragment: cloudstack
EXAMPLES = ''' EXAMPLES = '''
- name: Create an user in domain 'CUSTOMERS' - name: Create an user in domain 'CUSTOMERS'
local_action: cs_user:
module: cs_user
account: developers account: developers
username: johndoe username: johndoe
password: S3Cur3 password: S3Cur3
@ -83,34 +91,35 @@ EXAMPLES = '''
first_name: John first_name: John
email: john.doe@example.com email: john.doe@example.com
domain: CUSTOMERS domain: CUSTOMERS
delegate_to: localhost
- name: Lock an existing user in domain 'CUSTOMERS' - name: Lock an existing user in domain 'CUSTOMERS'
local_action: cs_user:
module: cs_user
username: johndoe username: johndoe
domain: CUSTOMERS domain: CUSTOMERS
state: locked state: locked
delegate_to: localhost
- name: Disable an existing user in domain 'CUSTOMERS' - name: Disable an existing user in domain 'CUSTOMERS'
local_action: cs_user:
module: cs_user
username: johndoe username: johndoe
domain: CUSTOMERS domain: CUSTOMERS
state: disabled state: disabled
delegate_to: localhost
- name: Enable/unlock an existing user in domain 'CUSTOMERS' - name: Enable/unlock an existing user in domain 'CUSTOMERS'
local_action: cs_user:
module: cs_user
username: johndoe username: johndoe
domain: CUSTOMERS domain: CUSTOMERS
state: enabled state: enabled
delegate_to: localhost
- name: Remove an user in domain 'CUSTOMERS' - name: Remove an user in domain 'CUSTOMERS'
local_action: cs_user:
module: cs_user
name: customer_xy name: customer_xy
domain: CUSTOMERS domain: CUSTOMERS
state: absent state: absent
delegate_to: localhost
''' '''
RETURN = ''' RETURN = '''

View file

@ -17,12 +17,13 @@ short_description: Manages VLAN IP ranges on Apache CloudStack based clouds.
description: description:
- Create and delete VLAN IP range. - Create and delete VLAN IP range.
version_added: '2.8' version_added: '2.8'
author: "David Passante (@dpassante)" author: David Passante (@dpassante)
options: options:
network: network:
description: description:
- The network name or id. - The network name or id.
- Required if I(for_virtual_network) and I(physical_network) are not set. - Required if I(for_virtual_network) and I(physical_network) are not set.
type: str
physical_network: physical_network:
description: description:
- The physical network name or id. - The physical network name or id.
@ -31,74 +32,87 @@ options:
description: description:
- The beginning IPv4 address in the VLAN IP range. - The beginning IPv4 address in the VLAN IP range.
- Only considered on create. - Only considered on create.
type: str
required: true required: true
end_ip: end_ip:
description: description:
- The ending IPv4 address in the VLAN IP range. - The ending IPv4 address in the VLAN IP range.
- If not specified, value of I(start_ip) is used. - If not specified, value of I(start_ip) is used.
- Only considered on create. - Only considered on create.
type: str
gateway: gateway:
description: description:
- The gateway of the VLAN IP range. - The gateway of the VLAN IP range.
- Required if I(state=present). - Required if I(state=present).
type: str
netmask: netmask:
description: description:
- The netmask of the VLAN IP range. - The netmask of the VLAN IP range.
- Required if I(state=present). - Required if I(state=present).
type: str
start_ipv6: start_ipv6:
description: description:
- The beginning IPv6 address in the IPv6 network range. - The beginning IPv6 address in the IPv6 network range.
- Only considered on create. - Only considered on create.
type: str
end_ipv6: end_ipv6:
description: description:
- The ending IPv6 address in the IPv6 network range. - The ending IPv6 address in the IPv6 network range.
- If not specified, value of I(start_ipv6) is used. - If not specified, value of I(start_ipv6) is used.
- Only considered on create. - Only considered on create.
type: str
gateway_ipv6: gateway_ipv6:
description: description:
- The gateway of the IPv6 network. - The gateway of the IPv6 network.
- Only considered on create. - Only considered on create.
type: str
cidr_ipv6: cidr_ipv6:
description: description:
- The CIDR of IPv6 network, must be at least /64. - The CIDR of IPv6 network, must be at least /64.
type: str
vlan: vlan:
description: description:
- The ID or VID of the network. - The ID or VID of the network.
- If not specified, will be defaulted to the vlan of the network. - If not specified, will be defaulted to the vlan of the network.
type: str
state: state:
description: description:
- State of the network ip range. - State of the network ip range.
type: str
default: present default: present
choices: [ present, absent ] choices: [ present, absent ]
zone: zone:
description: description:
- The Zone ID of the VLAN IP range. - The Zone ID of the VLAN IP range.
- If not set, default zone is used. - If not set, default zone is used.
type: str
domain: domain:
description: description:
- Domain of the account owning the VLAN. - Domain of the account owning the VLAN.
type: str
account: account:
description: description:
- Account who owns the VLAN. - Account who owns the VLAN.
- Mutually exclusive with I(project). - Mutually exclusive with I(project).
type: str
project: project:
description: description:
- Project who owns the VLAN. - Project who owns the VLAN.
- Mutually exclusive with I(account). - Mutually exclusive with I(account).
type: str
for_virtual_network: for_virtual_network:
description: description:
- true if VLAN is of Virtual type, false if Direct. - C(yes) if VLAN is of Virtual type, C(no) if Direct.
- If set to C(true) but neither I(physical_network) or I(network) is set CloudStack will try to add the - If set to C(yes) but neither I(physical_network) or I(network) is set CloudStack will try to add the
VLAN range to the Physical Network with a Public traffic type. VLAN range to the Physical Network with a Public traffic type.
type: bool type: bool
default: false default: no
extends_documentation_fragment: cloudstack extends_documentation_fragment: cloudstack
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: create a VLAN IP range for network test - name: create a VLAN IP range for network test
local_action: cs_vlan_ip_range:
module: cs_vlan_ip_range
network: test network: test
vlan: 98 vlan: 98
start_ip: 10.2.4.10 start_ip: 10.2.4.10
@ -106,15 +120,16 @@ EXAMPLES = '''
gateway: 10.2.4.1 gateway: 10.2.4.1
netmask: 255.255.255.0 netmask: 255.255.255.0
zone: zone-02 zone: zone-02
delegate_to: localhost
- name: remove a VLAN IP range for network test - name: remove a VLAN IP range for network test
local_action: cs_vlan_ip_range:
module: cs_vlan_ip_range
state: absent state: absent
network: test network: test
start_ip: 10.2.4.10 start_ip: 10.2.4.10
end_ip: 10.2.4.100 end_ip: 10.2.4.100
zone: zone-02 zone: zone-02
delegate_to: localhost
''' '''
RETURN = ''' RETURN = '''

View file

@ -2,21 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# (c) 2015, René Moser <mail@renemoser.net> # (c) 2015, René Moser <mail@renemoser.net>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'], 'status': ['stableinterface'],
@ -30,78 +16,86 @@ short_description: Manages VM snapshots on Apache CloudStack based clouds.
description: description:
- Create, remove and revert VM from snapshots. - Create, remove and revert VM from snapshots.
version_added: '2.0' version_added: '2.0'
author: "René Moser (@resmo)" author: René Moser (@resmo)
options: options:
name: name:
description: description:
- Unique Name of the snapshot. In CloudStack terms display name. - Unique Name of the snapshot. In CloudStack terms display name.
type: str
required: true required: true
aliases: ['display_name'] aliases: [ display_name ]
vm: vm:
description: description:
- Name of the virtual machine. - Name of the virtual machine.
type: str
required: true required: true
description: description:
description: description:
- Description of the snapshot. - Description of the snapshot.
type: str
snapshot_memory: snapshot_memory:
description: description:
- Snapshot memory if set to true. - Snapshot memory if set to true.
default: false default: no
type: bool type: bool
zone: zone:
description: description:
- Name of the zone in which the VM is in. If not set, default zone is used. - Name of the zone in which the VM is in. If not set, default zone is used.
type: str
project: project:
description: description:
- Name of the project the VM is assigned to. - Name of the project the VM is assigned to.
type: str
state: state:
description: description:
- State of the snapshot. - State of the snapshot.
default: 'present' type: str
choices: [ 'present', 'absent', 'revert' ] default: present
choices: [ present, absent, revert ]
domain: domain:
description: description:
- Domain the VM snapshot is related to. - Domain the VM snapshot is related to.
type: str
account: account:
description: description:
- Account the VM snapshot is related to. - Account the VM snapshot is related to.
type: str
poll_async: poll_async:
description: description:
- Poll async jobs until job has finished. - Poll async jobs until job has finished.
required: false default: yes
default: true
type: bool type: bool
tags: tags:
description: description:
- List of tags. Tags are a list of dictionaries having keys C(key) and C(value). - List of tags. Tags are a list of dictionaries having keys I(key) and I(value).
- "To delete all tags, set a empty list e.g. C(tags: [])." - "To delete all tags, set a empty list e.g. I(tags: [])."
aliases: [ 'tag' ] type: list
version_added: "2.4" aliases: [ tag ]
version_added: '2.4'
extends_documentation_fragment: cloudstack extends_documentation_fragment: cloudstack
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: Create a VM snapshot of disk and memory before an upgrade - name: Create a VM snapshot of disk and memory before an upgrade
local_action: cs_vmsnapshot:
module: cs_vmsnapshot
name: Snapshot before upgrade name: Snapshot before upgrade
vm: web-01 vm: web-01
snapshot_memory: yes snapshot_memory: yes
delegate_to: localhost
- name: Revert a VM to a snapshot after a failed upgrade - name: Revert a VM to a snapshot after a failed upgrade
local_action: cs_vmsnapshot:
module: cs_vmsnapshot
name: Snapshot before upgrade name: Snapshot before upgrade
vm: web-01 vm: web-01
state: revert state: revert
delegate_to: localhost
- name: Remove a VM snapshot after successful upgrade - name: Remove a VM snapshot after successful upgrade
local_action: cs_vmsnapshot:
module: cs_vmsnapshot
name: Snapshot before upgrade name: Snapshot before upgrade
vm: web-01 vm: web-01
state: absent state: absent
delegate_to: localhost
''' '''
RETURN = ''' RETURN = '''

View file

@ -18,43 +18,54 @@ module: cs_vpn_connection
short_description: Manages site-to-site VPN connections on Apache CloudStack based clouds. short_description: Manages site-to-site VPN connections on Apache CloudStack based clouds.
description: description:
- Create and remove VPN connections. - Create and remove VPN connections.
version_added: "2.5" version_added: '2.5'
author: "René Moser (@resmo)" author: René Moser (@resmo)
options: options:
vpc: vpc:
description: description:
- Name of the VPC the VPN connection is related to. - Name of the VPC the VPN connection is related to.
type: str
required: true required: true
vpn_customer_gateway: vpn_customer_gateway:
description: description:
- Name of the VPN customer gateway. - Name of the VPN customer gateway.
type: str
required: true required: true
passive: passive:
description: description:
- State of the VPN connection. - State of the VPN connection.
- Only considered when C(state=present). - Only considered when I(state=present).
default: no default: no
type: bool type: bool
force: force:
description: description:
- Activate the VPN gateway if not already activated on C(state=present). - Activate the VPN gateway if not already activated on I(state=present).
- Also see M(cs_vpn_gateway). - Also see M(cs_vpn_gateway).
default: no default: no
type: bool type: bool
state: state:
description: description:
- State of the VPN connection. - State of the VPN connection.
type: str
default: present default: present
choices: [ present, absent ] choices: [ present, absent ]
zone:
description:
- Name of the zone the VPC is related to.
- If not set, default zone is used.
type: str
domain: domain:
description: description:
- Domain the VPN connection is related to. - Domain the VPN connection is related to.
type: str
account: account:
description: description:
- Account the VPN connection is related to. - Account the VPN connection is related to.
type: str
project: project:
description: description:
- Name of the project the VPN connection is related to. - Name of the project the VPN connection is related to.
type: str
poll_async: poll_async:
description: description:
- Poll async jobs until job has finished. - Poll async jobs until job has finished.
@ -65,24 +76,24 @@ extends_documentation_fragment: cloudstack
EXAMPLES = r''' EXAMPLES = r'''
- name: Create a VPN connection with activated VPN gateway - name: Create a VPN connection with activated VPN gateway
local_action: cs_vpn_connection:
module: cs_vpn_connection
vpn_customer_gateway: my vpn connection vpn_customer_gateway: my vpn connection
vpc: my vpc vpc: my vpc
delegate_to: localhost
- name: Create a VPN connection and force VPN gateway activation - name: Create a VPN connection and force VPN gateway activation
local_action: cs_vpn_connection:
module: cs_vpn_connection
vpn_customer_gateway: my vpn connection vpn_customer_gateway: my vpn connection
vpc: my vpc vpc: my vpc
force: yes force: yes
delegate_to: localhost
- name: Remove a vpn connection - name: Remove a vpn connection
local_action: cs_vpn_connection:
module: cs_vpn_connection
vpn_customer_gateway: my vpn connection vpn_customer_gateway: my vpn connection
vpc: my vpc vpc: my vpc
state: absent state: absent
delegate_to: localhost
''' '''
RETURN = r''' RETURN = r'''

View file

@ -18,43 +18,51 @@ module: cs_vpn_customer_gateway
short_description: Manages site-to-site VPN customer gateway configurations on Apache CloudStack based clouds. short_description: Manages site-to-site VPN customer gateway configurations on Apache CloudStack based clouds.
description: description:
- Create, update and remove VPN customer gateways. - Create, update and remove VPN customer gateways.
version_added: "2.5" version_added: '2.5'
author: "René Moser (@resmo)" author: René Moser (@resmo)
options: options:
name: name:
description: description:
- Name of the gateway. - Name of the gateway.
type: str
required: true required: true
cidrs: cidrs:
description: description:
- List of guest CIDRs behind the gateway. - List of guest CIDRs behind the gateway.
- Required if C(state=present). - Required if I(state=present).
type: list
aliases: [ cidr ] aliases: [ cidr ]
gateway: gateway:
description: description:
- Public IP address of the gateway. - Public IP address of the gateway.
- Required if C(state=present). - Required if I(state=present).
type: str
esp_policy: esp_policy:
description: description:
- ESP policy in the format e.g. C(aes256-sha1;modp1536). - ESP policy in the format e.g. C(aes256-sha1;modp1536).
- Required if C(state=present). - Required if I(state=present).
type: str
ike_policy: ike_policy:
description: description:
- IKE policy in the format e.g. C(aes256-sha1;modp1536). - IKE policy in the format e.g. C(aes256-sha1;modp1536).
- Required if C(state=present). - Required if I(state=present).
type: str
ipsec_psk: ipsec_psk:
description: description:
- IPsec Preshared-Key. - IPsec Preshared-Key.
- Cannot contain newline or double quotes. - Cannot contain newline or double quotes.
- Required if C(state=present). - Required if I(state=present).
type: str
ike_lifetime: ike_lifetime:
description: description:
- Lifetime in seconds of phase 1 VPN connection. - Lifetime in seconds of phase 1 VPN connection.
- Defaulted to 86400 by the API on creation if not set. - Defaulted to 86400 by the API on creation if not set.
type: int
esp_lifetime: esp_lifetime:
description: description:
- Lifetime in seconds of phase 2 VPN connection. - Lifetime in seconds of phase 2 VPN connection.
- Defaulted to 3600 by the API on creation if not set. - Defaulted to 3600 by the API on creation if not set.
type: int
dpd: dpd:
description: description:
- Enable Dead Peer Detection. - Enable Dead Peer Detection.
@ -68,29 +76,32 @@ options:
state: state:
description: description:
- State of the VPN customer gateway. - State of the VPN customer gateway.
type: str
default: present default: present
choices: [ present, absent ] choices: [ present, absent ]
domain: domain:
description: description:
- Domain the VPN customer gateway is related to. - Domain the VPN customer gateway is related to.
type: str
account: account:
description: description:
- Account the VPN customer gateway is related to. - Account the VPN customer gateway is related to.
type: str
project: project:
description: description:
- Name of the project the VPN gateway is related to. - Name of the project the VPN gateway is related to.
type: str
poll_async: poll_async:
description: description:
- Poll async jobs until job has finished. - Poll async jobs until job has finished.
default: true default: yes
type: bool type: bool
extends_documentation_fragment: cloudstack extends_documentation_fragment: cloudstack
''' '''
EXAMPLES = r''' EXAMPLES = r'''
- name: Create a vpn customer gateway - name: Create a vpn customer gateway
local_action: cs_vpn_customer_gateway:
module: cs_vpn_customer_gateway
name: my vpn customer gateway name: my vpn customer gateway
cidrs: cidrs:
- 192.168.123.0/24 - 192.168.123.0/24
@ -99,12 +110,13 @@ EXAMPLES = r'''
gateway: 10.10.1.1 gateway: 10.10.1.1
ike_policy: aes256-sha1;modp1536 ike_policy: aes256-sha1;modp1536
ipsec_psk: "S3cr3Tk3Y" ipsec_psk: "S3cr3Tk3Y"
delegate_to: localhost
- name: Remove a vpn customer gateway - name: Remove a vpn customer gateway
local_action: cs_vpn_customer_gateway:
module: cs_vpn_customer_gateway
name: my vpn customer gateway name: my vpn customer gateway
state: absent state: absent
delegate_to: localhost
''' '''
RETURN = r''' RETURN = r'''

View file

@ -2,21 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# (c) 2017, René Moser <mail@renemoser.net> # (c) 2017, René Moser <mail@renemoser.net>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
@ -29,50 +15,56 @@ module: cs_vpn_gateway
short_description: Manages site-to-site VPN gateways on Apache CloudStack based clouds. short_description: Manages site-to-site VPN gateways on Apache CloudStack based clouds.
description: description:
- Creates and removes VPN site-to-site gateways. - Creates and removes VPN site-to-site gateways.
version_added: "2.4" version_added: '2.4'
author: "René Moser (@resmo)" author: René Moser (@resmo)
options: options:
vpc: vpc:
description: description:
- Name of the VPC. - Name of the VPC.
type: str
required: true required: true
state: state:
description: description:
- State of the VPN gateway. - State of the VPN gateway.
default: "present" type: str
choices: [ 'present', 'absent' ] default: present
choices: [ present, absent ]
domain: domain:
description: description:
- Domain the VPN gateway is related to. - Domain the VPN gateway is related to.
type: str
account: account:
description: description:
- Account the VPN gateway is related to. - Account the VPN gateway is related to.
type: str
project: project:
description: description:
- Name of the project the VPN gateway is related to. - Name of the project the VPN gateway is related to.
type: str
zone: zone:
description: description:
- Name of the zone the VPC is related to. - Name of the zone the VPC is related to.
- If not set, default zone is used. - If not set, default zone is used.
type: str
poll_async: poll_async:
description: description:
- Poll async jobs until job has finished. - Poll async jobs until job has finished.
type: bool type: bool
default: 'yes' default: yes
extends_documentation_fragment: cloudstack extends_documentation_fragment: cloudstack
''' '''
EXAMPLES = ''' EXAMPLES = '''
# Ensure a vpn gateway is present - name: Ensure a vpn gateway is present
- local_action: cs_vpn_gateway:
module: cs_vpn_gateway
vpc: my VPC vpc: my VPC
delegate_to: localhost
# Ensure a vpn gateway is absent - name: Ensure a vpn gateway is absent
- local_action: cs_vpn_gateway:
module: cs_vpn_gateway
vpc: my VPC vpc: my VPC
state: absent state: absent
delegate_to: localhost
''' '''
RETURN = ''' RETURN = '''

View file

@ -2,21 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# (c) 2016, René Moser <mail@renemoser.net> # (c) 2016, René Moser <mail@renemoser.net>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'], 'status': ['stableinterface'],
@ -29,88 +15,110 @@ module: cs_zone
short_description: Manages zones on Apache CloudStack based clouds. short_description: Manages zones on Apache CloudStack based clouds.
description: description:
- Create, update and remove zones. - Create, update and remove zones.
version_added: "2.1" version_added: '2.1'
author: "René Moser (@resmo)" author: René Moser (@resmo)
options: options:
name: name:
description: description:
- Name of the zone. - Name of the zone.
type: str
required: true required: true
id: id:
description: description:
- uuid of the existing zone. - uuid of the existing zone.
type: str
state: state:
description: description:
- State of the zone. - State of the zone.
default: 'present' type: str
choices: [ 'present', 'enabled', 'disabled', 'absent' ] default: present
choices: [ present, enabled, disabled, absent ]
domain: domain:
description: description:
- Domain the zone is related to. - Domain the zone is related to.
- Zone is a public zone if not set. - Zone is a public zone if not set.
type: str
network_domain: network_domain:
description: description:
- Network domain for the zone. - Network domain for the zone.
type: str
network_type: network_type:
description: description:
- Network type of the zone. - Network type of the zone.
type: str
default: basic default: basic
choices: [ 'basic', 'advanced' ] choices: [ basic, advanced ]
dns1: dns1:
description: description:
- First DNS for the zone. - First DNS for the zone.
- Required if C(state=present) - Required if I(state=present)
type: str
dns2: dns2:
description: description:
- Second DNS for the zone. - Second DNS for the zone.
type: str
internal_dns1: internal_dns1:
description: description:
- First internal DNS for the zone. - First internal DNS for the zone.
- If not set C(dns1) will be used on C(state=present). - If not set I(dns1) will be used on I(state=present).
type: str
internal_dns2: internal_dns2:
description: description:
- Second internal DNS for the zone. - Second internal DNS for the zone.
type: str
dns1_ipv6: dns1_ipv6:
description: description:
- First DNS for IPv6 for the zone. - First DNS for IPv6 for the zone.
type: str
dns2_ipv6: dns2_ipv6:
description: description:
- Second DNS for IPv6 for the zone. - Second DNS for IPv6 for the zone.
type: str
guest_cidr_address: guest_cidr_address:
description: description:
- Guest CIDR address for the zone. - Guest CIDR address for the zone.
type: str
dhcp_provider: dhcp_provider:
description: description:
- DHCP provider for the Zone. - DHCP provider for the Zone.
type: str
local_storage_enabled:
description:
- Whether to enable local storage for the zone or not..
type: bool
securitygroups_enabled:
description:
- Whether the zone is security group enabled or not.
type: bool
extends_documentation_fragment: cloudstack extends_documentation_fragment: cloudstack
''' '''
EXAMPLES = ''' EXAMPLES = '''
# Ensure a zone is present - name: Ensure a zone is present
- local_action: cs_zone:
module: cs_zone
name: ch-zrh-ix-01 name: ch-zrh-ix-01
dns1: 8.8.8.8 dns1: 8.8.8.8
dns2: 8.8.4.4 dns2: 8.8.4.4
network_type: basic network_type: basic
delegate_to: localhost
# Ensure a zone is disabled - name: Ensure a zone is disabled
- local_action: cs_zone:
module: cs_zone
name: ch-zrh-ix-01 name: ch-zrh-ix-01
state: disabled state: disabled
delegate_to: localhost
# Ensure a zone is enabled - name: Ensure a zone is enabled
- local_action: cs_zone:
module: cs_zone
name: ch-zrh-ix-01 name: ch-zrh-ix-01
state: enabled state: enabled
delegate_to: localhost
# Ensure a zone is absent - name: Ensure a zone is absent
- local_action: cs_zone:
module: cs_zone
name: ch-zrh-ix-01 name: ch-zrh-ix-01
state: absent state: absent
delegate_to: localhost
''' '''
RETURN = ''' RETURN = '''

View file

@ -16,12 +16,13 @@ short_description: Gathering facts of zones from Apache CloudStack based clouds.
description: description:
- Gathering facts from the API of a zone. - Gathering facts from the API of a zone.
- Sets Ansible facts accessable by the key C(cloudstack_zone) and since version 2.6 also returns results. - Sets Ansible facts accessable by the key C(cloudstack_zone) and since version 2.6 also returns results.
version_added: "2.1" version_added: '2.1'
author: "René Moser (@resmo)" author: René Moser (@resmo)
options: options:
name: name:
description: description:
- Name of the zone. - Name of the zone.
type: str
required: true required: true
aliases: [ zone ] aliases: [ zone ]
extends_documentation_fragment: cloudstack extends_documentation_fragment: cloudstack
@ -29,10 +30,10 @@ extends_documentation_fragment: cloudstack
EXAMPLES = ''' EXAMPLES = '''
- name: Gather facts from a zone - name: Gather facts from a zone
local_action: cs_zone_facts:
module: cs_zone_facts
name: ch-gva-1 name: ch-gva-1
register: zone register: zone
delegate_to: localhost
- name: Show the returned results of the registered variable - name: Show the returned results of the registered variable
debug: debug:

View file

@ -97,8 +97,6 @@ lib/ansible/modules/cloud/centurylink/clc_server_snapshot.py E335
lib/ansible/modules/cloud/cloudstack/cs_cluster.py E326 lib/ansible/modules/cloud/cloudstack/cs_cluster.py E326
lib/ansible/modules/cloud/cloudstack/cs_host.py E326 lib/ansible/modules/cloud/cloudstack/cs_host.py E326
lib/ansible/modules/cloud/cloudstack/cs_storage_pool.py E326 lib/ansible/modules/cloud/cloudstack/cs_storage_pool.py E326
lib/ansible/modules/cloud/cloudstack/cs_vpn_connection.py E322
lib/ansible/modules/cloud/cloudstack/cs_zone.py E322
lib/ansible/modules/cloud/cloudstack/cs_zone.py E326 lib/ansible/modules/cloud/cloudstack/cs_zone.py E326
lib/ansible/modules/cloud/digital_ocean/_digital_ocean.py E322 lib/ansible/modules/cloud/digital_ocean/_digital_ocean.py E322
lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip.py E322 lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip.py E322