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
parent fa00c69ff2
commit d13046a905
18 changed files with 106 additions and 85 deletions

View file

@ -336,16 +336,16 @@ def commit(changes, retry_interval, wait, wait_timeout):
time.sleep(float(retry_interval)) time.sleep(float(retry_interval))
if wait: if wait:
timeout_time = time.time() + wait_timeout timeout_time = time.time() + wait_timeout
connection = changes.connection connection = changes.connection
change = result['ChangeResourceRecordSetsResponse']['ChangeInfo'] change = result['ChangeResourceRecordSetsResponse']['ChangeInfo']
status = Status(connection, change) status = Status(connection, change)
while status.status != 'INSYNC' and time.time() < timeout_time: while status.status != 'INSYNC' and time.time() < timeout_time:
time.sleep(WAIT_RETRY_SLEEP) time.sleep(WAIT_RETRY_SLEEP)
status.update() status.update()
if time.time() >= timeout_time: if time.time() >= timeout_time:
raise TimeoutError() raise TimeoutError()
return result return result
# Shamelessly copied over from https://git.io/vgmDG # Shamelessly copied over from https://git.io/vgmDG
IGNORE_CODE = 'Throttling' IGNORE_CODE = 'Throttling'
@ -436,20 +436,20 @@ def main():
if command_in == 'create' or command_in == 'delete': if command_in == 'create' or command_in == 'delete':
if not value_in: if not value_in:
module.fail_json(msg = "parameter 'value' required for create/delete") module.fail_json(msg = "parameter 'value' required for create/delete")
elif module.params['alias']: elif alias_in:
if len(value_list) != 1: if len(value_list) != 1:
module.fail_json(msg = "parameter 'value' must contain a single dns name for alias create/delete") module.fail_json(msg = "parameter 'value' must contain a single dns name for alias create/delete")
elif not alias_hosted_zone_id_in: elif not alias_hosted_zone_id_in:
module.fail_json(msg = "parameter 'alias_hosted_zone_id' required for alias create/delete") module.fail_json(msg = "parameter 'alias_hosted_zone_id' required for alias create/delete")
elif ( weight_in!=None or region_in!=None or failover_in!=None ) and identifier_in==None: elif ( weight_in!=None or region_in!=None or failover_in!=None ) and identifier_in==None:
module.fail_json(msg= "If you specify failover, region or weight you must also specify identifier") module.fail_json(msg= "If you specify failover, region or weight you must also specify identifier")
if command_in == 'create': if command_in == 'create':
if ( weight_in!=None or region_in!=None or failover_in!=None ) and identifier_in==None: if ( weight_in!=None or region_in!=None or failover_in!=None ) and identifier_in==None:
module.fail_json(msg= "If you specify failover, region or weight you must also specify identifier") module.fail_json(msg= "If you specify failover, region or weight you must also specify identifier")
elif ( weight_in==None and region_in==None and failover_in==None ) and identifier_in!=None: elif ( weight_in==None and region_in==None and failover_in==None ) and identifier_in!=None:
module.fail_json(msg= "You have specified identifier which makes sense only if you specify one of: weight, region or failover.") module.fail_json(msg= "You have specified identifier which makes sense only if you specify one of: weight, region or failover.")
if vpc_id_in and not private_zone_in: if vpc_id_in and not private_zone_in:
@ -509,7 +509,7 @@ def main():
if identifier_in is not None: if identifier_in is not None:
identifier_in = str(identifier_in) identifier_in = str(identifier_in)
if rset.type == type_in and decoded_name.lower() == record_in.lower() and rset.identifier == identifier_in: if rset.type == type_in and decoded_name.lower() == record_in.lower() and rset.identifier == identifier_in:
found_record = True found_record = True
record['zone'] = zone_in record['zone'] = zone_in

View file

