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:
parent
4a8a292793
commit
bb9572ca86
19 changed files with 110 additions and 84 deletions
|
@ -9,9 +9,14 @@ addons:
|
|||
packages:
|
||||
- python2.4
|
||||
- python2.6
|
||||
install:
|
||||
- pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible
|
||||
- pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing
|
||||
script:
|
||||
- python2.4 -m compileall -fq -x 'cloud/' .
|
||||
- python2.4 -m compileall -fq cloud/amazon/_ec2_ami_search.py cloud/amazon/ec2_facts.py
|
||||
- python2.6 -m compileall -fq .
|
||||
- python2.7 -m compileall -fq .
|
||||
- ansible-validate-modules --exclude 'utilities/' .
|
||||
#- ansible-validate-modules --exclude 'cloud/amazon/ec2_lc\.py|cloud/amazon/ec2_scaling_policy\.py|cloud/amazon/ec2_scaling_policy\.py|cloud/amazon/ec2_asg\.py|cloud/azure/azure\.py|packaging/os/rhn_register\.py|network/openswitch/ops_template\.py|system/hostname\.py|utilities/' .
|
||||
#- ./test-docs.sh core
|
||||
|
|
|
@ -326,16 +326,16 @@ def commit(changes, retry_interval, wait, wait_timeout):
|
|||
time.sleep(float(retry_interval))
|
||||
|
||||
if wait:
|
||||
timeout_time = time.time() + wait_timeout
|
||||
connection = changes.connection
|
||||
change = result['ChangeResourceRecordSetsResponse']['ChangeInfo']
|
||||
status = Status(connection, change)
|
||||
while status.status != 'INSYNC' and time.time() < timeout_time:
|
||||
time.sleep(WAIT_RETRY_SLEEP)
|
||||
status.update()
|
||||
if time.time() >= timeout_time:
|
||||
raise TimeoutError()
|
||||
return result
|
||||
timeout_time = time.time() + wait_timeout
|
||||
connection = changes.connection
|
||||
change = result['ChangeResourceRecordSetsResponse']['ChangeInfo']
|
||||
status = Status(connection, change)
|
||||
while status.status != 'INSYNC' and time.time() < timeout_time:
|
||||
time.sleep(WAIT_RETRY_SLEEP)
|
||||
status.update()
|
||||
if time.time() >= timeout_time:
|
||||
raise TimeoutError()
|
||||
return result
|
||||
|
||||
# Shamelessly copied over from https://git.io/vgmDG
|
||||
IGNORE_CODE = 'Throttling'
|
||||
|
@ -427,12 +427,12 @@ def main():
|
|||
if not value_in:
|
||||
module.fail_json(msg = "parameter 'value' required for create/delete")
|
||||
elif alias_in:
|
||||
if len(value_list) != 1:
|
||||
module.fail_json(msg = "parameter 'value' must contain a single dns name for alias create/delete")
|
||||
elif not alias_hosted_zone_id_in:
|
||||
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:
|
||||
module.fail_json(msg= "If you specify failover, region or weight you must also specify identifier")
|
||||
if len(value_list) != 1:
|
||||
module.fail_json(msg = "parameter 'value' must contain a single dns name for alias create/delete")
|
||||
elif not alias_hosted_zone_id_in:
|
||||
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:
|
||||
module.fail_json(msg= "If you specify failover, region or weight you must also specify identifier")
|
||||
|
||||
if command_in == 'create':
|
||||
if ( weight_in!=None or region_in!=None or failover_in!=None ) and identifier_in==None:
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
##!/usr/bin/python
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
|
||||
# Chris Houseknecht, <house@redhat.com>
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -528,6 +528,7 @@ container:
|
|||
"/tmp/lnmp/nginx-sites/logs/": {}
|
||||
},
|
||||
...
|
||||
}
|
||||
}
|
||||
'''
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ images:
|
|||
description: Facts for the selected images.
|
||||
returned: always
|
||||
type: dict
|
||||
sample:[
|
||||
sample: [
|
||||
{
|
||||
"Architecture": "amd64",
|
||||
"Author": "",
|
||||
|
@ -111,7 +111,7 @@ images:
|
|||
"Cmd": [
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"#(nop) CMD [\"/etc/docker/registry/config.yml\"]"
|
||||
'#(nop) CMD ["/etc/docker/registry/config.yml"]'
|
||||
],
|
||||
"Domainname": "",
|
||||
"Entrypoint": [
|
||||
|
|
|
@ -87,6 +87,7 @@ options:
|
|||
- Project name or ID containing the network (name admin-only)
|
||||
required: false
|
||||
default: None
|
||||
version_added: "2.1"
|
||||
requirements: ["shade"]
|
||||
'''
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ options:
|
|||
- Project name or ID containing the subnet (name admin-only)
|
||||
required: false
|
||||
default: None
|
||||
version_added: "2.1"
|
||||
requirements:
|
||||
- "python >= 2.6"
|
||||
- "shade"
|
||||
|
|
|
@ -168,5 +168,3 @@ from ansible.module_utils.openswitch import *
|
|||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -239,8 +239,7 @@ from ansible.module_utils.urls import *
|
|||
from ansible.module_utils.netcfg import *
|
||||
from ansible.module_utils.shell import *
|
||||
from ansible.module_utils.openswitch import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
main()
|
||||
|
||||
|
|
|
@ -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='''
|
||||
---
|
||||
module: win_reboot
|
||||
|
|
Loading…
Reference in a new issue