ansible-validate-modules part 4: Enable check on ansible-modules-core (#3526)

* Call ansible-validate-modules

* Correct quotes + add newline
This commit is contained in:
John R Barker 2016-05-03 15:51:12 +01:00 committed by Matt Clay
commit d13046a905
18 changed files with 106 additions and 85 deletions

View file

@ -199,7 +199,7 @@ state:
"internal_fqdn": null
},
"enable_ip_forwarding": false,
"etag": "W/\"be115a43-2148-4545-a324-f33ad444c926\"",
"etag": 'W/"be115a43-2148-4545-a324-f33ad444c926"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkInterfaces/nic003",
"ip_configuration": {
"name": "default",
@ -435,7 +435,7 @@ class AzureRMNetworkInterface(AzureRMModuleBase):
if self.check_mode:
return self.results
if changed:
if self.state == 'present':
if not nic:

View file

@ -92,7 +92,7 @@ objects:
"internal_fqdn": null
},
"enable_ip_forwarding": false,
"etag": "W/\"59726bfc-08c4-44ed-b900-f6a559876a9d\"",
"etag": 'W/"59726bfc-08c4-44ed-b900-f6a559876a9d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkInterfaces/nic003",
"ip_configuration": {
"name": "default",

View file

@ -101,9 +101,9 @@ state:
description: Facts about the current state of the object.
returned: always
type: dict
sample:{
sample: {
"dns_settings": {},
"etag": "W/\"a5e56955-12df-445a-bda4-dc129d22c12f\"",
"etag": '"/"a5e56955-12df-445a-bda4-dc129d22c12f"',
"idle_timeout_in_minutes": 4,
"ip_address": "52.160.103.93",
"location": "westus",

View file

@ -78,7 +78,7 @@ objects:
returned: always
type: list
sample: [{
"etag": "W/\"a31a6d7d-cb18-40a5-b16d-9f4a36c1b18a\"",
"etag": 'W/"a31a6d7d-cb18-40a5-b16d-9f4a36c1b18a"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/publicIPAddresses/pip2001",
"location": "eastus2",
"name": "pip2001",

View file

@ -140,9 +140,9 @@ EXAMPLES = '''
- name: DenySSH
protocol: TCP
destination_port_range: 22
access: Deny
access: Deny
priority: 100
direction: Inbound
direction: Inbound
- name: 'AllowSSH'
protocol: TCP
source_address_prefix: '174.109.158.0/24'
@ -161,14 +161,14 @@ EXAMPLES = '''
destination_port_range: 22-23
access: Deny
priority: 100
direction: Inbound
direction: Inbound
- name: AllowSSHFromHome
protocol: TCP
source_address_prefix: '174.109.158.0/24'
destination_port_range: 22-23
access: Allow
priority: 102
direction: Inbound
direction: Inbound
tags:
testing: testing
delete: on-exit
@ -176,7 +176,7 @@ EXAMPLES = '''
# Delete security group
- azure_rm_securitygroup:
resource_group: mygroup
name: mysecgroup
name: mysecgroup
state: absent
'''
@ -193,7 +193,7 @@ state:
"destination_address_prefix": "VirtualNetwork",
"destination_port_range": "*",
"direction": "Inbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowVnetInBound",
"name": "AllowVnetInBound",
"priority": 65000,
@ -208,7 +208,7 @@ state:
"destination_address_prefix": "*",
"destination_port_range": "*",
"direction": "Inbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowAzureLoadBalancerInBound",
"name": "AllowAzureLoadBalancerInBound",
"priority": 65001,
@ -223,7 +223,7 @@ state:
"destination_address_prefix": "*",
"destination_port_range": "*",
"direction": "Inbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/DenyAllInBound",
"name": "DenyAllInBound",
"priority": 65500,
@ -238,7 +238,7 @@ state:
"destination_address_prefix": "VirtualNetwork",
"destination_port_range": "*",
"direction": "Outbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowVnetOutBound",
"name": "AllowVnetOutBound",
"priority": 65000,
@ -253,7 +253,7 @@ state:
"destination_address_prefix": "Internet",
"destination_port_range": "*",
"direction": "Outbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/AllowInternetOutBound",
"name": "AllowInternetOutBound",
"priority": 65001,
@ -268,7 +268,7 @@ state:
"destination_address_prefix": "*",
"destination_port_range": "*",
"direction": "Outbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/defaultSecurityRules/DenyAllOutBound",
"name": "DenyAllOutBound",
"priority": 65500,
@ -289,7 +289,7 @@ state:
"destination_address_prefix": "*",
"destination_port_range": "22",
"direction": "Inbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/securityRules/DenySSH",
"name": "DenySSH",
"priority": 100,
@ -304,7 +304,7 @@ state:
"destination_address_prefix": "*",
"destination_port_range": "22",
"direction": "Inbound",
"etag": "W/\"edf48d56-b315-40ca-a85d-dbcb47f2da7d\"",
"etag": 'W/"edf48d56-b315-40ca-a85d-dbcb47f2da7d"',
"id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/mysecgroup/securityRules/AllowSSH",
"name": "AllowSSH",
"priority": 101,
@ -354,7 +354,7 @@ def validate_rule(rule, rule_type=None):
raise Exception("Rule name value is required.")
if not NAME_PATTERN.match(rule.get('name')):
raise Exception("Rule name must contain only word characters plus '.','-','_'")
priority = rule.get('priority', None)
if not priority:
raise Exception("Rule priority is required.")
@ -445,7 +445,7 @@ def create_rule_instance(rule):
destination_port_range=rule.get('destination_port_range', None),
priority=rule.get('priority', None),
provisioning_state=rule.get('provisioning_state', None),
name=rule.get('name', None),
name=rule.get('name', None),
etag=rule.get('etag', None)
)
@ -480,7 +480,7 @@ def create_network_security_group_dict(nsg):
name=nsg.name,
type=nsg.type,
location=nsg.location,
tags=nsg.tags,
tags=nsg.tags,
)
results['rules'] = []
if nsg.security_rules:
@ -539,7 +539,7 @@ class AzureRMSecurityGroup(AzureRMModuleBase):
supports_check_mode=True)
def exec_module(self, **kwargs):
for key in self.module_arg_spec.keys() + ['tags']:
setattr(self, key, kwargs[key])

View file

@ -78,14 +78,14 @@ objects:
returned: always
type: list
sample: [{
"etag": "W/\"d036f4d7-d977-429a-a8c6-879bc2523399\"",
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001",
"location": "eastus2",
"name": "secgroup001",
"properties": {
"defaultSecurityRules": [
{
"etag": "W/\"d036f4d7-d977-429a-a8c6-879bc2523399\"",
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowVnetInBound",
"name": "AllowVnetInBound",
"properties": {
@ -102,7 +102,7 @@ objects:
}
},
{
"etag": "W/\"d036f4d7-d977-429a-a8c6-879bc2523399\"",
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowAzureLoadBalancerInBound",
"name": "AllowAzureLoadBalancerInBound",
"properties": {
@ -119,7 +119,7 @@ objects:
}
},
{
"etag": "W/\"d036f4d7-d977-429a-a8c6-879bc2523399\"",
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/DenyAllInBound",
"name": "DenyAllInBound",
"properties": {
@ -136,7 +136,7 @@ objects:
}
},
{
"etag": "W/\"d036f4d7-d977-429a-a8c6-879bc2523399\"",
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowVnetOutBound",
"name": "AllowVnetOutBound",
"properties": {
@ -153,7 +153,7 @@ objects:
}
},
{
"etag": "W/\"d036f4d7-d977-429a-a8c6-879bc2523399\"",
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowInternetOutBound",
"name": "AllowInternetOutBound",
"properties": {
@ -170,7 +170,7 @@ objects:
}
},
{
"etag": "W/\"d036f4d7-d977-429a-a8c6-879bc2523399\"",
"etag": 'W/"d036f4d7-d977-429a-a8c6-879bc2523399"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/DenyAllOutBound",
"name": "DenyAllOutBound",
"properties": {

View file

@ -1,4 +1,4 @@
##!/usr/bin/python
#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>

View file

@ -352,7 +352,7 @@ state:
"enableIPForwarding": false,
"ipConfigurations": [
{
"etag": "W/\"041c8c2a-d5dd-4cd7-8465-9125cfbe2cf8\"",
"etag": 'W/"041c8c2a-d5dd-4cd7-8465-9125cfbe2cf8"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkInterfaces/testvm10_NIC01/ipConfigurations/default",
"name": "default",
"properties": {
@ -450,7 +450,7 @@ def extract_names_from_blob_uri(blob_uri):
return extracted_names
class AzureRMVirtualMachine(AzureRMModuleBase):
class AzureRMVirtualMachine(AzureRMModuleBase):
def __init__(self):

View file

@ -123,7 +123,7 @@ state:
"127.0.0.1",
"127.0.0.3"
],
"etag": "W/\"0712e87c-f02f-4bb3-8b9e-2da0390a3886\"",
"etag": 'W/"0712e87c-f02f-4bb3-8b9e-2da0390a3886"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/virtualNetworks/my_test_network",
"location": "eastus",
"name": "my_test_network",

View file

@ -82,7 +82,7 @@ objects:
returned: always
type: list
sample: [{
"etag": "W/\"532ba1be-ae71-40f2-9232-3b1d9cf5e37e\"",
"etag": 'W/"532ba1be-ae71-40f2-9232-3b1d9cf5e37e"',
"id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/virtualNetworks/vnet2001",
"location": "eastus2",
"name": "vnet2001",