Sanity test fixups: AWS VPC related modules (#64089)

* Add missing boilerplate

* Avoid blocklisted variable name '_'

* doc fixups

* Remove defaults for required parameters

* Remove explicit definition of 'region' from argument spec
it's automatically added by ec2_argument_spec and redefining removes the aliases

* remove sanity ignore entries for AWS VPC related modules

* Suggested Review changes
pull/64132/head^2
Mark Chappell 5 years ago committed by Jill R
parent 56db433d63
commit 4e8bb334a9

@ -35,26 +35,35 @@ options:
domain_name: domain_name:
description: description:
- The domain name to set in the DHCP option sets - The domain name to set in the DHCP option sets
type: str
dns_servers: dns_servers:
description: description:
- A list of hosts to set the DNS servers for the VPC to. (Should be a - A list of hosts to set the DNS servers for the VPC to. (Should be a
list of IP addresses rather than host names.) list of IP addresses rather than host names.)
type: list
elements: str
ntp_servers: ntp_servers:
description: description:
- List of hosts to advertise as NTP servers for the VPC. - List of hosts to advertise as NTP servers for the VPC.
type: list
elements: str
netbios_name_servers: netbios_name_servers:
description: description:
- List of hosts to advertise as NetBIOS servers. - List of hosts to advertise as NetBIOS servers.
type: list
elements: str
netbios_node_type: netbios_node_type:
description: description:
- NetBIOS node type to advertise in the DHCP options. - NetBIOS node type to advertise in the DHCP options.
The AWS recommendation is to use 2 (when using netbios name services) The AWS recommendation is to use 2 (when using netbios name services)
U(https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) U(https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html)
type: int
vpc_id: vpc_id:
description: description:
- VPC ID to associate with the requested DHCP option set. - VPC ID to associate with the requested DHCP option set.
If no vpc id is provided, and no matching option set is found then a new If no vpc id is provided, and no matching option set is found then a new
DHCP option set is created. DHCP option set is created.
type: str
delete_old: delete_old:
description: description:
- Whether to delete the old VPC DHCP option set when associating a new one. - Whether to delete the old VPC DHCP option set when associating a new one.
@ -77,12 +86,14 @@ options:
if the resource_id is provided. (options must match) if the resource_id is provided. (options must match)
aliases: [ 'resource_tags'] aliases: [ 'resource_tags']
version_added: "2.1" version_added: "2.1"
type: dict
dhcp_options_id: dhcp_options_id:
description: description:
- The resource_id of an existing DHCP options set. - The resource_id of an existing DHCP options set.
If this is specified, then it will override other settings, except tags If this is specified, then it will override other settings, except tags
(which will be updated to match) (which will be updated to match)
version_added: "2.1" version_added: "2.1"
type: str
state: state:
description: description:
- create/assign or remove the DHCP options. - create/assign or remove the DHCP options.
@ -91,6 +102,7 @@ options:
default: present default: present
choices: [ 'absent', 'present' ] choices: [ 'absent', 'present' ]
version_added: "2.1" version_added: "2.1"
type: str
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -26,11 +26,20 @@ options:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeDhcpOptions.html) for possible filters. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeDhcpOptions.html) for possible filters.
type: dict
dhcp_options_ids: dhcp_options_ids:
description: description:
- Get details of specific DHCP Option ID - Get details of specific DHCP Option IDs.
- Provide this value as a list
aliases: ['DhcpOptionIds'] aliases: ['DhcpOptionIds']
type: list
elements: str
dry_run:
description:
- Checks whether you have the required permissions to view the DHCP
Options.
aliases: ['DryRun']
version_added: "2.4"
type: bool
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -2,6 +2,9 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
@ -20,11 +23,13 @@ options:
description: description:
- The VPC ID for the VPC that this Egress Only Internet Gateway should be attached. - The VPC ID for the VPC that this Egress Only Internet Gateway should be attached.
required: true required: true
type: str
state: state:
description: description:
- Create or delete the EIGW - Create or delete the EIGW.
default: present default: present
choices: [ 'present', 'absent' ] choices: [ 'present', 'absent' ]
type: str
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -25,12 +25,14 @@ options:
description: description:
- Required when creating a VPC endpoint. - Required when creating a VPC endpoint.
required: false required: false
type: str
service: service:
description: description:
- An AWS supported vpc endpoint service. Use the M(ec2_vpc_endpoint_info) - An AWS supported vpc endpoint service. Use the M(ec2_vpc_endpoint_info)
module to describe the supported endpoint services. module to describe the supported endpoint services.
- Required when creating an endpoint. - Required when creating an endpoint.
required: false required: false
type: str
policy: policy:
description: description:
- A properly formatted json policy as string, see - A properly formatted json policy as string, see
@ -39,6 +41,7 @@ options:
- Option when creating an endpoint. If not provided AWS will - Option when creating an endpoint. If not provided AWS will
utilise a default policy which provides full access to the service. utilise a default policy which provides full access to the service.
required: false required: false
type: json
policy_file: policy_file:
description: description:
- The path to the properly json formatted policy file, see - The path to the properly json formatted policy file, see
@ -48,6 +51,7 @@ options:
utilise a default policy which provides full access to the service. utilise a default policy which provides full access to the service.
required: false required: false
aliases: [ "policy_path" ] aliases: [ "policy_path" ]
type: path
state: state:
description: description:
- present to ensure resource is created. - present to ensure resource is created.
@ -55,6 +59,7 @@ options:
required: false required: false
default: present default: present
choices: [ "present", "absent"] choices: [ "present", "absent"]
type: str
wait: wait:
description: description:
- When specified, will wait for either available status for state present. - When specified, will wait for either available status for state present.
@ -70,20 +75,25 @@ options:
behaviour from AWS. behaviour from AWS.
required: false required: false
default: 320 default: 320
type: int
route_table_ids: route_table_ids:
description: description:
- List of one or more route table ids to attach to the endpoint. A route - List of one or more route table ids to attach to the endpoint. A route
is added to the route table with the destination of the endpoint if is added to the route table with the destination of the endpoint if
provided. provided.
required: false required: false
type: list
elements: str
vpc_endpoint_id: vpc_endpoint_id:
description: description:
- One or more vpc endpoint ids to remove from the AWS account - One or more vpc endpoint ids to remove from the AWS account
required: false required: false
type: str
client_token: client_token:
description: description:
- Optional client token to ensure idempotency - Optional client token to ensure idempotency
required: false required: false
type: str
author: Karen Cheng (@Etherdaemon) author: Karen Cheng (@Etherdaemon)
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws

