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

@ -436,7 +436,7 @@ 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:

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",

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

@ -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,

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": {

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

@ -529,6 +529,7 @@ container:
}, },
... ...
} }
}
''' '''
import logging import logging

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": [

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