cs_network_acl_rule: fix doc and sanity (#47835)

* cs_network_acl_rule: fix doc and sanity

* doc styling
This commit is contained in:
René Moser 2018-11-02 01:08:15 +01:00 committed by GitHub
parent 00bab2d24d
commit 064530b72e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 36 deletions

View file

@ -1,22 +1,8 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# (c) 2017, René Moser <mail@renemoser.net> # Copyright (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'],
@ -42,7 +28,7 @@ options:
default: '0.0.0.0/0' default: '0.0.0.0/0'
rule_position: rule_position:
description: description:
- CIDR of the rule. - The position of the network ACL rule.
required: true required: true
aliases: [ number ] aliases: [ number ]
protocol: protocol:
@ -52,25 +38,25 @@ options:
default: tcp default: tcp
protocol_number: protocol_number:
description: description:
- Protocol number from 1 to 256 required if C(protocol=by_number). - Protocol number from 1 to 256 required if I(protocol=by_number).
start_port: start_port:
description: description:
- Start port for this rule. - Start port for this rule.
- Considered if C(protocol=tcp) or C(protocol=udp). - Considered if I(protocol=tcp) or I(protocol=udp).
aliases: [ port ] aliases: [ port ]
end_port: end_port:
description: description:
- End port for this rule. - End port for this rule.
- Considered if C(protocol=tcp) or C(protocol=udp). - Considered if I(protocol=tcp) or I(protocol=udp).
- If not specified, equal C(start_port). - If not specified, equal I(start_port).
icmp_type: icmp_type:
description: description:
- Type of the icmp message being sent. - Type of the icmp message being sent.
- Considered if C(protocol=icmp). - Considered if I(protocol=icmp).
icmp_code: icmp_code:
description: description:
- Error code for this icmp message. - Error code for this icmp message.
- Considered if C(protocol=icmp). - Considered if I(protocol=icmp).
vpc: vpc:
description: description:
- VPC the network ACL is related to. - VPC the network ACL is related to.
@ -85,11 +71,11 @@ options:
description: description:
- Action policy of the rule. - Action policy of the rule.
choices: [ allow, deny ] choices: [ allow, deny ]
default: ingress default: allow
aliases: [ action ] aliases: [ action ]
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).
- "If you want to delete all tags, set a empty list e.g. C(tags: [])." - "If you want to delete all tags, set a empty list e.g. C(tags: [])."
aliases: [ tag ] aliases: [ tag ]
domain: domain:
@ -119,8 +105,8 @@ extends_documentation_fragment: cloudstack
''' '''
EXAMPLES = ''' EXAMPLES = '''
# create a network ACL rule, allow port 80 ingress - name: create a network ACL rule, allow port 80 ingress
- local_action: local_action:
module: cs_network_acl_rule module: cs_network_acl_rule
network_acl: web network_acl: web
rule_position: 1 rule_position: 1
@ -130,8 +116,8 @@ EXAMPLES = '''
port: 80 port: 80
cidr: 0.0.0.0/0 cidr: 0.0.0.0/0
# create a network ACL rule, deny port range 8000-9000 ingress for 10.20.0.0/16 - name: create a network ACL rule, deny port range 8000-9000 ingress for 10.20.0.0/16
- local_action: local_action:
module: cs_network_acl_rule module: cs_network_acl_rule
network_acl: web network_acl: web
rule_position: 1 rule_position: 1
@ -142,8 +128,8 @@ EXAMPLES = '''
end_port: 8000 end_port: 8000
cidr: 10.20.0.0/16 cidr: 10.20.0.0/16
# create a network ACL rule - name: create a network ACL rule
- local_action: local_action:
module: cs_network_acl_rule module: cs_network_acl_rule
network_acl: web network_acl: web
rule_position: 1 rule_position: 1
@ -154,8 +140,8 @@ EXAMPLES = '''
end_port: 8000 end_port: 8000
cidr: 10.20.0.0/16 cidr: 10.20.0.0/16
# remove a network ACL rule - name: remove a network ACL rule
- local_action: local_action:
module: cs_network_acl_rule module: cs_network_acl_rule
network_acl: web network_acl: web
rule_position: 1 rule_position: 1
@ -407,7 +393,7 @@ def main():
vpc=dict(required=True), vpc=dict(required=True),
cidr=dict(default='0.0.0.0/0'), cidr=dict(default='0.0.0.0/0'),
protocol=dict(choices=['tcp', 'udp', 'icmp', 'all', 'by_number'], default='tcp'), protocol=dict(choices=['tcp', 'udp', 'icmp', 'all', 'by_number'], default='tcp'),
protocol_number=dict(type='int', choices=list(range(0, 256))), protocol_number=dict(type='int'),
traffic_type=dict(choices=['ingress', 'egress'], aliases=['type'], default='ingress'), traffic_type=dict(choices=['ingress', 'egress'], aliases=['type'], default='ingress'),
action_policy=dict(choices=['allow', 'deny'], aliases=['action'], default='allow'), action_policy=dict(choices=['allow', 'deny'], aliases=['action'], default='allow'),
icmp_type=dict(type='int'), icmp_type=dict(type='int'),

View file

@ -154,8 +154,6 @@ lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py E322
lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py E324 lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py E324
lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py E325 lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py E325
lib/ansible/modules/cloud/cloudstack/cs_network.py E324 lib/ansible/modules/cloud/cloudstack/cs_network.py E324
lib/ansible/modules/cloud/cloudstack/cs_network_acl_rule.py E324
lib/ansible/modules/cloud/cloudstack/cs_network_acl_rule.py E326
lib/ansible/modules/cloud/cloudstack/cs_network_offering.py E322 lib/ansible/modules/cloud/cloudstack/cs_network_offering.py E322
lib/ansible/modules/cloud/cloudstack/cs_network_offering.py E325 lib/ansible/modules/cloud/cloudstack/cs_network_offering.py E325
lib/ansible/modules/cloud/cloudstack/cs_network_offering.py E326 lib/ansible/modules/cloud/cloudstack/cs_network_offering.py E326