diff --git a/tests/integration/targets/ec2_vpc_vpn_info/tasks/main.yml b/tests/integration/targets/ec2_vpc_vpn_info/tasks/main.yml index 1d432a1740e..a36e21611e6 100644 --- a/tests/integration/targets/ec2_vpc_vpn_info/tasks/main.yml +++ b/tests/integration/targets/ec2_vpc_vpn_info/tasks/main.yml @@ -1,26 +1,21 @@ --- -- name: ec2_vpc_vpn_info tests +- name: 'ec2_vpc_vpn_info integration tests' collections: - amazon.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' block: - # ============================================================ - - 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.0.0.0/26" - <<: *aws_connection_info tags: Name: "{{ resource_prefix }}-vpc" Description: "Created by ansible-test" @@ -31,7 +26,6 @@ state: present vpc_id: '{{ vpc_result.vpc.id }}' name: "{{ resource_prefix }}-vgw" - <<: *aws_connection_info register: vgw - name: create customer gateway @@ -39,7 +33,6 @@ bgp_asn: 12345 ip_address: 1.2.3.4 name: testcgw - <<: *aws_connection_info register: cgw - name: create vpn connection, with customer gateway @@ -47,13 +40,11 @@ customer_gateway_id: '{{ cgw.gateway.customer_gateway.customer_gateway_id }}' vpn_gateway_id: '{{ vgw.vgw.id }}' state: present - <<: *aws_connection_info register: vpn # ============================================================ - name: test success with no parameters ec2_vpc_vpn_info: - <<: *aws_connection_info register: result - name: assert success with no parameters @@ -67,7 +58,6 @@ filters: customer-gateway-id: '{{ cgw.gateway.customer_gateway.customer_gateway_id }}' vpn-connection-id: '{{ vpn.vpn_connection_id }}' - <<: *aws_connection_info register: result - name: assert success with customer gateway id as filter @@ -83,7 +73,6 @@ ec2_vpc_vpn: state: absent vpn_connection_id: '{{ vpn.vpn_connection_id }}' - <<: *aws_connection_info register: result retries: 10 delay: 3 @@ -96,7 +85,6 @@ ip_address: 1.2.3.4 name: testcgw bgp_asn: 12345 - <<: *aws_connection_info register: result retries: 10 delay: 3 @@ -107,7 +95,6 @@ ec2_vpc_vgw: state: absent vpn_gateway_id: '{{ vgw.vgw.id }}' - <<: *aws_connection_info register: result retries: 10 delay: 3 @@ -119,7 +106,6 @@ name: "{{ resource_prefix }}-vpc" state: absent cidr_block: "10.0.0.0/26" - <<: *aws_connection_info register: result retries: 10 delay: 3