Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudstack: streamline modules doc (part 4) #53874

Merged
merged 2 commits into from
Mar 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/ansible/modules/cloud/cloudstack/cs_instance_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,26 @@
short_description: Gathering facts from the API of instances from Apache CloudStack based clouds.
description:
- Gathering facts from the API of an instance.
version_added: "2.1"
author: "René Moser (@resmo)"
version_added: '2.1'
author: René Moser (@resmo)
options:
name:
description:
- Name or display name of the instance.
type: str
required: true
domain:
description:
- Domain the instance is related to.
type: str
account:
description:
- Account the instance is related to.
type: str
project:
description:
- Project the instance is related to.
type: str
extends_documentation_fragment: cloudstack
'''

Expand Down Expand Up @@ -157,7 +161,7 @@
tags:
description: List of resource tags associated with the instance.
returned: success
type: dict
type: list
sample: '[ { "key": "foo", "value": "bar" } ]'
hypervisor:
description: Hypervisor related to this instance.
Expand Down
7 changes: 4 additions & 3 deletions lib/ansible/modules/cloud/cloudstack/cs_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@
type: bool
acl_type:
description:
- Access control type for the VPC network tier.
- Access control type for the network.
- If not specified, Cloudstack will default to C(account) for isolated networks
- and C(domain) for shared networks.
- Only considered on create.
type: str
default: account
choices: [ account, domain ]
acl:
description:
Expand Down Expand Up @@ -269,7 +270,7 @@
type: list
sample: '[ { "key": "foo", "value": "bar" } ]'
acl_type:
description: Access type of the VPC network tier (Domain, Account).
description: Access type of the network (Domain, Account).
returned: success
type: str
sample: Account
Expand Down
31 changes: 22 additions & 9 deletions lib/ansible/modules/cloud/cloudstack/cs_network_offering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,44 @@
description:
- Create, update, enable, disable and remove network offerings.
version_added: '2.5'
author: "David Passante (@dpassante)"
author: David Passante (@dpassante)
options:
state:
description:
- State of the network offering.
type: str
choices: [ enabled, present, disabled, absent]
default: present
display_text:
description:
- Display text of the network offerings.
type: str
guest_ip_type:
description:
- Guest type of the network offering.
type: str
choices: [ Shared, Isolated ]
name:
description:
- The name of the network offering.
type: str
required: true
supported_services:
description:
- Services supported by the network offering.
- One or more of the choices.
- A list of one or more items from the choice list.
type: list
choices: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
aliases: [ supported_service ]
traffic_type:
description:
- The traffic type for the network offering.
type: str
default: Guest
availability:
description:
- The availability of network offering. Default value is Optional
type: str
conserve_mode:
description:
- Whether the network offering has IP conserve mode enabled.
Expand All @@ -55,10 +62,11 @@
description:
- Network offering details in key/value pairs.
- with service provider as a value
choices: [ internallbprovider, publiclbprovider ]
resmo marked this conversation as resolved.
Show resolved Hide resolved
type: list
egress_default_policy:
description:
- Whether the default egress policy is allow or to deny.
type: str
choices: [ allow, deny ]
persistent:
description:
Expand All @@ -74,21 +82,26 @@
max_connections:
description:
- Maximum number of concurrent connections supported by the network offering.
type: int
network_rate:
description:
- Data transfer rate in megabits per second allowed.
type: int
service_capabilities:
description:
- Desired service capabilities as part of network offering.
type: list
aliases: [ service_capability ]
service_offering:
description:
- The service offering name or ID used by virtual router provider.
service_provider:
type: str
service_providers:
description:
- Provider to service mapping.
- If not specified, the provider for the service will be mapped to the default provider on the physical network.
aliases: [service_provider]
type: list
aliases: [ service_provider ]
specify_ip_ranges:
description:
- Wheter the network offering supports specifying IP ranges.
Expand All @@ -103,8 +116,7 @@

EXAMPLES = '''
- name: Create a network offering and enable it
local_action:
module: cs_network_offering
cs_network_offering:
name: my_network_offering
display_text: network offering description
state: enabled
Expand All @@ -113,13 +125,14 @@
service_providers:
- { service: 'dns', provider: 'virtualrouter' }
- { service: 'dhcp', provider: 'virtualrouter' }
delegate_to: localhost


- name: Remove a network offering
local_action:
module: cs_network_offering
cs_network_offering:
name: my_network_offering
state: absent
delegate_to: localhost
'''

RETURN = '''
Expand Down
38 changes: 23 additions & 15 deletions lib/ansible/modules/cloud/cloudstack/cs_pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,73 +16,81 @@
short_description: Manages pods on Apache CloudStack based clouds.
description:
- Create, update, delete pods.
version_added: "2.1"
author: "René Moser (@resmo)"
version_added: '2.1'
author: René Moser (@resmo)
options:
name:
description:
- Name of the pod.
type: str
required: true
id:
description:
- uuid of the existing pod.
type: str
start_ip:
description:
- Starting IP address for the Pod.
- Required on C(state=present)
- Required on I(state=present)
type: str
end_ip:
description:
- Ending IP address for the Pod.
type: str
netmask:
description:
- Netmask for the Pod.
- Required on C(state=present)
- Required on I(state=present)
type: str
gateway:
description:
- Gateway for the Pod.
- Required on C(state=present)
- Required on I(state=present)
type: str
zone:
description:
- Name of the zone in which the pod belongs to.
- If not set, default zone is used.
type: str
state:
description:
- State of the pod.
default: 'present'
choices: [ 'present', 'enabled', 'disabled', 'absent' ]
type: str
default: present
choices: [ present, enabled, disabled, absent ]
extends_documentation_fragment: cloudstack
'''

EXAMPLES = '''
- name: Ensure a pod is present
local_action:
module: cs_pod
cs_pod:
name: pod1
zone: ch-zrh-ix-01
start_ip: 10.100.10.101
gateway: 10.100.10.1
netmask: 255.255.255.0
delegate_to: localhost

- name: Ensure a pod is disabled
local_action:
module: cs_pod
cs_pod:
name: pod1
zone: ch-zrh-ix-01
state: disabled
delegate_to: localhost

- name: Ensure a pod is enabled
local_action:
module: cs_pod
cs_pod:
name: pod1
zone: ch-zrh-ix-01
state: enabled
delegate_to: localhost

- name: Ensure a pod is absent
local_action:
module: cs_pod
cs_pod:
name: pod1
zone: ch-zrh-ix-01
state: absent
delegate_to: localhost
'''

RETURN = '''
Expand Down
Loading