@ -13,7 +13,7 @@ DOCUMENTATION = '''
module: ec2_vpc_endpoint_info module: ec2_vpc_endpoint_info
short_description: Retrieves AWS VPC endpoints details using AWS methods. short_description: Retrieves AWS VPC endpoints details using AWS methods.
description: description:
- Gets various details related to AWS VPC Endpoints - Gets various details related to AWS VPC Endpoints.
- This module was called C(ec2_vpc_endpoint_facts) before Ansible 2.9. The usage did not change. - This module was called C(ec2_vpc_endpoint_facts) before Ansible 2.9. The usage did not change.
version_added: "2.4" version_added: "2.4"
requirements: [ boto3 ] requirements: [ boto3 ]
@ -26,15 +26,18 @@ options:
choices: choices:
- services - services
- endpoints - endpoints
type: str
vpc_endpoint_ids: vpc_endpoint_ids:
description: description:
- Get details of specific endpoint IDs - Get details of specific endpoint IDs
- Provide this value as a list type: list
elements: str
filters: filters:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcEndpoints.html) See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcEndpoints.html)
for possible filters. for possible filters.
type: dict
author: Karen Cheng (@Etherdaemon) author: Karen Cheng (@Etherdaemon)
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws

@ -24,16 +24,19 @@ options:
description: description:
- The VPC ID for the VPC in which to manage the Internet Gateway. - The VPC ID for the VPC in which to manage the Internet Gateway.
required: true required: true
type: str
tags: tags:
description: description:
- "A dict of tags to apply to the internet gateway. Any tags currently applied to the internet gateway and not present here will be removed." - "A dict of tags to apply to the internet gateway. Any tags currently applied to the internet gateway and not present here will be removed."
aliases: [ 'resource_tags' ] aliases: [ 'resource_tags' ]
version_added: "2.4" version_added: "2.4"
type: dict
state: state:
description: description:
- Create or terminate the IGW - Create or terminate the IGW
default: present default: present
choices: [ 'present', 'absent' ] choices: [ 'present', 'absent' ]
type: str
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -26,9 +26,12 @@ options:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInternetGateways.html) for possible filters. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInternetGateways.html) for possible filters.
type: dict
internet_gateway_ids: internet_gateway_ids:
description: description:
- Get details of specific Internet Gateway ID. Provide this value as a list. - Get details of specific Internet Gateway ID. Provide this value as a list.
type: list
elements: str
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -25,23 +25,28 @@ options:
- Ensure NAT Gateway is present or absent. - Ensure NAT Gateway is present or absent.
default: "present" default: "present"
choices: ["present", "absent"] choices: ["present", "absent"]
type: str
nat_gateway_id: nat_gateway_id:
description: description:
- The id AWS dynamically allocates to the NAT Gateway on creation. - The id AWS dynamically allocates to the NAT Gateway on creation.
This is required when the absent option is present. This is required when the absent option is present.
type: str
subnet_id: subnet_id:
description: description:
- The id of the subnet to create the NAT Gateway in. This is required - The id of the subnet to create the NAT Gateway in. This is required
with the present option. with the present option.
type: str
allocation_id: allocation_id:
description: description:
- The id of the elastic IP allocation. If this is not passed and the - The id of the elastic IP allocation. If this is not passed and the
eip_address is not passed. An EIP is generated for this NAT Gateway. eip_address is not passed. An EIP is generated for this NAT Gateway.
type: str
eip_address: eip_address:
description: description:
- The elastic IP address of the EIP you want attached to this NAT Gateway. - The elastic IP address of the EIP you want attached to this NAT Gateway.
If this is not passed and the allocation_id is not passed, If this is not passed and the allocation_id is not passed,
an EIP is generated for this NAT Gateway. an EIP is generated for this NAT Gateway.
type: str
if_exist_do_not_create: if_exist_do_not_create:
description: description:
- if a NAT Gateway exists already in the subnet_id, then do not create a new one. - if a NAT Gateway exists already in the subnet_id, then do not create a new one.
@ -53,22 +58,24 @@ options:
- Deallocate the EIP from the VPC. - Deallocate the EIP from the VPC.
- Option is only valid with the absent state. - Option is only valid with the absent state.
- You should use this with the wait option. Since you can not release an address while a delete operation is happening. - You should use this with the wait option. Since you can not release an address while a delete operation is happening.
default: 'yes' default: false
type: bool type: bool
wait: wait:
description: description:
- Wait for operation to complete before returning. - Wait for operation to complete before returning.
default: 'no' default: false
type: bool type: bool
wait_timeout: wait_timeout:
description: description:
- How many seconds to wait for an operation to complete before timing out. - How many seconds to wait for an operation to complete before timing out.
default: 300 default: 320
type: int
client_token: client_token:
description: description:
- Optional unique token to be used during create to ensure idempotency. - Optional unique token to be used during create to ensure idempotency.
When specifying this option, ensure you specify the eip_address parameter When specifying this option, ensure you specify the eip_address parameter
as well otherwise any subsequent runs will fail. as well otherwise any subsequent runs will fail.
type: str
author: author:
- Allen Sanabria (@linuxdynasty) - Allen Sanabria (@linuxdynasty)
- Jon Hadfield (@jonhadfield) - Jon Hadfield (@jonhadfield)
@ -103,7 +110,7 @@ EXAMPLES = '''
state: present state: present
subnet_id: subnet-12345678 subnet_id: subnet-12345678
eip_address: 52.1.1.1 eip_address: 52.1.1.1
wait: yes wait: true
region: ap-southeast-2 region: ap-southeast-2
register: new_nat_gateway register: new_nat_gateway
@ -111,7 +118,7 @@ EXAMPLES = '''
ec2_vpc_nat_gateway: ec2_vpc_nat_gateway:
state: present state: present
subnet_id: subnet-12345678 subnet_id: subnet-12345678
wait: yes wait: true
region: ap-southeast-2 region: ap-southeast-2
register: new_nat_gateway register: new_nat_gateway
@ -119,7 +126,7 @@ EXAMPLES = '''
ec2_vpc_nat_gateway: ec2_vpc_nat_gateway:
state: present state: present
subnet_id: subnet-12345678 subnet_id: subnet-12345678
wait: yes wait: true
region: ap-southeast-2 region: ap-southeast-2
if_exist_do_not_create: true if_exist_do_not_create: true
register: new_nat_gateway register: new_nat_gateway
@ -128,9 +135,9 @@ EXAMPLES = '''
ec2_vpc_nat_gateway: ec2_vpc_nat_gateway:
state: absent state: absent
region: ap-southeast-2 region: ap-southeast-2
wait: yes wait: true
nat_gateway_id: "{{ item.NatGatewayId }}" nat_gateway_id: "{{ item.NatGatewayId }}"
release_eip: yes release_eip: true
register: delete_nat_gateway_result register: delete_nat_gateway_result
loop: "{{ gateways_to_remove.result }}" loop: "{{ gateways_to_remove.result }}"
@ -138,7 +145,7 @@ EXAMPLES = '''
ec2_vpc_nat_gateway: ec2_vpc_nat_gateway:
state: absent state: absent
nat_gateway_id: nat-12345678 nat_gateway_id: nat-12345678
wait: yes wait: true
wait_timeout: 500 wait_timeout: 500
region: ap-southeast-2 region: ap-southeast-2
@ -146,7 +153,7 @@ EXAMPLES = '''
ec2_vpc_nat_gateway: ec2_vpc_nat_gateway:
state: absent state: absent
nat_gateway_id: nat-12345678 nat_gateway_id: nat-12345678
release_eip: yes release_eip: true
wait: yes wait: yes
wait_timeout: 300 wait_timeout: 300
region: ap-southeast-2 region: ap-southeast-2
@ -447,7 +454,7 @@ def gateway_in_subnet_exists(client, subnet_id, allocation_id=None,
allocation_id_exists = False allocation_id_exists = False
gateways = [] gateways = []
states = ['available', 'pending'] states = ['available', 'pending']
gws_retrieved, _, gws = ( gws_retrieved, err_msg, gws = (
get_nat_gateways( get_nat_gateways(
client, subnet_id, states=states, check_mode=check_mode client, subnet_id, states=states, check_mode=check_mode
) )
@ -874,7 +881,7 @@ def remove(client, nat_gateway_id, wait=False, wait_timeout=0,
results = list() results = list()
states = ['pending', 'available'] states = ['pending', 'available']
try: try:
exist, _, gw = ( exist, err_msg, gw = (
get_nat_gateways( get_nat_gateways(
client, nat_gateway_id=nat_gateway_id, client, nat_gateway_id=nat_gateway_id,
states=states, check_mode=check_mode states=states, check_mode=check_mode

@ -22,12 +22,15 @@ requirements: [ boto3 ]
options: options:
nat_gateway_ids: nat_gateway_ids:
description: description:
- Get details of specific nat gateway IDs - List of specific nat gateway IDs to fetch details for.
type: list
elements: str
filters: filters:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNatGateways.html) See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNatGateways.html)
for possible filters. for possible filters.
type: dict
author: Karen Cheng (@Etherdaemon) author: Karen Cheng (@Etherdaemon)
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws

@ -26,11 +26,14 @@ options:
description: description:
- The name to give your VPC. This is used in combination with C(cidr_block) to determine if a VPC already exists. - The name to give your VPC. This is used in combination with C(cidr_block) to determine if a VPC already exists.
required: yes required: yes
type: str
cidr_block: cidr_block:
description: description:
- The primary CIDR of the VPC. After 2.5 a list of CIDRs can be provided. The first in the list will be used as the primary CIDR - The primary CIDR of the VPC. After 2.5 a list of CIDRs can be provided. The first in the list will be used as the primary CIDR
and is used in conjunction with the C(name) to ensure idempotence. and is used in conjunction with the C(name) to ensure idempotence.
required: yes required: yes
type: list
elements: str
ipv6_cidr: ipv6_cidr:
description: description:
- Request an Amazon-provided IPv6 CIDR block with /56 prefix length. You cannot specify the range of IPv6 addresses, - Request an Amazon-provided IPv6 CIDR block with /56 prefix length. You cannot specify the range of IPv6 addresses,
@ -49,6 +52,7 @@ options:
- Whether to be default or dedicated tenancy. This cannot be changed after the VPC has been created. - Whether to be default or dedicated tenancy. This cannot be changed after the VPC has been created.
default: default default: default
choices: [ 'default', 'dedicated' ] choices: [ 'default', 'dedicated' ]
type: str
dns_support: dns_support:
description: description:
- Whether to enable AWS DNS support. - Whether to enable AWS DNS support.
@ -61,17 +65,20 @@ options:
type: bool type: bool
dhcp_opts_id: dhcp_opts_id:
description: description:
- the id of the DHCP options to use for this vpc - The id of the DHCP options to use for this VPC.
type: str
tags: tags:
description: description:
- The tags you want attached to the VPC. This is independent of the name value, note if you pass a 'Name' key it would override the Name of - The tags you want attached to the VPC. This is independent of the name value, note if you pass a 'Name' key it would override the Name of
the VPC if it's different. the VPC if it's different.
aliases: [ 'resource_tags' ] aliases: [ 'resource_tags' ]
type: dict
state: state:
description: description:
- The state of the VPC. Either absent or present. - The state of the VPC. Either absent or present.
default: present default: present
choices: [ 'present', 'absent' ] choices: [ 'present', 'absent' ]
type: str
multi_ok: multi_ok:
description: description:
- By default the module will not create another VPC if there is another VPC with the same name and CIDR block. Specify this as true if you want - By default the module will not create another VPC if there is another VPC with the same name and CIDR block. Specify this as true if you want
@ -136,8 +143,8 @@ vpc:
classic_link_enabled: classic_link_enabled:
description: indicates whether ClassicLink is enabled description: indicates whether ClassicLink is enabled
returned: always returned: always
type: NoneType type: bool
sample: null sample: false
dhcp_options_id: dhcp_options_id:
description: the id of the DHCP options associated with this VPC description: the id of the DHCP options associated with this VPC
returned: always returned: always

@ -1,17 +1,9 @@
#!/usr/bin/python #!/usr/bin/python
# #
# This is a free software: you can redistribute it and/or modify # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or from __future__ import (absolute_import, division, print_function)
# (at your option) any later version. __metaclass__ = type
#
# This Ansible library 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 this library. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'], 'status': ['stableinterface'],
@ -35,10 +27,13 @@ options:
description: description:
- A list of VPC IDs that exist in your account. - A list of VPC IDs that exist in your account.
version_added: "2.5" version_added: "2.5"
type: list
elements: str
filters: filters:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) for possible filters. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) for possible filters.
type: dict
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -23,33 +23,40 @@ options:
description: description:
- VPC id of the requesting VPC. - VPC id of the requesting VPC.
required: false required: false
type: str
peering_id: peering_id:
description: description:
- Peering connection id. - Peering connection id.
required: false required: false
type: str
peer_region: peer_region:
description: description:
- Region of the accepting VPC. - Region of the accepting VPC.
required: false required: false
version_added: '2.5' version_added: '2.5'
type: str
peer_vpc_id: peer_vpc_id:
description: description:
- VPC id of the accepting VPC. - VPC id of the accepting VPC.
required: false required: false
type: str
peer_owner_id: peer_owner_id:
description: description:
- The AWS account number for cross account peering. - The AWS account number for cross account peering.
required: false required: false
type: str
tags: tags:
description: description:
- Dictionary of tags to look for and apply when creating a Peering Connection. - Dictionary of tags to look for and apply when creating a Peering Connection.
required: false required: false
type: dict
state: state:
description: description:
- Create, delete, accept, reject a peering connection. - Create, delete, accept, reject a peering connection.
required: false required: false
default: present default: present
choices: ['present', 'absent', 'accept', 'reject'] choices: ['present', 'absent', 'accept', 'reject']
type: str
author: Mike Mochan (@mmochan) author: Mike Mochan (@mmochan)
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws

@ -21,12 +21,15 @@ requirements: [ boto3 ]
options: options:
peer_connection_ids: peer_connection_ids:
description: description:
- Get details of specific vpc peer IDs - List of specific VPC peer IDs to get details for.
type: list
elements: str
filters: filters:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcPeeringConnections.html) See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcPeeringConnections.html)
for possible filters. for possible filters.
type: dict
author: Karen Cheng (@Etherdaemon) author: Karen Cheng (@Etherdaemon)
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws

@ -1,17 +1,9 @@
#!/usr/bin/python #!/usr/bin/python
# #
# This is a free software: you can redistribute it and/or modify # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or from __future__ import (absolute_import, division, print_function)
# (at your option) any later version. __metaclass__ = type
#
# This Ansible library 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 this library. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'], 'status': ['stableinterface'],
@ -36,8 +28,11 @@ options:
route table will be created. To change tags of a route table you must look up by id. route table will be created. To change tags of a route table you must look up by id.
default: tag default: tag
choices: [ 'tag', 'id' ] choices: [ 'tag', 'id' ]
type: str
propagating_vgw_ids: propagating_vgw_ids:
description: Enable route propagation from virtual gateways specified by ID. description: Enable route propagation from virtual gateways specified by ID.
type: list
elements: str
purge_routes: purge_routes:
version_added: "2.3" version_added: "2.3"
description: Purge existing routes that are not found in routes. description: Purge existing routes that are not found in routes.
@ -55,27 +50,35 @@ options:
default: 'no' default: 'no'
route_table_id: route_table_id:
description: The ID of the route table to update or delete. description: The ID of the route table to update or delete.
type: str
routes: routes:
description: List of routes in the route table. description: List of routes in the route table.
Routes are specified as dicts containing the keys 'dest' and one of 'gateway_id', Routes are specified as dicts containing the keys 'dest' and one of 'gateway_id',
'instance_id', 'network_interface_id', or 'vpc_peering_connection_id'. 'instance_id', 'network_interface_id', or 'vpc_peering_connection_id'.
If 'gateway_id' is specified, you can refer to the VPC's IGW by using the value 'igw'. If 'gateway_id' is specified, you can refer to the VPC's IGW by using the value 'igw'.
Routes are required for present states. Routes are required for present states.
type: list
elements: str
state: state:
description: Create or destroy the VPC route table description: Create or destroy the VPC route table
default: present default: present
choices: [ 'present', 'absent' ] choices: [ 'present', 'absent' ]
type: str
subnets: subnets:
description: An array of subnets to add to this route table. Subnets may be specified description: An array of subnets to add to this route table. Subnets may be specified
by either subnet ID, Name tag, or by a CIDR such as '10.0.0.0/24'. by either subnet ID, Name tag, or by a CIDR such as '10.0.0.0/24'.
type: list
elements: str
tags: tags:
description: > description: >
A dictionary of resource tags of the form: { tag1: value1, tag2: value2 }. Tags are A dictionary of resource tags of the form: { tag1: value1, tag2: value2 }. Tags are
used to uniquely identify route tables within a VPC when the route_table_id is not supplied. used to uniquely identify route tables within a VPC when the route_table_id is not supplied.
aliases: [ "resource_tags" ] aliases: [ "resource_tags" ]
type: dict
vpc_id: vpc_id:
description: VPC ID of the VPC in which to create the route table. description: VPC ID of the VPC in which to create the route table.
required: true required: true
type: str
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -25,6 +25,7 @@ options:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRouteTables.html) for possible filters. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRouteTables.html) for possible filters.
type: dict
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -26,27 +26,33 @@ options:
az: az:
description: description:
- "The availability zone for the subnet." - "The availability zone for the subnet."
type: str
cidr: cidr:
description: description:
- "The CIDR block for the subnet. E.g. 192.0.2.0/24." - "The CIDR block for the subnet. E.g. 192.0.2.0/24."
type: str
ipv6_cidr: ipv6_cidr:
description: description:
- "The IPv6 CIDR block for the subnet. The VPC must have a /56 block assigned and this value must be a valid IPv6 /64 that falls in the VPC range." - "The IPv6 CIDR block for the subnet. The VPC must have a /56 block assigned and this value must be a valid IPv6 /64 that falls in the VPC range."
- "Required if I(assign_instances_ipv6=true)" - "Required if I(assign_instances_ipv6=true)"
version_added: "2.5" version_added: "2.5"
type: str
tags: tags:
description: description:
- "A dict of tags to apply to the subnet. Any tags currently applied to the subnet and not present here will be removed." - "A dict of tags to apply to the subnet. Any tags currently applied to the subnet and not present here will be removed."
aliases: [ 'resource_tags' ] aliases: [ 'resource_tags' ]
type: dict
state: state:
description: description:
- "Create or remove the subnet" - "Create or remove the subnet"
default: present default: present
choices: [ 'present', 'absent' ] choices: [ 'present', 'absent' ]
type: str
vpc_id: vpc_id:
description: description:
- "VPC ID of the VPC in which to create or delete the subnet." - "VPC ID of the VPC in which to create or delete the subnet."
required: true required: true
type: str
map_public: map_public:
description: description:
- "Specify C(yes) to indicate that instances launched into the subnet should be assigned public IP address by default." - "Specify C(yes) to indicate that instances launched into the subnet should be assigned public IP address by default."
@ -57,24 +63,25 @@ options:
description: description:
- "Specify C(yes) to indicate that instances launched into the subnet should be automatically assigned an IPv6 address." - "Specify C(yes) to indicate that instances launched into the subnet should be automatically assigned an IPv6 address."
type: bool type: bool
default: 'no' default: false
version_added: "2.5" version_added: "2.5"
wait: wait:
description: description:
- "When specified,I(state=present) module will wait for subnet to be in available state before continuing." - "When specified,I(state=present) module will wait for subnet to be in available state before continuing."
type: bool type: bool
default: 'yes' default: true
version_added: "2.5" version_added: "2.5"
wait_timeout: wait_timeout:
description: description:
- "Number of seconds to wait for subnet to become available I(wait=True)." - "Number of seconds to wait for subnet to become available I(wait=True)."
default: 300 default: 300
version_added: "2.5" version_added: "2.5"
type: int
purge_tags: purge_tags:
description: description:
- Whether or not to remove tags that do not appear in the I(tags) list. - Whether or not to remove tags that do not appear in the I(tags) list.
type: bool type: bool
default: 'yes' default: true
version_added: "2.5" version_added: "2.5"
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
@ -559,11 +566,11 @@ def main():
argument_spec.update( argument_spec.update(
dict( dict(
az=dict(default=None, required=False), az=dict(default=None, required=False),
cidr=dict(default=None, required=True), cidr=dict(required=True),
ipv6_cidr=dict(default='', required=False), ipv6_cidr=dict(default='', required=False),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
tags=dict(default={}, required=False, type='dict', aliases=['resource_tags']), tags=dict(default={}, required=False, type='dict', aliases=['resource_tags']),
vpc_id=dict(default=None, required=True), vpc_id=dict(required=True),
map_public=dict(default=False, required=False, type='bool'), map_public=dict(default=False, required=False, type='bool'),
assign_instances_ipv6=dict(default=False, required=False, type='bool'), assign_instances_ipv6=dict(default=False, required=False, type='bool'),
wait=dict(type='bool', default=True), wait=dict(type='bool', default=True),

@ -1,17 +1,9 @@
#!/usr/bin/python #!/usr/bin/python
# #
# This is a free software: you can redistribute it and/or modify # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or from __future__ import (absolute_import, division, print_function)
# (at your option) any later version. __metaclass__ = type
#
# This Ansible library 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 this library. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'], 'status': ['stableinterface'],
@ -35,11 +27,14 @@ options:
description: description:
- A list of subnet IDs to gather information for. - A list of subnet IDs to gather information for.
version_added: "2.5" version_added: "2.5"
aliases: [subnet_id] aliases: ['subnet_id']
type: list
elements: str
filters: filters:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) for possible filters. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) for possible filters.
type: dict
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -28,31 +28,40 @@ options:
- absent to remove resource - absent to remove resource
default: present default: present
choices: [ "present", "absent"] choices: [ "present", "absent"]
type: str
name: name:
description: description:
- name of the vgw to be created or deleted - name of the vgw to be created or deleted
type: str
type: type:
description: description:
- type of the virtual gateway to be created - type of the virtual gateway to be created
choices: [ "ipsec.1" ] choices: [ "ipsec.1" ]
default: "ipsec.1"
type: str
vpn_gateway_id: vpn_gateway_id:
description: description:
- vpn gateway id of an existing virtual gateway - vpn gateway id of an existing virtual gateway
type: str
vpc_id: vpc_id:
description: description:
- the vpc-id of a vpc to attach or detach - the vpc-id of a vpc to attach or detach
type: str
asn: asn:
description: description:
- the BGP ASN of the amazon side - the BGP ASN of the amazon side
version_added: "2.6" version_added: "2.6"
type: int
wait_timeout: wait_timeout:
description: description:
- number of seconds to wait for status during vpc attach and detach - number of seconds to wait for status during vpc attach and detach
default: 320 default: 320
type: int
tags: tags:
description: description:
- dictionary of resource tags - dictionary of resource tags
aliases: [ "resource_tags" ] aliases: [ "resource_tags" ]
type: dict
author: Nick Aslanidis (@naslanidis) author: Nick Aslanidis (@naslanidis)
extends_documentation_fragment: extends_documentation_fragment:
- ec2 - ec2
@ -538,7 +547,6 @@ def main():
argument_spec = ec2_argument_spec() argument_spec = ec2_argument_spec()
argument_spec.update(dict( argument_spec.update(dict(
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
region=dict(required=True),
name=dict(), name=dict(),
vpn_gateway_id=dict(), vpn_gateway_id=dict(),
vpc_id=dict(), vpc_id=dict(),

@ -25,9 +25,12 @@ options:
description: description:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRouteTables.html) for possible filters. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRouteTables.html) for possible filters.
type: dict
vpn_gateway_ids: vpn_gateway_ids:
description: description:
- Get details of a specific Virtual Gateway ID. This value should be provided as a list. - Get details of a specific Virtual Gateway ID. This value should be provided as a list.
type: list
elements: str
author: "Nick Aslanidis (@naslanidis)" author: "Nick Aslanidis (@naslanidis)"
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws

@ -2,6 +2,9 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
@ -27,23 +30,29 @@ options:
choices: ['present', 'absent'] choices: ['present', 'absent']
default: present default: present
required: no required: no
type: str
customer_gateway_id: customer_gateway_id:
description: description:
- The ID of the customer gateway. - The ID of the customer gateway.
type: str
connection_type: connection_type:
description: description:
- The type of VPN connection. - The type of VPN connection.
choices: ['ipsec.1'] - At this time only 'ipsec.1' is supported.
default: ipsec.1 default: ipsec.1
type: str
vpn_gateway_id: vpn_gateway_id:
description: description:
- The ID of the virtual private gateway. - The ID of the virtual private gateway.
type: str
vpn_connection_id: vpn_connection_id:
description: description:
- The ID of the VPN connection. Required to modify or delete a connection if the filters option does not provide a unique match. - The ID of the VPN connection. Required to modify or delete a connection if the filters option does not provide a unique match.
type: str
tags: tags:
description: description:
- Tags to attach to the VPN connection. - Tags to attach to the VPN connection.
type: dict
purge_tags: purge_tags:
description: description:
- Whether or not to delete VPN connections tags that are associated with the connection but not specified in the task. - Whether or not to delete VPN connections tags that are associated with the connection but not specified in the task.
@ -62,6 +71,15 @@ options:
the aforementioned keys. the aforementioned keys.
required: no required: no
version_added: "2.5" version_added: "2.5"
type: list
elements: dict
suboptions:
TunnelInsideCidr:
type: str
description: The range of inside IP addresses for the tunnel.
PreSharedKey:
type: str
description: The pre-shared key (PSK) to establish initial authentication between the virtual private gateway and customer gateway.
filters: filters:
description: description:
- An alternative to using vpn_connection_id. If multiple matches are found, vpn_connection_id is required. - An alternative to using vpn_connection_id. If multiple matches are found, vpn_connection_id is required.
@ -103,9 +121,12 @@ options:
cgw: cgw:
description: description:
- The customer gateway id as a string or a list of those strings. - The customer gateway id as a string or a list of those strings.
type: dict
routes: routes:
description: description:
- Routes to add to the connection. - Routes to add to the connection.
type: list
elements: str
purge_routes: purge_routes:
description: description:
- Whether or not to delete VPN connections routes that are not specified in the task. - Whether or not to delete VPN connections routes that are not specified in the task.
@ -690,7 +711,7 @@ def ensure_present(connection, module_params, check_mode=False):
max_attempts=max_attempts, max_attempts=max_attempts,
delay=delay) delay=delay)
changes = check_for_update(connection, module_params, vpn_connection['VpnConnectionId']) changes = check_for_update(connection, module_params, vpn_connection['VpnConnectionId'])
_ = make_changes(connection, vpn_connection['VpnConnectionId'], changes) make_changes(connection, vpn_connection['VpnConnectionId'], changes)
# get latest version if a change has been made and make tags output nice before returning it # get latest version if a change has been made and make tags output nice before returning it
if vpn_connection: if vpn_connection:

@ -2,6 +2,9 @@
# Copyright: Ansible Project # Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'], ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community', 'supported_by': 'community',
@ -24,10 +27,13 @@ options:
- A dict of filters to apply. Each dict item consists of a filter key and a filter value. - A dict of filters to apply. Each dict item consists of a filter key and a filter value.
See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpnConnections.html) for possible filters. See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpnConnections.html) for possible filters.
required: false required: false
type: dict
vpn_connection_ids: vpn_connection_ids:
description: description:
- Get details of a specific VPN connections using vpn connection ID/IDs. This value should be provided as a list. - Get details of a specific VPN connections using vpn connection ID/IDs. This value should be provided as a list.
required: false required: false
type: list
elements: str
extends_documentation_fragment: extends_documentation_fragment:
- aws - aws
- ec2 - ec2

@ -641,57 +641,6 @@ lib/ansible/modules/cloud/amazon/ec2_vol.py validate-modules:doc-choices-do-not-
lib/ansible/modules/cloud/amazon/ec2_vol.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/cloud/amazon/ec2_vol.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vol.py validate-modules:doc-missing-type lib/ansible/modules/cloud/amazon/ec2_vol.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vol_info.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/cloud/amazon/ec2_vol_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_option.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_option_info.py validate-modules:undocumented-parameter
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_option_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_egress_igw.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_egress_igw.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_egress_igw.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_endpoint_info.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_igw.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_igw.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_igw_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py pylint:blacklisted-name
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_net.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_net.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_net.py validate-modules:return-syntax-error
lib/ansible/modules/cloud/amazon/ec2_vpc_net_info.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_net_info.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_net_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_peering_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_route_table_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet.py validate-modules:no-default-for-required-parameter
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_info.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_info.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py validate-modules:nonexistent-parameter-documented
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py pylint:blacklisted-name
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py validate-modules:doc-choices-do-not-match-spec
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn_info.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn_info.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ec2_vpc_vpn_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_win_password.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/cloud/amazon/ec2_win_password.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_win_password.py validate-modules:doc-missing-type lib/ansible/modules/cloud/amazon/ec2_win_password.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_attribute.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/cloud/amazon/ecs_attribute.py validate-modules:parameter-type-not-in-doc
@ -5893,12 +5842,6 @@ test/units/module_utils/xenserver/FakeAnsibleModule.py future-import-boilerplate
test/units/module_utils/xenserver/FakeAnsibleModule.py metaclass-boilerplate test/units/module_utils/xenserver/FakeAnsibleModule.py metaclass-boilerplate
test/units/module_utils/xenserver/FakeXenAPI.py future-import-boilerplate test/units/module_utils/xenserver/FakeXenAPI.py future-import-boilerplate
test/units/module_utils/xenserver/FakeXenAPI.py metaclass-boilerplate test/units/module_utils/xenserver/FakeXenAPI.py metaclass-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py future-import-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py metaclass-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py pylint:blacklisted-name
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py future-import-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py metaclass-boilerplate
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py pylint:blacklisted-name
test/units/modules/cloud/google/test_gce_tag.py future-import-boilerplate test/units/modules/cloud/google/test_gce_tag.py future-import-boilerplate
test/units/modules/cloud/google/test_gce_tag.py metaclass-boilerplate test/units/modules/cloud/google/test_gce_tag.py metaclass-boilerplate
test/units/modules/cloud/google/test_gcp_forwarding_rule.py future-import-boilerplate test/units/modules/cloud/google/test_gcp_forwarding_rule.py future-import-boilerplate

@ -1,3 +1,8 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest import pytest
import unittest import unittest
@ -85,7 +90,7 @@ class AnsibleEc2VpcNatGatewayFunctions(unittest.TestCase):
def test_get_eip_allocation_id_by_address(self): def test_get_eip_allocation_id_by_address(self):
client = boto3.client('ec2', region_name=aws_region) client = boto3.client('ec2', region_name=aws_region)
allocation_id, _ = ( allocation_id, error_msg = (
ng.get_eip_allocation_id_by_address( ng.get_eip_allocation_id_by_address(
client, '55.55.55.55', check_mode=True client, '55.55.55.55', check_mode=True
) )
@ -114,7 +119,7 @@ class AnsibleEc2VpcNatGatewayFunctions(unittest.TestCase):
def test_release_address(self): def test_release_address(self):
client = boto3.client('ec2', region_name=aws_region) client = boto3.client('ec2', region_name=aws_region)
success, _ = ( success, err_msg = (
ng.release_address( ng.release_address(
client, 'eipalloc-1234567', check_mode=True client, 'eipalloc-1234567', check_mode=True
) )
@ -173,7 +178,7 @@ class AnsibleEc2VpcNatGatewayFunctions(unittest.TestCase):
def test_delete(self): def test_delete(self):
client = boto3.client('ec2', region_name=aws_region) client = boto3.client('ec2', region_name=aws_region)
success, changed, err_msg, _ = ( success, changed, err_msg, results = (
ng.remove( ng.remove(
client, 'nat-123456789', check_mode=True client, 'nat-123456789', check_mode=True
) )
@ -183,7 +188,7 @@ class AnsibleEc2VpcNatGatewayFunctions(unittest.TestCase):
def test_delete_and_release_ip(self): def test_delete_and_release_ip(self):
client = boto3.client('ec2', region_name=aws_region) client = boto3.client('ec2', region_name=aws_region)
success, changed, err_msg, _ = ( success, changed, err_msg, results = (
ng.remove( ng.remove(
client, 'nat-123456789', release_eip=True, check_mode=True client, 'nat-123456789', release_eip=True, check_mode=True
) )
@ -193,7 +198,7 @@ class AnsibleEc2VpcNatGatewayFunctions(unittest.TestCase):
def test_delete_if_does_not_exist(self): def test_delete_if_does_not_exist(self):
client = boto3.client('ec2', region_name=aws_region) client = boto3.client('ec2', region_name=aws_region)
success, changed, err_msg, _ = ( success, changed, err_msg, results = (
ng.remove( ng.remove(
client, 'nat-12345', check_mode=True client, 'nat-12345', check_mode=True
) )

@ -1,19 +1,8 @@
# (c) 2017 Red Hat Inc. # (c) 2017 Red Hat Inc.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
# from __future__ import (absolute_import, division, print_function)
# Ansible is free software: you can redistribute it and/or modify __metaclass__ = type
# 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/>.
import pytest import pytest
import os import os
@ -165,8 +154,8 @@ def test_find_connection_insufficient_filters(placeboify, maybe_sleep):
params2 = make_params(cgw[1], vgw[1], tags={'Correct': 'Tag'}) params2 = make_params(cgw[1], vgw[1], tags={'Correct': 'Tag'})
m, conn = setup_mod_conn(placeboify, params) m, conn = setup_mod_conn(placeboify, params)
m2, conn2 = setup_mod_conn(placeboify, params2) m2, conn2 = setup_mod_conn(placeboify, params2)
_, vpn1 = ec2_vpc_vpn.ensure_present(conn, m.params) vpn1 = ec2_vpc_vpn.ensure_present(conn, m.params)[1]
_, vpn2 = ec2_vpc_vpn.ensure_present(conn2, m2.params) vpn2 = ec2_vpc_vpn.ensure_present(conn2, m2.params)[1]
# reset the parameters so only filtering by tags will occur # reset the parameters so only filtering by tags will occur
m.params = {'filters': {'tags': {'Correct': 'Tag'}}} m.params = {'filters': {'tags': {'Correct': 'Tag'}}}
@ -354,7 +343,7 @@ def setup_req(placeboify, number_of_results=1):
for each in range(0, number_of_results): for each in range(0, number_of_results):
params = make_params(cgw[each], vgw[each]) params = make_params(cgw[each], vgw[each])
m, conn = setup_mod_conn(placeboify, params) m, conn = setup_mod_conn(placeboify, params)
_, vpn = ec2_vpc_vpn.ensure_present(conn, params) vpn = ec2_vpc_vpn.ensure_present(conn, params)[1]
results.append({'module': m, 'connection': conn, 'vpn': vpn, 'params': params}) results.append({'module': m, 'connection': conn, 'vpn': vpn, 'params': params})
if number_of_results == 1: if number_of_results == 1:

Loading…
Cancel
Save