diff --git a/lib/ansible/modules/cloud/azure/azure_rm_subnet.py b/lib/ansible/modules/cloud/azure/azure_rm_subnet.py index 09a56a24be3..80058d8d575 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_subnet.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_subnet.py @@ -18,11 +18,11 @@ DOCUMENTATION = ''' --- module: azure_rm_subnet version_added: "2.1" -short_description: Manage Azure subnets. +short_description: Manage Azure subnets description: - - Create, update or delete a subnet within a given virtual network. Allows setting and updating the address - prefix CIDR, which must be valid within the context of the virtual network. Use the azure_rm_networkinterface - module to associate interfaces with the subnet and assign specific IP addresses. + - Create, update or delete a subnet within a given virtual network. + - Allows setting and updating the address prefix CIDR, which must be valid within the context of the virtual network. + - Use the M(azure_rm_networkinterface) module to associate interfaces with the subnet and assign specific IP addresses. options: resource_group: description: @@ -34,22 +34,20 @@ options: required: true address_prefix_cidr: description: - - CIDR defining the IPv4 address space of the subnet. Must be valid within the context of the - virtual network. + - CIDR defining the IPv4 address space of the subnet. Must be valid within the context of the virtual network. aliases: - address_prefix security_group: description: - Existing security group with which to associate the subnet. - It can be the security group name which is in the same resource group. - - It can be the resource Id. - - It can be a dict which contains C(name) and C(resource_group) of the security group. + - Can be the resource ID of the security group. + - Can be a dict containing the I(name) and I(resource_group) of the security group. aliases: - security_group_name state: description: - - Assert the state of the subnet. Use C(present) to create or update a subnet and - C(absent) to delete a subnet. + - Assert the state of the subnet. Use C(present) to create or update a subnet and use C(absent) to delete a subnet. default: present choices: - absent @@ -63,9 +61,8 @@ options: route_table: description: - The reference of the RouteTable resource. - - It can accept both a str or a dict. - - The str can be the name or resource id of the route table. - - The dict can contains C(name) and C(resource_group) of the route_table. + - Can be the name or resource ID of the route table. + - Can be a dict containing the I(name) and I(resource_group) of the route table. version_added: "2.7" service_endpoints: description: @@ -86,8 +83,8 @@ extends_documentation_fragment: - azure author: - - "Chris Houseknecht (@chouseknecht)" - - "Matt Davis (@nitzmahone)" + - Chris Houseknecht (@chouseknecht) + - Matt Davis (@nitzmahone) ''' @@ -120,37 +117,53 @@ EXAMPLES = ''' RETURN = ''' state: - description: Current state of the subnet. + description: + - Current state of the subnet. returned: success type: complex contains: address_prefix: - description: IP address CIDR. - type: str - example: "10.1.0.0/16" + description: + - IP address CIDR. + returned: always + type: str + sample: "10.1.0.0/16" id: - description: Subnet resource path. - type: str - example: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/mySubnet" + description: + - Subnet resource path. + returned: always + type: str + sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/mySubnet" name: - description: Subnet name. - type: str - example: "foobar" + description: + - Subnet name. + returned: always + type: str + sample: "foobar" network_security_group: - type: complex - contains: - id: - description: Security group resource identifier. - type: str - example: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroupfoo" - name: - description: Name of the security group. - type: str - example: "secgroupfoo" + description: + - Associated network security group of subnets. + returned: always + type: complex + contains: + id: + description: + - Security group resource identifier. + returned: always + type: str + sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroupfoo" + name: + description: + - Name of the security group. + returned: always + type: str + sample: "secgroupfoo" provisioning_state: - description: Success or failure of the provisioning event. - type: str - example: "Succeeded" + description: + - Success or failure of the provisioning event. + returned: always + type: str + sample: "Succeeded" ''' # NOQA from ansible.module_utils.azure_rm_common import AzureRMModuleBase, CIDR_PATTERN, azure_id_to_dict, format_resource_id diff --git a/lib/ansible/modules/cloud/azure/azure_rm_subnet_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_subnet_facts.py index 30927847c18..fd9cd85df89 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_subnet_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_subnet_facts.py @@ -17,7 +17,7 @@ DOCUMENTATION = ''' --- module: azure_rm_subnet_facts version_added: "2.8" -short_description: Get Azure Subnet facts. +short_description: Get Azure Subnet facts description: - Get facts of Azure Subnet. @@ -38,7 +38,7 @@ extends_documentation_fragment: - azure author: - - "Zim Kalinowski (@zikalino)" + - Zim Kalinowski (@zikalino) ''' @@ -58,7 +58,8 @@ EXAMPLES = ''' RETURN = ''' subnets: - description: A list of dictionaries containing facts for subnet. + description: + - A list of dictionaries containing facts for subnet. returned: always type: complex contains: @@ -95,13 +96,13 @@ subnets: sample: "10.1.0.0/16" route_table: description: - - Associated route table id. + - Associated route table ID. returned: always type: str sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/routeTables/myRouteTable security_group: description: - - Associated security group id. + - Associated security group ID. returned: always type: str sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGr @@ -115,11 +116,16 @@ subnets: service: description: - The type of the endpoint service. + returned: always + type: str required: True + sample: Microsoft.Sql locations: description: - A list of location names. type: list + returned: always + sample: [ 'eastus', 'westus' ] provisioning_state: description: - Provisioning state.