Update azure_rm_securitygroup related document (#58035)

* Update azure_rm_securitygroup related document
This commit is contained in:
Fred-sun 2019-06-22 00:00:18 +08:00 committed by Sandra McCann
parent 1c49a9110a
commit 1b7ef47776
2 changed files with 376 additions and 296 deletions

View file

@ -18,19 +18,19 @@ DOCUMENTATION = '''
---
module: azure_rm_securitygroup
version_added: "2.1"
short_description: Manage Azure network security groups.
short_description: Manage Azure network security groups
description:
- Create, update or delete a network security group. A security group contains Access Control List (ACL) rules
that allow or deny network traffic to subnets or individual network interfaces. A security group is created
with a set of default security rules and an empty set of security rules. Shape traffic flow by adding
rules to the empty set of security rules.
- Create, update or delete a network security group.
- A security group contains Access Control List (ACL) rules that allow or deny network traffic to subnets or individual network interfaces.
- A security group is created with a set of default security rules and an empty set of security rules.
- Shape traffic flow by adding rules to the empty set of security rules.
options:
default_rules:
description:
- The set of default rules automatically added to a security group at creation. In general default
rules will not be modified. Modify rules to shape the flow of traffic to or from a subnet or NIC. See
rules below for the makeup of a rule dict.
- The set of default rules automatically added to a security group at creation.
- In general default rules will not be modified. Modify rules to shape the flow of traffic to or from a subnet or NIC.
- See rules below for the makeup of a rule dict.
location:
description:
- Valid azure location. Defaults to location of the resource group.
@ -63,7 +63,8 @@ options:
description:
- Short description of the rule's purpose.
protocol:
description: Accepted traffic protocol.
description:
- Accepted traffic protocol.
choices:
- Udp
- Tcp
@ -108,7 +109,7 @@ options:
- List of the destination application security groups.
- It could be list of resource id.
- It could be list of names in same resource group.
- It could be list of dict containing resource_group and name.
- It could be list of dict containing I(resource_group) and I(name).
- It is mutually exclusive with C(destination_address_prefix) and C(destination_address_prefixes).
type: list
access:
@ -131,8 +132,7 @@ options:
default: Inbound
state:
description:
- Assert the state of the security group. Set to C(present) to create or update a security group. Set to
C(absent) to remove a security group.
- Assert the state of the security group. Set to C(present) to create or update a security group. Set to C(absent) to remove a security group.
default: present
choices:
- absent
@ -143,8 +143,8 @@ extends_documentation_fragment:
- azure_tags
author:
- "Chris Houseknecht (@chouseknecht)"
- "Matt Davis (@nitzmahone)"
- Chris Houseknecht (@chouseknecht)
- Matt Davis (@nitzmahone)
'''
@ -213,11 +213,17 @@ EXAMPLES = '''
RETURN = '''
state:
description: Current state of the security group.
description:
- Current state of the security group.
returned: always
type: dict
sample: {
"default_rules": [
type: complex
contains:
default_rules:
description:
- The default security rules of network security group.
returned: always
type: list
sample: [
{
"access": "Allow",
"description": "Allow inbound traffic from all VMs in VNET",
@ -308,12 +314,37 @@ state:
"source_address_prefix": "*",
"source_port_range": "*"
}
],
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup",
"location": "westus",
"name": "mysecgroup",
"network_interfaces": [],
"rules": [
]
id:
description:
- The resource ID.
returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/mysecgroup"
location:
description:
- The resource location.
returned: always
type: str
sample: "westus"
name:
description:
- Name of the secrurity group.
returned: always
type: str
sample: "mysecgroup"
network_interfaces:
description:
- A collection of references to network interfaces.
returned: always
type: list
sample: []
rules:
description:
- A collection of security rules of the network security group.
returned: always
type: list
sample: [
{
"access": "Deny",
"description": null,
@ -344,15 +375,29 @@ state:
"source_address_prefix": "174.109.158.0/24",
"source_port_range": "*"
}
],
"subnets": [],
"tags": {
]
subnets:
description:
- A collection of references to subnets.
returned: always
type: list
sample: []
tags:
description:
- Tags to assign to the security group.
returned: always
type: dict
sample: {
"delete": "on-exit",
"foo": "bar",
"testing": "testing"
},
"type": "Microsoft.Network/networkSecurityGroups"
}
type:
description:
- The resource type.
returned: always
type: str
sample: "Microsoft.Network/networkSecurityGroups"
''' # NOQA
try:

View file

@ -20,7 +20,7 @@ module: azure_rm_securitygroup_facts
version_added: "2.1"
short_description: Get security group facts.
short_description: Get security group facts
description:
- Get facts for a specific security group or all security groups within a resource group.
@ -41,8 +41,8 @@ extends_documentation_fragment:
- azure
author:
- "Chris Houseknecht (@chouseknecht)"
- "Matt Davis (@nitzmahone)"
- Chris Houseknecht (@chouseknecht)
- Matt Davis (@nitzmahone)
'''
@ -60,15 +60,41 @@ EXAMPLES = '''
RETURN = '''
azure_securitygroups:
description: List containing security group dicts.
description:
- List containing security group dicts.
returned: always
type: list
example: [{
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001",
"location": "eastus2",
"name": "secgroup001",
"properties": {
type: complex
contains:
etag:
description:
- A unique read-only string that changes whenever the resource is updated.
returned: always
type: str
sample: 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"'
id:
description:
- Resource ID.
returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroup001"
location:
description:
- Resource location.
returned: always
type: str
sample: "eastus2"
name:
description:
- Resource name.
returned: always
type: str
sample: "secgroup001"
properties:
description:
- List of security group's properties.
returned: always
type: dict
sample: {
"defaultSecurityRules": [
{
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
@ -181,10 +207,19 @@ azure_securitygroups:
"provisioningState": "Succeeded",
"resourceGuid": "ebd00afa-5dc8-446f-810a-50dd6f671588",
"securityRules": []
},
"tags": {},
"type": "Microsoft.Network/networkSecurityGroups"
}]
}
tags:
descripition:
- Tags to assign to the security group.
returned: always
type: dict
sample: { 'tag': 'value' }
type:
description:
- Type of the resource.
returned: always
type: str
sample: "Microsoft.Network/networkSecurityGroups"
''' # NOQA