ansible/test/integration/targets/ec2_vpc_subnet/tasks/main.yml

683 lines
23 KiB
YAML
Raw Normal View History

---
# A Note about ec2 environment variable name preference:
# - EC2_URL -> AWS_URL
# - EC2_ACCESS_KEY -> AWS_ACCESS_KEY_ID -> AWS_ACCESS_KEY
# - EC2_SECRET_KEY -> AWS_SECRET_ACCESS_KEY -> AWX_SECRET_KEY
# - EC2_REGION -> AWS_REGION
#
# - include: ../../setup_ec2/tasks/common.yml module_name: ec2_vpc_subnet
- block:
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
- name: set up aws connection info
set_fact:
aws_connection_info: &aws_connection_info
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
security_token: "{{ security_token }}"
region: "{{ aws_region }}"
no_log: yes
# ============================================================
- name: create a VPC
ec2_vpc_net:
name: "{{ resource_prefix }}-vpc"
state: present
cidr_block: "10.232.232.128/26"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
tags:
Name: "{{ resource_prefix }}-vpc"
Description: "Created by ansible-test"
register: vpc_result
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: create subnet (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
<<: *aws_connection_info
state: present
check_mode: true
register: vpc_subnet_create
- name: assert creation would happen
assert:
that:
- vpc_subnet_create.changed
- name: create subnet (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
state: present
register: vpc_subnet_create
- name: assert creation happened (expected changed=true)
assert:
that:
- 'vpc_subnet_create'
- 'vpc_subnet_create.subnet.id.startswith("subnet-")'
- '"Name" in vpc_subnet_create.subnet.tags and vpc_subnet_create.subnet.tags["Name"] == ec2_vpc_subnet_name'
- '"Description" in vpc_subnet_create.subnet.tags and vpc_subnet_create.subnet.tags["Description"] == ec2_vpc_subnet_description'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: recreate subnet (expected changed=false) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
<<: *aws_connection_info
state: present
check_mode: true
register: vpc_subnet_recreate
- name: assert recreation changed nothing (expected changed=false)
assert:
that:
- 'not vpc_subnet_recreate.changed'
- name: recreate subnet (expected changed=false)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
state: present
register: vpc_subnet_recreate
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: assert recreation changed nothing (expected changed=false)
assert:
that:
- 'not vpc_subnet_recreate.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- 'vpc_subnet_recreate.subnet == vpc_subnet_create.subnet'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: update subnet so instances launched in it are assigned an IP (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
<<: *aws_connection_info
state: present
map_public: true
check_mode: true
register: vpc_subnet_modify
- name: assert subnet changed
assert:
that:
- vpc_subnet_modify.changed
- name: update subnet so instances launched in it are assigned an IP
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
<<: *aws_connection_info
state: present
map_public: true
register: vpc_subnet_modify
- name: assert subnet changed
assert:
that:
- vpc_subnet_modify.changed
- vpc_subnet_modify.subnet.map_public_ip_on_launch
# ============================================================
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: add invalid ipv6 block to subnet (expected failed)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
az: "{{ aws_region }}a"
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: 2001:db8::/64
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
state: present
register: vpc_subnet_ipv6_failed
ignore_errors: yes
- name: assert failure happened (expected failed)
assert:
that:
- 'vpc_subnet_ipv6_failed.failed'
- "'Couldn\\'t associate ipv6 cidr' in vpc_subnet_ipv6_failed.msg"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: add a tag (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
AnotherTag: SomeValue
<<: *aws_connection_info
state: present
check_mode: true
register: vpc_subnet_add_a_tag
- name: assert tag addition happened (expected changed=true)
assert:
that:
- 'vpc_subnet_add_a_tag.changed'
- name: add a tag (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
AnotherTag: SomeValue
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
state: present
register: vpc_subnet_add_a_tag
- name: assert tag addition happened (expected changed=true)
assert:
that:
- 'vpc_subnet_add_a_tag.changed'
- '"Name" in vpc_subnet_add_a_tag.subnet.tags and vpc_subnet_add_a_tag.subnet.tags["Name"] == ec2_vpc_subnet_name'
- '"Description" in vpc_subnet_add_a_tag.subnet.tags and vpc_subnet_add_a_tag.subnet.tags["Description"] == ec2_vpc_subnet_description'
- '"AnotherTag" in vpc_subnet_add_a_tag.subnet.tags and vpc_subnet_add_a_tag.subnet.tags["AnotherTag"] == "SomeValue"'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: remove tags with default purge_tags=true (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
AnotherTag: SomeValue
<<: *aws_connection_info
state: present
check_mode: true
register: vpc_subnet_remove_tags
- name: assert tag removal happened (expected changed=true)
assert:
that:
- 'vpc_subnet_remove_tags.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: remove tags with default purge_tags=true (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
AnotherTag: SomeValue
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
state: present
register: vpc_subnet_remove_tags
- name: assert tag removal happened (expected changed=true)
assert:
that:
- 'vpc_subnet_remove_tags.changed'
- '"Name" not in vpc_subnet_remove_tags.subnet.tags'
- '"Description" not in vpc_subnet_remove_tags.subnet.tags'
- '"AnotherTag" in vpc_subnet_remove_tags.subnet.tags and vpc_subnet_remove_tags.subnet.tags["AnotherTag"] == "SomeValue"'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: change tags with purge_tags=false (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
az: "{{ aws_region }}a"
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
<<: *aws_connection_info
state: present
purge_tags: false
check_mode: true
register: vpc_subnet_change_tags
- name: assert tag addition happened (expected changed=true)
assert:
that:
- 'vpc_subnet_change_tags.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: change tags with purge_tags=false (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
az: "{{ aws_region }}a"
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
state: present
purge_tags: false
register: vpc_subnet_change_tags
- name: assert tag addition happened (expected changed=true)
assert:
that:
- 'vpc_subnet_change_tags.changed'
- '"Name" in vpc_subnet_change_tags.subnet.tags and vpc_subnet_change_tags.subnet.tags["Name"] == ec2_vpc_subnet_name'
- '"Description" in vpc_subnet_change_tags.subnet.tags and vpc_subnet_change_tags.subnet.tags["Description"] == ec2_vpc_subnet_description'
- '"AnotherTag" in vpc_subnet_change_tags.subnet.tags and vpc_subnet_change_tags.subnet.tags["AnotherTag"] == "SomeValue"'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: test state=absent (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: absent
<<: *aws_connection_info
check_mode: true
register: result
- name: assert state=absent (expected changed=true)
assert:
that:
- 'result.changed'
- name: test state=absent (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: absent
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
register: result
- name: assert state=absent (expected changed=true)
assert:
that:
- 'result.changed'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: test state=absent (expected changed=false) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: absent
<<: *aws_connection_info
check_mode: true
register: result
- name: assert state=absent (expected changed=false)
assert:
that:
- 'not result.changed'
- name: test state=absent (expected changed=false)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: absent
<<: *aws_connection_info
register: result
- name: assert state=absent (expected changed=false)
assert:
that:
- 'not result.changed'
# ============================================================
- name: create subnet without AZ (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: present
<<: *aws_connection_info
check_mode: true
register: subnet_without_az
- name: check that subnet without AZ works fine
assert:
that:
- 'subnet_without_az.changed'
- name: create subnet without AZ
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: present
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
register: subnet_without_az
- name: check that subnet without AZ works fine
assert:
that:
- 'subnet_without_az.changed'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: remove subnet without AZ (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: absent
<<: *aws_connection_info
check_mode: true
register: result
- name: assert state=absent (expected changed=true)
assert:
that:
- 'result.changed'
- name: remove subnet without AZ
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: absent
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
register: result
- name: assert state=absent (expected changed=true)
assert:
that:
- 'result.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
# FIXME - Replace by creating IPv6 enabled VPC once ec2_vpc_net module supports it.
- name: install aws cli - FIXME temporary this should go for a lighterweight solution
command: pip install awscli
- name: Assign an Amazon provided IPv6 CIDR block to the VPC
command: aws ec2 associate-vpc-cidr-block --amazon-provided-ipv6-cidr-block --vpc-id '{{ vpc_result.vpc.id }}'
environment:
AWS_ACCESS_KEY_ID: '{{aws_access_key}}'
AWS_SECRET_ACCESS_KEY: '{{aws_secret_key}}'
AWS_SESSION_TOKEN: '{{security_token}}'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
AWS_DEFAULT_REGION: '{{aws_region}}'
- name: wait for the IPv6 CIDR to be assigned
command: sleep 5
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: Get the assigned IPv6 CIDR
command: aws ec2 describe-vpcs --vpc-ids '{{ vpc_result.vpc.id }}'
environment:
AWS_ACCESS_KEY_ID: '{{aws_access_key}}'
AWS_SECRET_ACCESS_KEY: '{{aws_secret_key}}'
AWS_SESSION_TOKEN: '{{security_token}}'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
AWS_DEFAULT_REGION: '{{aws_region}}'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
register: vpc_ipv6
- set_fact:
vpc_ipv6_cidr: "{{ vpc_ipv6.stdout | from_json | json_query('Vpcs[0].Ipv6CidrBlockAssociationSet[0].Ipv6CidrBlock') }}"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: create subnet with IPv6 (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: "{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}"
assign_instances_ipv6: true
state: present
<<: *aws_connection_info
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
check_mode: true
register: vpc_subnet_ipv6_create
- name: assert creation with IPv6 happened (expected changed=true)
assert:
that:
- 'vpc_subnet_ipv6_create.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: create subnet with IPv6 (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: "{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}"
assign_instances_ipv6: true
state: present
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
register: vpc_subnet_ipv6_create
- name: assert creation with IPv6 happened (expected changed=true)
assert:
that:
- 'vpc_subnet_ipv6_create'
- 'vpc_subnet_ipv6_create.subnet.id.startswith("subnet-")'
- "vpc_subnet_ipv6_create.subnet.ipv6_cidr_block == '{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}'"
- '"Name" in vpc_subnet_ipv6_create.subnet.tags and vpc_subnet_ipv6_create.subnet.tags["Name"] == ec2_vpc_subnet_name'
- '"Description" in vpc_subnet_ipv6_create.subnet.tags and vpc_subnet_ipv6_create.subnet.tags["Description"] == ec2_vpc_subnet_description'
- 'vpc_subnet_ipv6_create.subnet.assign_ipv6_address_on_creation'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: recreate subnet (expected changed=false) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: "{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}"
assign_instances_ipv6: true
<<: *aws_connection_info
state: present
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
check_mode: true
register: vpc_subnet_ipv6_recreate
- name: assert recreation changed nothing (expected changed=false)
assert:
that:
- 'not vpc_subnet_ipv6_recreate.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: recreate subnet (expected changed=false)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: "{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}"
assign_instances_ipv6: true
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
state: present
tags:
Name: '{{ec2_vpc_subnet_name}}'
Description: '{{ec2_vpc_subnet_description}}'
register: vpc_subnet_ipv6_recreate
- name: assert recreation changed nothing (expected changed=false)
assert:
that:
- 'not vpc_subnet_ipv6_recreate.changed'
- 'vpc_subnet_ipv6_recreate.subnet == vpc_subnet_ipv6_create.subnet'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: change subnet ipv6 attribute (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: "{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}"
assign_instances_ipv6: false
<<: *aws_connection_info
state: present
purge_tags: false
check_mode: true
register: vpc_change_attribute
- name: assert assign_instances_ipv6 attribute changed (expected changed=true)
assert:
that:
- 'vpc_change_attribute.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: change subnet ipv6 attribute (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: "{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}"
assign_instances_ipv6: false
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
state: present
purge_tags: false
register: vpc_change_attribute
- name: assert assign_instances_ipv6 attribute changed (expected changed=true)
assert:
that:
- 'vpc_change_attribute.changed'
- 'not vpc_change_attribute.subnet.assign_ipv6_address_on_creation'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: add second subnet with duplicate ipv6 cidr (expected failure)
ec2_vpc_subnet:
cidr: "10.232.232.144/28"
vpc_id: "{{ vpc_result.vpc.id }}"
ipv6_cidr: "{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
state: present
purge_tags: false
register: vpc_add_duplicate_ipv6
ignore_errors: true
- name: assert graceful failure (expected failed)
assert:
that:
- 'vpc_add_duplicate_ipv6.failed'
- "'The IPv6 CIDR \\'{{ vpc_ipv6_cidr | regex_replace('::/56', '::/64') }}\\' conflicts with another subnet' in vpc_add_duplicate_ipv6.msg"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: remove subnet ipv6 cidr (expected changed=true) (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
<<: *aws_connection_info
state: present
purge_tags: false
check_mode: true
register: vpc_remove_ipv6_cidr
- name: assert subnet ipv6 cidr removed (expected changed=true)
assert:
that:
- 'vpc_remove_ipv6_cidr.changed'
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
- name: remove subnet ipv6 cidr (expected changed=true)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
[cloud] Add IPv6 support for ec2_vpc_subnet module(#30444) * Add integration test suite for ec2_vpc_subnet * wrap boto3 connection in try/except update module documentation and add RETURN docs add IPv6 support to VPC subnet module rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed add wait and timeout for subnet creation process fixup the ipv6 cidr disassociation logic a bit per review update RETURN values per review added module parameter check removed DryRun parameter from boto3 call since it would always be false here fix subnet wait loop add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func fix tags type error per review remove **kwargs use in create_subnet function per review * rebased on #31870, fixed merge conflicts, and updated error messages * fixes to pass tests * add test for failure on invalid ipv6 block and update tags test for purge_tags=true function * fix pylint issue * fix exception handling error when run with python3 * add ipv6 tests and fix module code * Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets * fix type in tests and update assert conditional to check entire returned value * add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI * remove key and value options from call to boto3_tag_list_to_ansible_dict * remove wait loop and use boto3 EC2 waiter * remove unused register: result vars * revert az argument default value to original setting default=None
2017-11-16 19:58:12 +00:00
state: present
purge_tags: false
register: vpc_remove_ipv6_cidr
- name: assert subnet ipv6 cidr removed (expected changed=true)
assert:
that:
- 'vpc_remove_ipv6_cidr.changed'
- "vpc_remove_ipv6_cidr.subnet.ipv6_cidr_block == ''"
- 'not vpc_remove_ipv6_cidr.subnet.assign_ipv6_address_on_creation'
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
# ============================================================
- name: test adding a tag that looks like a boolean to the subnet (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: present
purge_tags: false
tags:
looks_like_boolean: true
<<: *aws_connection_info
check_mode: true
register: vpc_subnet_info
- name: assert a tag was added
assert:
that:
- 'vpc_subnet_info.changed'
- name: test adding a tag that looks like a boolean to the subnet
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: present
purge_tags: false
tags:
looks_like_boolean: true
<<: *aws_connection_info
register: vpc_subnet_info
- name: assert a tag was added
assert:
that:
- 'vpc_subnet_info.changed'
- 'vpc_subnet_info.subnet.tags.looks_like_boolean == "True"'
# ============================================================
- name: test idempotence adding a tag that looks like a boolean (CHECK MODE)
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: present
purge_tags: false
tags:
looks_like_boolean: true
<<: *aws_connection_info
check_mode: true
register: vpc_subnet_info
- name: assert a tag was added
assert:
that:
- 'not vpc_subnet_info.changed'
- name: test idempotence adding a tag that looks like a boolean
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: present
purge_tags: false
tags:
looks_like_boolean: true
<<: *aws_connection_info
register: vpc_subnet_info
- name: assert a tag was added
assert:
that:
- 'not vpc_subnet_info.changed'
always:
################################################
# TEARDOWN STARTS HERE
################################################
- name: tidy up subnet
ec2_vpc_subnet:
cidr: "10.232.232.128/28"
vpc_id: "{{ vpc_result.vpc.id }}"
state: absent
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info
- name: tidy up VPC
ec2_vpc_net:
name: "{{ resource_prefix }}-vpc"
state: absent
cidr_block: "10.232.232.128/26"
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440) * [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975) * Stabilize ec2_vpc_route_table Wait for route table to be present before attempting to use it Sleep before getting the final state of the route table in case modifications are incomplete * Conditionally wait if changes were made * Simplify logic (cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef) * Route custom waiter (#36922) This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet. The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code. (cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237) * Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) (cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629) * [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534) * stabilize ec2_vpc_subnet module * Add waiters for ec2_vpc_subnet Clean up integration tests * Reenable CI for stabilized ec2_vpc_subnet tests * rename waiters * Use module_json_aws where applicable Handle WaiterError first if waiting failed * Fix traceback when tagging with keys/values that look like booleans * Fix check mode with tags * Add integration tests for tags that look like booleans and check mode * Add waiter for deleting subnet * Sleep a few seconds after using aws command line (cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269) * Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) (cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac) * [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171) Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter (cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c) * [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) (cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e) * changelog
2018-05-15 18:51:43 +00:00
<<: *aws_connection_info