cloudstack: streamline modules doc (part 4) (#53874)

* cloudstack: streamline modules doc (part 4)

* Parameter types added
* Copyright format fixes
* Doc style fixes
* Examples format fixes
* validate-module errors fixes

* cs_network_offering: Rollback of the deletion of the choice list for supported_services param
This commit is contained in:
David Passante 2019-03-17 08:38:02 +01:00 committed by René Moser
parent e8972ce459
commit ef6da8ec5c
14 changed files with 278 additions and 244 deletions

View file

@ -20,54 +20,65 @@ short_description: Manages security group rules on Apache CloudStack based cloud
description:
- Add and remove security group rules.
version_added: '2.0'
author: "René Moser (@resmo)"
author: René Moser (@resmo)
options:
security_group:
description:
- Name of the security group the rule is related to. The security group must be existing.
type: str
required: true
state:
description:
- State of the security group rule.
type: str
default: present
choices: [ present, absent ]
protocol:
description:
- Protocol of the security group rule.
type: str
default: tcp
choices: [ tcp, udp, icmp, ah, esp, gre ]
type:
description:
- Ingress or egress security group rule.
type: str
default: ingress
choices: [ ingress, egress ]
cidr:
description:
- CIDR (full notation) to be used for security group rule.
default: '0.0.0.0/0'
type: str
default: 0.0.0.0/0
user_security_group:
description:
- Security group this rule is based of.
type: str
start_port:
description:
- Start port for this rule. Required if C(protocol=tcp) or C(protocol=udp).
- Start port for this rule. Required if I(protocol=tcp) or I(protocol=udp).
type: int
aliases: [ port ]
end_port:
description:
- End port for this rule. Required if C(protocol=tcp) or C(protocol=udp), but C(start_port) will be used if not set.
- End port for this rule. Required if I(protocol=tcp) or I(protocol=udp), but I(start_port) will be used if not set.
type: int
icmp_type:
description:
- Type of the icmp message being sent. Required if C(protocol=icmp).
- Type of the icmp message being sent. Required if I(protocol=icmp).
type: int
icmp_code:
description:
- Error code for this icmp message. Required if C(protocol=icmp).
- Error code for this icmp message. Required if I(protocol=icmp).
type: int
project:
description:
- Name of the project the security group to be created in.
type: str
poll_async:
description:
- Poll async jobs until job has finished.
default: true
default: yes
type: bool
extends_documentation_fragment: cloudstack
'''
@ -75,15 +86,14 @@ extends_documentation_fragment: cloudstack
EXAMPLES = '''
---
- name: allow inbound port 80/tcp from 1.2.3.4 added to security group 'default'
local_action:
module: cs_securitygroup_rule
cs_securitygroup_rule:
security_group: default
port: 80
cidr: 1.2.3.4/32
delegate_to: localhost
- name: allow tcp/udp outbound added to security group 'default'
local_action:
module: cs_securitygroup_rule
cs_securitygroup_rule:
security_group: default
type: egress
start_port: 1
@ -92,28 +102,29 @@ EXAMPLES = '''
with_items:
- tcp
- udp
delegate_to: localhost
- name: allow inbound icmp from 0.0.0.0/0 added to security group 'default'
local_action:
module: cs_securitygroup_rule
cs_securitygroup_rule:
security_group: default
protocol: icmp
icmp_code: -1
icmp_type: -1
delegate_to: localhost
- name: remove rule inbound port 80/tcp from 0.0.0.0/0 from security group 'default'
local_action:
module: cs_securitygroup_rule
cs_securitygroup_rule:
security_group: default
port: 80
state: absent
delegate_to: localhost
- name: allow inbound port 80/tcp from security group web added to security group 'default'
local_action:
module: cs_securitygroup_rule
cs_securitygroup_rule:
security_group: default
port: 80
user_security_group: web
delegate_to: localhost
'''
RETURN = '''