@ -199,7 +199,7 @@ state:
"internal_fqdn": null "internal_fqdn": null
}, },
"enable_ip_forwarding": false, "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkInterfaces/nic003",
"ip_configuration": { "ip_configuration": {
"name": "default", "name": "default",
@ -435,7 +435,7 @@ class AzureRMNetworkInterface(AzureRMModuleBase):
if self.check_mode: if self.check_mode:
return self.results return self.results
if changed: if changed:
if self.state == 'present': if self.state == 'present':
if not nic: if not nic:

View file

@ -92,7 +92,7 @@ objects:
"internal_fqdn": null "internal_fqdn": null
}, },
"enable_ip_forwarding": false, "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", "id": "/subscriptions/3f7e29ba-24e0-42f6-8d9c-5149a14bda37/resourceGroups/Testing/providers/Microsoft.Network/networkInterfaces/nic003",
"ip_configuration": { "ip_configuration": {
"name": "default", "name": "default",

View file

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

View file

@ -78,7 +78,7 @@ objects:
returned: always returned: always
type: list type: list
sample: [{ 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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/publicIPAddresses/pip2001",
"location": "eastus2", "location": "eastus2",
"name": "pip2001", "name": "pip2001",

View file

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

View file

@ -78,14 +78,14 @@ objects:
returned: always returned: always
type: list type: list
sample: [{ 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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001",
"location": "eastus2", "location": "eastus2",
"name": "secgroup001", "name": "secgroup001",
"properties": { "properties": {
"defaultSecurityRules": [ "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowVnetInBound",
"name": "AllowVnetInBound", "name": "AllowVnetInBound",
"properties": { "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowAzureLoadBalancerInBound",
"name": "AllowAzureLoadBalancerInBound", "name": "AllowAzureLoadBalancerInBound",
"properties": { "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/DenyAllInBound",
"name": "DenyAllInBound", "name": "DenyAllInBound",
"properties": { "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowVnetOutBound",
"name": "AllowVnetOutBound", "name": "AllowVnetOutBound",
"properties": { "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/AllowInternetOutBound",
"name": "AllowInternetOutBound", "name": "AllowInternetOutBound",
"properties": { "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkSecurityGroups/secgroup001/defaultSecurityRules/DenyAllOutBound",
"name": "DenyAllOutBound", "name": "DenyAllOutBound",
"properties": { "properties": {

View file

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

View file

@ -352,7 +352,7 @@ state:
"enableIPForwarding": false, "enableIPForwarding": false,
"ipConfigurations": [ "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/networkInterfaces/testvm10_NIC01/ipConfigurations/default",
"name": "default", "name": "default",
"properties": { "properties": {
@ -450,7 +450,7 @@ def extract_names_from_blob_uri(blob_uri):
return extracted_names return extracted_names
class AzureRMVirtualMachine(AzureRMModuleBase): class AzureRMVirtualMachine(AzureRMModuleBase):
def __init__(self): def __init__(self):

View file

@ -123,7 +123,7 @@ state:
"127.0.0.1", "127.0.0.1",
"127.0.0.3" "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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/virtualNetworks/my_test_network",
"location": "eastus", "location": "eastus",
"name": "my_test_network", "name": "my_test_network",

View file

@ -82,7 +82,7 @@ objects:
returned: always returned: always
type: list type: list
sample: [{ 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", "id": "/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/resourceGroups/Testing/providers/Microsoft.Network/virtualNetworks/vnet2001",
"location": "eastus2", "location": "eastus2",
"name": "vnet2001", "name": "vnet2001",

View file

@ -46,11 +46,11 @@ options:
required: false required: false
cpu_period: cpu_period:
description: description:
- Limit CPU CFS (Completely Fair Scheduler) period - Limit CPU CFS (Completely Fair Scheduler) period
default: 0 default: 0
cpu_quota: cpu_quota:
description: description:
- Limit CPU CFS (Completely Fair Scheduler) quota - Limit CPU CFS (Completely Fair Scheduler) quota
default: 0 default: 0
cpuset_cpus: cpuset_cpus:
description: description:
@ -69,7 +69,7 @@ options:
required: false required: false
detach: detach:
description: description:
- Enable detached mode to leave the container running in background. - Enable detached mode to leave the container running in background.
If disabled, fail unless the process exits cleanly. If disabled, fail unless the process exits cleanly.
default: true default: true
devices: devices:
@ -100,7 +100,7 @@ options:
required: false required: false
etc_hosts: etc_hosts:
description: description:
- Dict of host-to-IP mappings, where each host name is key in the dictionary. Hostname will be added to the - Dict of host-to-IP mappings, where each host name is key in the dictionary. Hostname will be added to the
container's /etc/hosts file. container's /etc/hosts file.
default: null default: null
required: false required: false
@ -120,7 +120,7 @@ options:
default: false default: false
groups: groups:
description: description:
- List of additional group names and/or IDs that the container process will run as. - List of additional group names and/or IDs that the container process will run as.
default: null default: null
required: false required: false
hostname: hostname:
@ -133,7 +133,7 @@ options:
- When state is present or started the module compares the configuration of an existing - When state is present or started the module compares the configuration of an existing
container to requested configuration. The evaluation includes the image version. If container to requested configuration. The evaluation includes the image version. If
the image vesion in the registry does not match the container, the container will be the image vesion in the registry does not match the container, the container will be
rebuilt. To stop this behavior set ignore_image to true. rebuilt. To stop this behavior set ignore_image to true.
default: false default: false
image: image:
description: description:
@ -147,7 +147,7 @@ options:
default: false default: false
ipc_mode: ipc_mode:
description: description:
- Set the IPC mode for the container. Can be one of - Set the IPC mode for the container. Can be one of
'container:<name|id>' to reuse another container's IPC namespace 'container:<name|id>' to reuse another container's IPC namespace
or 'host' to use the host's IPC namespace within the container. or 'host' to use the host's IPC namespace within the container.
default: null default: null
@ -155,7 +155,7 @@ options:
keep_volumes: keep_volumes:
description: description:
- Retain volumes associated with a removed container. - Retain volumes associated with a removed container.
default: true default: true
kill_signal: kill_signal:
description: description:
- Override default signal used to kill a running container. - Override default signal used to kill a running container.
@ -190,7 +190,7 @@ options:
defult: json-file defult: json-file
log_options: log_options:
description: description:
- Dictionary of options specific to the chosen log_driver. See https://docs.docker.com/engine/admin/logging/overview/ - Dictionary of options specific to the chosen log_driver. See https://docs.docker.com/engine/admin/logging/overview/
for details. for details.
required: false required: false
default: null default: null
@ -281,7 +281,7 @@ options:
default: false default: false
registry: registry:
description: description:
- Registry URL from which to pull images. If not specified, images will be pulled from - Registry URL from which to pull images. If not specified, images will be pulled from
the default registry found in the local docker config.json file. the default registry found in the local docker config.json file.
default: null default: null
required: false required: false
@ -295,14 +295,14 @@ options:
choices: choices:
- on-failure - on-failure
- always - always
default: on-failure default: on-failure
restart_retries: restart_retries:
description: description:
- Use with restart policy to control maximum number of restart attempts. - Use with restart policy to control maximum number of restart attempts.
default: 0 default: 0
shm_size: shm_size:
description: description:
- Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`. - Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`.
Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes).
- Ommitting the unit defaults to bytes. If you omit the size entirely, the system uses `64m`. - Ommitting the unit defaults to bytes. If you omit the size entirely, the system uses `64m`.
default: null default: null
@ -319,15 +319,15 @@ options:
- '"present" - Asserts the existence of a container matching the name and any provided configuration parameters. If no - '"present" - Asserts the existence of a container matching the name and any provided configuration parameters. If no
container matches the name, a container will be created. If a container matches the name but the provided configuration container matches the name, a container will be created. If a container matches the name but the provided configuration
does not match, the container will be updated, if it can be. If it cannot be updated, it will be removed and re-created does not match, the container will be updated, if it can be. If it cannot be updated, it will be removed and re-created
with the requested config. Image version will be taken into account when comparing configuration. To ignore image with the requested config. Image version will be taken into account when comparing configuration. To ignore image
version use the ignore_image option. Use the recreate option to force the re-creation of the matching container. Use version use the ignore_image option. Use the recreate option to force the re-creation of the matching container. Use
force_kill to kill the container rather than stopping it. Use keep_volumes to retain volumes associated with a removed force_kill to kill the container rather than stopping it. Use keep_volumes to retain volumes associated with a removed
container.' container.'
- '"started" - Asserts there is a running container matching the name and any provided configuration. If no container - '"started" - Asserts there is a running container matching the name and any provided configuration. If no container
matches the name, a container will be created and started. If a container matching the name is found but the matches the name, a container will be created and started. If a container matching the name is found but the
configuration does not match, the container will be updated, if it can be. If it cannot be updated, it will be removed configuration does not match, the container will be updated, if it can be. If it cannot be updated, it will be removed
and a new container will be created with the requested configuration and started. Image version will be taken into and a new container will be created with the requested configuration and started. Image version will be taken into
account when comparing configuration. To ignore image version use the ignore_image option. Use recreate to always account when comparing configuration. To ignore image version use the ignore_image option. Use recreate to always
re-create a matching container, even if it is running. Use restart to force a matching container to be stopped and re-create a matching container, even if it is running. Use restart to force a matching container to be stopped and
restarted. Use force_kill to kill a container rather than stopping it. Use keep_volumes to retain volumes associated restarted. Use force_kill to kill a container rather than stopping it. Use keep_volumes to retain volumes associated
with a removed container.' with a removed container.'
@ -343,7 +343,7 @@ options:
stop_signal: stop_signal:
description: description:
- Override default signal used to stop the container. - Override default signal used to stop the container.
default: null default: null
required: false required: false
stop_timeout: stop_timeout:
description: description:
@ -378,7 +378,7 @@ options:
- List of volumes to mount within the container. - List of volumes to mount within the container.
- "Use docker CLI-style syntax: C(/host:/container[:mode])" - "Use docker CLI-style syntax: C(/host:/container[:mode])"
- You can specify a read mode for the mount with either C(ro) or C(rw). - You can specify a read mode for the mount with either C(ro) or C(rw).
- SELinux hosts can additionally use C(z) or C(Z) to use a shared or - SELinux hosts can additionally use C(z) or C(Z) to use a shared or
private label for the volume. private label for the volume.
default: null default: null
required: false required: false
@ -389,7 +389,7 @@ options:
required: false required: false
volumes_from: volumes_from:
description: description:
- List of container names or Ids to get volumes from. - List of container names or Ids to get volumes from.
default: null default: null
required: false required: false
@ -436,7 +436,7 @@ EXAMPLES = '''
docker_container: docker_container:
name: myapplication name: myapplication
image: someuser/appimage image: someuser/appimage
state: started state: started
restart: yes restart: yes
links: links:
- "myredis:aliasedredis" - "myredis:aliasedredis"
@ -471,10 +471,10 @@ EXAMPLES = '''
name: ohno name: ohno
state: absent state: absent
- name: Syslogging output - name: Syslogging output
docker_container: docker_container:
name: myservice name: myservice
state: started state: started
log_driver: syslog log_driver: syslog
log_opt: log_opt:
syslog-address: tcp://my-syslog-server:514 syslog-address: tcp://my-syslog-server:514
@ -528,6 +528,7 @@ container:
"/tmp/lnmp/nginx-sites/logs/": {} "/tmp/lnmp/nginx-sites/logs/": {}
}, },
... ...
}
} }
''' '''
@ -910,7 +911,7 @@ class TaskParameters(DockerBaseClass):
class Container(DockerBaseClass): class Container(DockerBaseClass):
def __init__(self, container, parameters): def __init__(self, container, parameters):
super(Container, self).__init__() super(Container, self).__init__()
self.raw = container self.raw = container

View file

@ -68,7 +68,7 @@ images:
description: Facts for the selected images. description: Facts for the selected images.
returned: always returned: always
type: dict type: dict
sample:[ sample: [
{ {
"Architecture": "amd64", "Architecture": "amd64",
"Author": "", "Author": "",
@ -111,7 +111,7 @@ images:
"Cmd": [ "Cmd": [
"/bin/sh", "/bin/sh",
"-c", "-c",
"#(nop) CMD [\"/etc/docker/registry/config.yml\"]" '#(nop) CMD ["/etc/docker/registry/config.yml"]'
], ],
"Domainname": "", "Domainname": "",
"Entrypoint": [ "Entrypoint": [
@ -241,4 +241,4 @@ def main():
from ansible.module_utils.basic import * from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -87,6 +87,7 @@ options:
- Project name or ID containing the network (name admin-only) - Project name or ID containing the network (name admin-only)
required: false required: false
default: None default: None
version_added: "2.1"
requirements: ["shade"] requirements: ["shade"]
''' '''

View file

@ -110,6 +110,7 @@ options:
- Project name or ID containing the subnet (name admin-only) - Project name or ID containing the subnet (name admin-only)
required: false required: false
default: None default: None
version_added: "2.1"
requirements: requirements:
- "python >= 2.6" - "python >= 2.6"
- "shade" - "shade"

View file

@ -168,5 +168,3 @@ from ansible.module_utils.openswitch import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -239,8 +239,7 @@ from ansible.module_utils.urls import *
from ansible.module_utils.netcfg import * from ansible.module_utils.netcfg import *
from ansible.module_utils.shell import * from ansible.module_utils.shell import *
from ansible.module_utils.openswitch import * from ansible.module_utils.openswitch import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -1,3 +1,24 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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/>.
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
DOCUMENTATION=''' DOCUMENTATION='''
--- ---
module: win_reboot module: win_reboot