From ea3ffeaab796cdcb050aeb8ce20850b40d7942a9 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Tue, 12 Sep 2023 07:37:30 +0200 Subject: [PATCH] Cleanup after renamed plugins (#1940) Cleanup after renamed plugins SUMMARY Prior to 5.0.0 we renamed various modules. Cleanup the integration tests (and some docs). ISSUE TYPE Docs Pull Request COMPONENT NAME plugins/modules/acm_certificate.py plugins/modules/acm_certificate_info.py plugins/modules/autoscaling_policy.py plugins/modules/codepipeline.py plugins/modules/storagegateway_info.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis (cherry picked from commit c2fead07d8bd121a399ebcddc65421a6d81a1c8e) --- .../fragments/20230908-alias-cleanup.yml | 2 + plugins/modules/acm_certificate.py | 12 +- plugins/modules/acm_certificate_info.py | 10 +- plugins/modules/autoscaling_policy.py | 6 +- plugins/modules/codepipeline.py | 2 +- plugins/modules/storagegateway_info.py | 4 +- .../acm_certificate/tasks/full_acm_test.yml | 70 ++++---- .../targets/acm_certificate/tasks/main.yml | 68 ++++---- .../targets/api_gateway_domain/tasks/main.yml | 14 +- .../tasks/env_cleanup.yml | 6 +- .../tasks/env_setup.yml | 6 +- .../tasks/main.yml | 1 + .../tasks/tests.yml | 16 +- .../tasks/main.yml | 64 +++---- .../tasks/refresh_and_cancel_three_times.yml | 6 +- .../tasks/env_cleanup.yml | 2 +- .../tasks/env_setup.yml | 2 +- .../autoscaling_launch_config/tasks/main.yml | 38 ++--- .../autoscaling_lifecycle_hook/main.yml | 50 +++--- .../autoscaling_lifecycle_hook/meta/main.yml | 1 + .../tasks/create_update_delete.yml | 75 ++++---- .../tasks/env_cleanup.yml | 57 ++++--- .../tasks/env_setup.yml | 22 +-- .../ec2_asg_lifecycle_hook/tasks/main.yml | 28 ++- .../targets/autoscaling_policy/tasks/main.yml | 40 ++--- .../tasks/main.yml | 36 ++-- .../codebuild_project/tasks/description.yml | 22 +-- .../targets/codebuild_project/tasks/main.yml | 6 +- .../codebuild_project/tasks/tagging.yml | 38 ++--- .../codecommit_repository/tasks/main.yml | 24 +-- .../targets/codepipeline/tasks/main.yml | 8 +- .../targets/config/tasks/main.yaml | 56 +++--- .../tasks/tags_and_vpc_settings.yml | 4 +- .../ec2_placement_group/tasks/env_cleanup.yml | 2 +- .../ec2_placement_group/tasks/env_setup.yml | 2 +- .../tasks/01_create_requirements.yml | 2 +- .../tasks/99_terminate_everything.yml | 2 +- .../targets/ecs_ecr/tasks/main.yml | 4 +- tests/integration/targets/efs/tasks/main.yml | 2 +- .../targets/eks_cluster/tasks/full_test.yml | 30 ++-- .../tasks/cleanup_eks_cluster.yml | 6 +- .../tasks/create_eks_cluster.yml | 4 +- .../targets/eks_nodegroup/tasks/cleanup.yml | 6 +- .../eks_nodegroup/tasks/dependecies.yml | 4 +- .../targets/elasticache/tasks/main.yml | 4 +- .../elasticbeanstalk_app/tasks/main.yml | 20 +-- .../elb_instance/tasks/cleanup_instances.yml | 4 +- .../elb_instance/tasks/cleanup_vpc.yml | 2 +- .../elb_instance/tasks/manage_asgs.yml | 2 +- .../elb_instance/tasks/setup_instances.yml | 4 +- .../targets/elb_instance/tasks/setup_vpc.yml | 4 +- .../targets/elb_network_lb/tasks/main.yml | 4 +- .../tasks/test_nlb_with_asg.yml | 12 +- .../targets/elb_target/tasks/alb_target.yml | 4 +- .../targets/elb_target/tasks/ec2_target.yml | 4 +- .../targets/elb_target_info/tasks/main.yml | 4 +- .../tasks/test_connection_jdbc.yml | 12 +- .../tasks/test_connection_network.yml | 26 +-- .../targets/glue_crawler/tasks/main.yml | 18 +- .../targets/glue_job/tasks/main.yml | 18 +- .../targets/inspector_target/tasks/main.yml | 12 +- .../targets/kinesis_stream/tasks/main.yml | 6 +- .../targets/mq/tasks/env_cleanup.yml | 2 +- .../targets/mq/tasks/env_setup.yml | 2 +- .../targets/msk_cluster-auth/tasks/main.yml | 6 +- .../tasks/test_create_auth.yml | 8 +- .../targets/msk_cluster/tasks/main.yml | 6 +- .../targets/msk_cluster/tasks/test_create.yml | 6 +- .../targets/msk_cluster/tasks/test_delete.yml | 6 +- .../targets/msk_cluster/tasks/test_update.yml | 6 +- .../targets/msk_config/tasks/main.yml | 20 +-- .../opensearch/tasks/test_create_cert.yml | 2 +- .../tasks/test_delete_resources.yml | 6 +- .../tasks/test_delete_vpc_resources.yml | 4 +- .../opensearch/tasks/test_vpc_setup.yml | 4 +- .../targets/s3_bucket_info/tasks/basic.yml | 4 +- .../tasks/bucket_ownership_controls.yml | 4 +- .../targets/s3_sync/tasks/main.yml | 12 +- .../secretsmanager_secret/tasks/basic.yml | 76 ++++----- .../tasks/replication.yml | 14 +- .../secretsmanager_secret/tasks/rotation.yml | 12 +- .../targets/ses_identity/tasks/main.yaml | 94 +++++----- .../ses_identity_policy/tasks/main.yaml | 54 +++--- .../tasks/active-rule-set-tests.yaml | 70 ++++---- .../tasks/inactive-rule-set-tests.yaml | 32 ++-- .../tasks/cleanup.yml | 2 +- .../tasks/encryption.yml | 2 +- .../targets/setup_ec2_facts/defaults/main.yml | 11 +- .../targets/setup_ec2_facts/meta/main.yml | 1 + .../targets/setup_ec2_facts/tasks/main.yml | 69 ++++---- .../targets/ssm_parameter/tasks/main.yml | 156 ++++++++--------- .../tasks/main.yml | 40 ++--- .../targets/waf_web_acl/tasks/main.yml | 160 +++++++++--------- tests/integration/targets/wafv2/tasks/alb.yml | 2 +- .../integration/targets/wafv2/tasks/main.yml | 2 +- 95 files changed, 959 insertions(+), 956 deletions(-) create mode 100644 changelogs/fragments/20230908-alias-cleanup.yml diff --git a/changelogs/fragments/20230908-alias-cleanup.yml b/changelogs/fragments/20230908-alias-cleanup.yml new file mode 100644 index 00000000000..b54cc42242e --- /dev/null +++ b/changelogs/fragments/20230908-alias-cleanup.yml @@ -0,0 +1,2 @@ +trivial: +- Update integration tests to reflect renamed plugins diff --git a/plugins/modules/acm_certificate.py b/plugins/modules/acm_certificate.py index 4bf07f0321a..204dbecb03d 100644 --- a/plugins/modules/acm_certificate.py +++ b/plugins/modules/acm_certificate.py @@ -167,14 +167,14 @@ EXAMPLES = r""" - name: upload a self-signed certificate - community.aws.aws_acm: + community.aws.acm_certificate: certificate: "{{ lookup('file', 'cert.pem' ) }}" privateKey: "{{ lookup('file', 'key.pem' ) }}" name_tag: my_cert # to be applied through an AWS tag as "Name":"my_cert" region: ap-southeast-2 # AWS region - name: create/update a certificate with a chain - community.aws.aws_acm: + community.aws.acm_certificate: certificate: "{{ lookup('file', 'cert.pem' ) }}" private_key: "{{ lookup('file', 'key.pem' ) }}" name_tag: my_cert @@ -188,25 +188,25 @@ var: cert_create.certificate.arn - name: delete the cert we just created - community.aws.aws_acm: + community.aws.acm_certificate: name_tag: my_cert state: absent region: ap-southeast-2 - name: delete a certificate with a particular ARN - community.aws.aws_acm: + community.aws.acm_certificate: certificate_arn: "arn:aws:acm:ap-southeast-2:123456789012:certificate/01234567-abcd-abcd-abcd-012345678901" state: absent region: ap-southeast-2 - name: delete all certificates with a particular domain name - community.aws.aws_acm: + community.aws.acm_certificate: domain_name: acm.ansible.com state: absent region: ap-southeast-2 - name: add tags to an existing certificate with a particular ARN - community.aws.aws_acm: + community.aws.acm_certificate: certificate_arn: "arn:aws:acm:ap-southeast-2:123456789012:certificate/01234567-abcd-abcd-abcd-012345678901" tags: Name: my_certificate diff --git a/plugins/modules/acm_certificate_info.py b/plugins/modules/acm_certificate_info.py index 420cd0e0f92..26d00e7e319 100644 --- a/plugins/modules/acm_certificate_info.py +++ b/plugins/modules/acm_certificate_info.py @@ -48,19 +48,19 @@ EXAMPLES = r""" - name: obtain all ACM certificates - community.aws.aws_acm_info: + community.aws.acm_certificate_info: - name: obtain all information for a single ACM certificate - community.aws.aws_acm_info: + community.aws.acm_certificate_info: domain_name: "*.example_com" - name: obtain all certificates pending validation - community.aws.aws_acm_info: + community.aws.acm_certificate_info: statuses: - PENDING_VALIDATION - name: obtain all certificates with tag Name=foo and myTag=bar - community.aws.aws_acm_info: + community.aws.acm_certificate_info: tags: Name: foo myTag: bar @@ -68,7 +68,7 @@ # The output is still a list of certificates, just one item long. - name: obtain information about a certificate with a particular ARN - community.aws.aws_acm_info: + community.aws.acm_certificate_info: certificate_arn: "arn:aws:acm:ap-southeast-2:123456789012:certificate/abcdeabc-abcd-1234-4321-abcdeabcde12" """ diff --git a/plugins/modules/autoscaling_policy.py b/plugins/modules/autoscaling_policy.py index 67f7ccbd54b..6d69d849226 100644 --- a/plugins/modules/autoscaling_policy.py +++ b/plugins/modules/autoscaling_policy.py @@ -223,7 +223,7 @@ asg_name: "application-asg" - name: create TargetTracking predefined policy - ec2_scaling_policy: + community.aws.autoscaling_policy: name: "predefined-policy-1" policy_type: TargetTrackingScaling target_tracking_config: @@ -234,7 +234,7 @@ register: result - name: create TargetTracking predefined policy with resource_label - ec2_scaling_policy: + community.aws.autoscaling_policy: name: "predefined-policy-1" policy_type: TargetTrackingScaling target_tracking_config: @@ -246,7 +246,7 @@ register: result - name: create TargetTrackingScaling custom policy - ec2_scaling_policy: + community.aws.autoscaling_policy: name: "custom-policy-1" policy_type: TargetTrackingScaling target_tracking_config: diff --git a/plugins/modules/codepipeline.py b/plugins/modules/codepipeline.py index 9fb42643df4..b1fe604768f 100644 --- a/plugins/modules/codepipeline.py +++ b/plugins/modules/codepipeline.py @@ -81,7 +81,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Example for creating a pipeline for continuous deploy of Github code to an ECS cluster (container) -- community.aws.aws_codepipeline: +- community.aws.codepipeline: name: my_deploy_pipeline role_arn: arn:aws:iam::123456:role/AWS-CodePipeline-Service artifact_store: diff --git a/plugins/modules/storagegateway_info.py b/plugins/modules/storagegateway_info.py index 5ff72399786..55b7c4685d4 100644 --- a/plugins/modules/storagegateway_info.py +++ b/plugins/modules/storagegateway_info.py @@ -165,10 +165,10 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: "Get AWS storage gateway information" - community.aws.aws_sgw_info: + community.aws.storagegateway_info: - name: "Get AWS storage gateway information for region eu-west-3" - community.aws.aws_sgw_info: + community.aws.storagegateway_info: region: eu-west-3 """ diff --git a/tests/integration/targets/acm_certificate/tasks/full_acm_test.yml b/tests/integration/targets/acm_certificate/tasks/full_acm_test.yml index 1a19e2a395f..4c45db05e6d 100644 --- a/tests/integration/targets/acm_certificate/tasks/full_acm_test.yml +++ b/tests/integration/targets/acm_certificate/tasks/full_acm_test.yml @@ -7,10 +7,10 @@ session_token: '{{ security_token | default(omit) }}' block: - name: list certs - aws_acm_info: null + acm_certificate_info: null register: list_all - name: list certs with check mode - aws_acm_info: null + acm_certificate_info: null register: list_all_check check_mode: yes # read-only task, should work the same as with no - name: check certificate listing worked @@ -20,12 +20,12 @@ - list_all_check.certificates is defined - list_all.certificates == list_all_check.certificates - name: ensure absent cert which doesn't exist - first time - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' state: absent with_items: '{{ local_certs }}' - name: ensure absent cert which doesn't exist - second time - aws_acm: + acm_certificate: name_tag: '{{ item[0].name }}' state: absent check_mode: '{{ item[1] }}' @@ -39,7 +39,7 @@ - not item.changed with_items: "{{ absent_start_two.results }}" - name: list cert which shouldn't exist - aws_acm_info: + acm_certificate_info: tags: Name: '{{ item.name }}' register: list_tag @@ -75,7 +75,7 @@ privatekey_path: '{{ item.priv_key }}' selfsigned_digest: sha256 - name: upload certificate with check mode - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' certificate: '{{ lookup(''file'', item.cert ) }}' private_key: '{{ lookup(''file'', item.priv_key ) }}' @@ -84,7 +84,7 @@ register: upload_check with_items: '{{ local_certs }}' - name: check whether cert was uploaded in check mode - aws_acm_info: + acm_certificate_info: tags: Name: '{{ item.name }}' register: list_after_check_mode_upload @@ -96,7 +96,7 @@ - upload_check.changed - (item.certificates | length) == 0 - name: upload certificates first time - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' certificate: '{{ lookup(''file'', item.cert ) }}' private_key: '{{ lookup(''file'', item.priv_key ) }}' @@ -119,7 +119,7 @@ original_cert: '{{ item.item }}' prev_task: '{{ item }}' - name: fetch data about cert just uploaded, by ARN - aws_acm_info: + acm_certificate_info: certificate_arn: '{{ item.certificate.arn }}' register: fetch_after_up with_items: '{{ upload.results }}' @@ -138,7 +138,7 @@ upload_result: '{{ item.item }}' original_cert: '{{ item.item.item }}' - name: fetch data about cert just uploaded, by name - aws_acm_info: + acm_certificate_info: tags: Name: '{{ original_cert.name }}' register: fetch_after_up_name @@ -161,7 +161,7 @@ upload_result: '{{ item.item }}' original_cert: '{{ item.item.item }}' - name: fetch data about cert just uploaded, by domain name - aws_acm_info: + acm_certificate_info: domain_name: '{{ original_cert.domain }}' register: fetch_after_up_domain with_items: '{{ upload.results }}' @@ -182,7 +182,7 @@ upload_result: '{{ item.item }}' original_cert: '{{ item.item.item }}' - name: upload certificates again, check not changed - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' certificate: '{{ lookup(''file'', item.cert ) }}' private_key: '{{ lookup(''file'', item.priv_key ) }}' @@ -191,7 +191,7 @@ with_items: '{{ local_certs }}' failed_when: upload2.changed - name: update first cert with body of the second, first time, check mode - aws_acm: + acm_certificate: state: present name_tag: '{{ local_certs[0].name }}' certificate: '{{ lookup(''file'', local_certs[1].cert ) }}' @@ -203,7 +203,7 @@ that: - overwrite_check.changed - name: check previous tasks did not change real cert - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[0].name }}' register: fetch_after_overwrite_check @@ -217,7 +217,7 @@ - '''Name'' in fetch_after_overwrite_check.certificates[0].tags' - fetch_after_overwrite_check.certificates[0].tags['Name'] == local_certs[0].name - name: update first cert with body of the second, first real time - aws_acm: + acm_certificate: state: present name_tag: '{{ local_certs[0].name }}' certificate: '{{ lookup(''file'', local_certs[1].cert ) }}' @@ -232,7 +232,7 @@ - overwrite.certificate.domain_name == local_certs[1].domain - overwrite.changed - name: check update was sucessfull - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[0].name }}' register: fetch_after_overwrite @@ -246,7 +246,7 @@ - '''Name'' in fetch_after_overwrite.certificates[0].tags' - fetch_after_overwrite.certificates[0].tags['Name'] == local_certs[0].name - name: fetch other cert - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[1].name }}' register: check_after_overwrite @@ -260,7 +260,7 @@ - '''Name'' in check_after_overwrite.certificates[0].tags' - check_after_overwrite.certificates[0].tags['Name'] == local_certs[1].name - name: update first cert with body of the second again - aws_acm: + acm_certificate: state: present name_tag: '{{ local_certs[0].name }}' certificate: '{{ lookup(''file'', local_certs[1].cert ) }}' @@ -275,7 +275,7 @@ - overwrite2.certificate.domain_name == local_certs[1].domain - not overwrite2.changed - name: delete certs 1 and 2 in check mode - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[1].domain }}' check_mode: yes @@ -285,7 +285,7 @@ that: - delete_both_check.changed - name: fetch info for certs 1 and 2 - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[item].name }}' register: check_del_one_check @@ -298,7 +298,7 @@ that: - (item.certificates | length) == 1 - name: delete certs 1 and 2 real - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[1].domain }}' register: delete_both @@ -310,7 +310,7 @@ - upload.results[0].certificate.arn in delete_both.arns - delete_both.changed - name: fetch info for certs 1 and 2 - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[item].name }}' register: check_del_one @@ -327,7 +327,7 @@ assert: that: (item.certificates | length) == 0 - name: check cert 3 - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[2].name }}' register: check_del_one_remain @@ -336,7 +336,7 @@ that: - (check_del_one_remain.certificates | length) == 1 - name: delete cert 3 - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[2].domain }}' register: delete_third @@ -348,13 +348,13 @@ - delete_third.arns[0] == upload.results[2].certificate.arn - delete_third.changed - name: check cert 3 was deleted - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[2].name }}' register: check_del_three failed_when: check_del_three.certificates | length != 0 - name: delete cert 3 again - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[2].domain }}' register: delete_third @@ -365,7 +365,7 @@ - delete_third.arns | length == 0 - not delete_third.changed - name: delete cert 3 again, check mode - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[2].domain }}' check_mode: yes @@ -415,7 +415,7 @@ root_certificates: - '{{ local_certs[item.ca].cert }}' - name: upload chained cert, first chain, first time - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' certificate: '{{ lookup(''file'', chained_cert.chains[0].cert ) }}' certificate_chain: '{{ chains.results[0].complete_chain | join('' @@ -426,7 +426,7 @@ register: upload_chain failed_when: not upload_chain.changed - name: fetch chain of cert we just uploaded - aws_acm_info: + acm_certificate_info: tags: Name: '{{ chained_cert.name }}' register: check_chain @@ -440,7 +440,7 @@ - (check_chain.certificates[0].certificate_chain | replace( ' ', '' ) | replace( '\n', '')) == ( chains.results[0].complete_chain | join( '\n' ) | replace( ' ', '' ) | replace( '\n', '') ) - (check_chain.certificates[0].certificate | replace( ' ', '' ) | replace( '\n', '')) == ( lookup('file', chained_cert.chains[0].cert ) | replace( ' ', '' ) | replace( '\n', '') ) - name: upload chained cert again, check not changed - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' certificate: '{{ lookup(''file'', chained_cert.chains[0].cert ) }}' certificate_chain: '{{ chains.results[0].complete_chain | join('' @@ -455,7 +455,7 @@ - upload_chain_2.certificate.arn == upload_chain.certificate.arn - not upload_chain_2.changed - name: upload chained cert, different chain - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' certificate: '{{ lookup(''file'', chained_cert.chains[1].cert ) }}' certificate_chain: '{{ chains.results[1].complete_chain | join('' @@ -470,7 +470,7 @@ - upload_chain_3.changed - upload_chain_3.certificate.arn == upload_chain.certificate.arn - name: fetch info about chain of cert we just updated - aws_acm_info: + acm_certificate_info: tags: Name: '{{ chained_cert.name }}' register: check_chain_2 @@ -480,7 +480,7 @@ - (check_chain_2.certificates[0].certificate_chain | replace( ' ', '' ) | replace( '\n', '')) == ( chains.results[1].complete_chain | join( '\n' ) | replace( ' ', '' ) | replace( '\n', '') ) - (check_chain_2.certificates[0].certificate | replace( ' ', '' ) | replace( '\n', '')) == ( lookup('file', chained_cert.chains[1].cert ) | replace( ' ', '' ) | replace( '\n', '') ) - name: delete chained cert - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' state: absent register: delete_chain_3 @@ -491,13 +491,13 @@ - upload_chain.certificate.arn in delete_chain_3.arns always: - name: delete first bunch of certificates - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' state: absent with_items: '{{ local_certs }}' ignore_errors: true - name: delete chained cert - aws_acm: + acm_certificate: state: absent name_tag: '{{ chained_cert.name }}' ignore_errors: true diff --git a/tests/integration/targets/acm_certificate/tasks/main.yml b/tests/integration/targets/acm_certificate/tasks/main.yml index 92416030776..5cc6d31a096 100644 --- a/tests/integration/targets/acm_certificate/tasks/main.yml +++ b/tests/integration/targets/acm_certificate/tasks/main.yml @@ -12,7 +12,7 @@ - set_fact: aws_acm_test_uuid: "{{ (10**9) | random }}" - name: attempt to delete cert without specifying required parameter - aws_acm: + acm_certificate: state: absent register: result ignore_errors: true @@ -22,23 +22,23 @@ - 'result.failed' - '"If ''state'' is specified as ''absent'' then exactly one of ''name_tag''" in result.msg' - name: list certs - aws_acm_info: null + acm_certificate_info: null register: list_all failed_when: list_all.certificates is not defined - name: ensure absent cert which doesn't exist - first time - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' state: absent with_items: '{{ local_certs }}' - name: ensure absent cert which doesn't exist - second time - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' state: absent with_items: '{{ local_certs }}' register: absent_start_two failed_when: absent_start_two.changed - name: list cert which shouldn't exist - aws_acm_info: + acm_certificate_info: tags: Name: '{{ item.name }}' register: list_tag @@ -71,7 +71,7 @@ - name: try to upload certificate, but name_tag conflicts with tags.Name vars: local_cert: '{{ local_certs[0] }}' - aws_acm: + acm_certificate: name_tag: '{{ local_cert.name }}' certificate: '{{ lookup(''file'', local_cert.cert ) }}' private_key: '{{ lookup(''file'', local_cert.priv_key ) }}' @@ -88,7 +88,7 @@ - 'result.failed' - '"conflicts with value of" in result.msg' - name: upload certificates first time - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' certificate: '{{ lookup(''file'', item.cert ) }}' private_key: '{{ lookup(''file'', item.priv_key ) }}' @@ -115,7 +115,7 @@ original_cert: '{{ item.item }}' prev_task: '{{ item }}' - name: fetch data about cert just uploaded, by ARN - aws_acm_info: + acm_certificate_info: certificate_arn: '{{ item.certificate.arn }}' register: fetch_after_up with_items: '{{ upload.results }}' @@ -138,7 +138,7 @@ upload_result: '{{ item.item }}' original_cert: '{{ item.item.item }}' - name: fetch data about cert just uploaded, by name - aws_acm_info: + acm_certificate_info: tags: Name: '{{ original_cert.name }}' register: fetch_after_up_name @@ -161,7 +161,7 @@ upload_result: '{{ item.item }}' original_cert: '{{ item.item.item }}' - name: fetch data about cert just uploaded, by domain name - aws_acm_info: + acm_certificate_info: domain_name: '{{ original_cert.domain }}' register: fetch_after_up_domain with_items: '{{ upload.results }}' @@ -182,7 +182,7 @@ upload_result: '{{ item.item }}' original_cert: '{{ item.item.item }}' - name: upload certificates again, check not changed - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' certificate: '{{ lookup(''file'', item.cert ) }}' private_key: '{{ lookup(''file'', item.priv_key ) }}' @@ -191,7 +191,7 @@ with_items: '{{ local_certs }}' failed_when: upload2.changed - name: change tags of existing certificate, check mode - aws_acm: + acm_certificate: certificate_arn: '{{ certificate_arn }}' tags: Name: '{{ name_tag }}' @@ -208,7 +208,7 @@ that: - certificate_with_tags.changed - name: change tags of existing certificate, changes expected - aws_acm: + acm_certificate: # When applying tags to an existing certificate, it is sufficient to specify the 'certificate_arn'. # Previously, the 'aws_acm' module was requiring the 'certificate', 'name_tag' and 'domain_name' # attributes. @@ -239,7 +239,7 @@ vars: name_tag: '{{ upload2.results[0].item.name }}' - name: change tags of existing certificate, check mode again - aws_acm: + acm_certificate: certificate_arn: '{{ certificate_arn }}' tags: Name: '{{ name_tag }}' @@ -255,7 +255,7 @@ that: - not certificate_with_tags.changed - name: change tags of existing certificate, no change expected - aws_acm: + acm_certificate: certificate_arn: '{{ certificate_arn }}' tags: Name: '{{ name_tag }}' @@ -299,7 +299,7 @@ - certificate_with_tags.certificate.tags['Environment'] == 'staging' - certificate_with_tags.certificate.tags['Owner'] == 'Bob' - name: change tags of existing certificate, purge tags - aws_acm: + acm_certificate: certificate_arn: '{{ certificate_arn }}' tags: Name: '{{ name_tag }}' @@ -328,7 +328,7 @@ - certificate_with_tags.certificate.tags['Application'] == 'search' - certificate_with_tags.certificate.tags['Environment'] == 'staging' - name: update first cert with body of the second, first time - aws_acm: + acm_certificate: state: present name_tag: '{{ local_certs[0].name }}' certificate: '{{ lookup(''file'', local_certs[1].cert ) }}' @@ -343,7 +343,7 @@ - overwrite.certificate.domain_name == local_certs[1].domain - overwrite.changed - name: check update was sucessfull - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[0].name }}' register: fetch_after_overwrite @@ -357,7 +357,7 @@ - '''Name'' in fetch_after_overwrite.certificates[0].tags' - fetch_after_overwrite.certificates[0].tags['Name'] == local_certs[0].name - name: fetch other cert - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[1].name }}' register: check_after_overwrite @@ -371,7 +371,7 @@ - '''Name'' in check_after_overwrite.certificates[0].tags' - check_after_overwrite.certificates[0].tags['Name'] == local_certs[1].name - name: update first cert with body of the second again - aws_acm: + acm_certificate: state: present name_tag: '{{ local_certs[0].name }}' certificate: '{{ lookup(''file'', local_certs[1].cert ) }}' @@ -386,7 +386,7 @@ - overwrite2.certificate.domain_name == local_certs[1].domain - not overwrite2.changed - name: delete certs 1 and 2 - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[1].domain }}' register: delete_both @@ -398,7 +398,7 @@ - upload.results[0].certificate.arn in delete_both.arns - delete_both.changed - name: fetch info for certs 1 and 2 - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[item].name }}' register: check_del_one @@ -415,13 +415,13 @@ assert: that: item.certificates | length == 0 - name: check cert 3 not deleted - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[2].name }}' register: check_del_one_remain failed_when: check_del_one_remain.certificates | length != 1 - name: delete cert 3 - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[2].domain }}' register: delete_third @@ -433,13 +433,13 @@ - delete_third.arns[0] == upload.results[2].certificate.arn - delete_third.changed - name: check cert 3 was deleted - aws_acm_info: + acm_certificate_info: tags: Name: '{{ local_certs[2].name }}' register: check_del_three failed_when: check_del_three.certificates | length != 0 - name: delete cert 3 again - aws_acm: + acm_certificate: state: absent domain_name: '{{ local_certs[2].domain }}' register: delete_third @@ -490,7 +490,7 @@ root_certificates: - '{{ local_certs[item.ca].cert }}' - name: upload chained cert, first chain, first time - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' certificate: '{{ lookup(''file'', chained_cert.chains[0].cert ) }}' certificate_chain: '{{ chains.results[0].complete_chain | join('' @@ -501,7 +501,7 @@ register: upload_chain failed_when: not upload_chain.changed - name: fetch chain of cert we just uploaded - aws_acm_info: + acm_certificate_info: tags: Name: '{{ chained_cert.name }}' register: check_chain @@ -513,7 +513,7 @@ - (check_chain.certificates[0].certificate_chain | replace( ' ', '' ) | replace( '\n', '')) == ( chains.results[0].complete_chain | join( '\n' ) | replace( ' ', '' ) | replace( '\n', '') ) - (check_chain.certificates[0].certificate | replace( ' ', '' ) | replace( '\n', '')) == ( lookup('file', chained_cert.chains[0].cert ) | replace( ' ', '' ) | replace( '\n', '') ) - name: upload chained cert again, check not changed - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' certificate: '{{ lookup(''file'', chained_cert.chains[0].cert ) }}' certificate_chain: '{{ chains.results[0].complete_chain | join('' @@ -528,7 +528,7 @@ - upload_chain_2.certificate.arn == upload_chain.certificate.arn - not upload_chain_2.changed - name: upload chained cert, different chain - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' certificate: '{{ lookup(''file'', chained_cert.chains[1].cert ) }}' certificate_chain: '{{ chains.results[1].complete_chain | join('' @@ -543,7 +543,7 @@ - upload_chain_3.changed - upload_chain_3.certificate.arn == upload_chain.certificate.arn - name: fetch info about chain of cert we just updated - aws_acm_info: + acm_certificate_info: tags: Name: '{{ chained_cert.name }}' register: check_chain_2 @@ -555,7 +555,7 @@ - (check_chain_2.certificates[0].certificate_chain | replace( ' ', '' ) | replace( '\n', '')) == ( chains.results[1].complete_chain | join( '\n' ) | replace( ' ', '' ) | replace( '\n', '') ) - (check_chain_2.certificates[0].certificate | replace( ' ', '' ) | replace( '\n', '')) == ( lookup('file', chained_cert.chains[1].cert ) | replace( ' ', '' ) | replace( '\n', '') ) - name: delete chained cert - aws_acm: + acm_certificate: name_tag: '{{ chained_cert.name }}' state: absent register: delete_chain_3 @@ -566,13 +566,13 @@ - upload_chain.certificate.arn in delete_chain_3.arns always: - name: delete first bunch of certificates - aws_acm: + acm_certificate: name_tag: '{{ item.name }}' state: absent with_items: '{{ local_certs }}' ignore_errors: true - name: delete chained cert - aws_acm: + acm_certificate: state: absent name_tag: '{{ chained_cert.name }}' ignore_errors: true diff --git a/tests/integration/targets/api_gateway_domain/tasks/main.yml b/tests/integration/targets/api_gateway_domain/tasks/main.yml index 4721fe37474..24f391df37c 100644 --- a/tests/integration/targets/api_gateway_domain/tasks/main.yml +++ b/tests/integration/targets/api_gateway_domain/tasks/main.yml @@ -17,7 +17,7 @@ # ==================== preparations ======================================== - name: Preperations - Create REST API Gateway on AWS API Gateway service to reference from domain tests - aws_api_gateway: + api_gateway: swagger_file: files/api_gw_swagger.yml stage: test state: present @@ -26,7 +26,7 @@ # ================== integration tests ========================================== - name: Create Test - API gateway custom domain setup - aws_api_gateway_domain: + api_gateway_domain: domain_name: "{{ api_gateway_domain_name }}" certificate_arn: "{{ api_gateway_domain_tls_arn }}" security_policy: 'TLS_1_0' @@ -45,7 +45,7 @@ - create_result.response.path_mappings is defined - name: Idempotence Test - API gateway custom domain setup - aws_api_gateway_domain: + api_gateway_domain: domain_name: "{{ api_gateway_domain_name }}" certificate_arn: "{{ api_gateway_domain_tls_arn }}" security_policy: 'TLS_1_0' @@ -62,7 +62,7 @@ - repeat_result.response.domain_name == "{{ api_gateway_domain_name }}" - name: Update Test - API gateway custom domain setup, change settings - aws_api_gateway_domain: + api_gateway_domain: domain_name: "{{ api_gateway_domain_name }}" certificate_arn: "{{ api_gateway_domain_tls_arn }}" security_policy: 'TLS_1_2' @@ -81,7 +81,7 @@ - update_result.response.path_mappings.0.base_path = '/v1' - name: Delete - API gateway custom domain setup deletion - aws_api_gateway_domain: + api_gateway_domain: domain_name: "{{ api_gateway_domain_name }}" certificate_arn: "{{ api_gateway_domain_tls_arn }}" security_policy: 'TLS_1_2' @@ -101,7 +101,7 @@ always: - name: Cleanup - delete test domain setup - aws_api_gateway_domain: + api_gateway_domain: domain_name: "{{ api_gateway_domain_name }}" certificate_arn: "{{ api_gateway_domain_tls_arn }}" domain_mappings: [] @@ -109,7 +109,7 @@ ignore_errors: true - name: Cleanup - remove REST API Gateway on AWS API Gateway service - aws_api_gateway: + api_gateway: api_id: "{{ api_gateway_result.api_id }}" swagger_file: files/api_gw_swagger.yml state: absent diff --git a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_cleanup.yml b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_cleanup.yml index 75d1ecfadb1..ef894ff542c 100644 --- a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_cleanup.yml +++ b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_cleanup.yml @@ -1,5 +1,5 @@ - name: kill asg - ec2_asg: + autoscaling_group: name: "{{ asg_name }}" state: absent register: removed @@ -8,7 +8,7 @@ retries: 10 - name: remove launch configs - ec2_lc: + autoscaling_launch_config: name: "{{ lc_name }}" state: absent register: removed @@ -17,7 +17,7 @@ retries: 10 - name: remove the security group - ec2_group: + ec2_security_group: name: "{{ sg_name }}" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_setup.yml b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_setup.yml index ae958cd89de..b4609ea9789 100644 --- a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_setup.yml +++ b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/env_setup.yml @@ -37,7 +37,7 @@ - "{{ testing_subnet.subnet.id }}" - name: create a security group with the vpc created in the ec2_setup - ec2_group: + ec2_security_group: name: "{{ sg_name }}" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" @@ -53,7 +53,7 @@ register: sg - name: create a launch configuration - ec2_lc: + autoscaling_launch_config: name: "{{ lc_name }}" image_id: "{{ ec2_ami_id }}" instance_type: t2.micro @@ -67,7 +67,7 @@ - create_lc.failed is false - name: create a AutoScalingGroup - ec2_asg: + autoscaling_group: name: "{{ asg_name }}" launch_config_name: "{{ lc_name }}" health_check_period: 60 diff --git a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/main.yml b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/main.yml index 584719b0d95..d4b2a7c7a69 100644 --- a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/main.yml +++ b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/main.yml @@ -7,6 +7,7 @@ session_token: "{{ security_token | default(omit) }}" region: "{{ aws_region }}" collections: + - amazon.aws - community.aws block: - include_tasks: 'env_setup.yml' diff --git a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/tests.yml b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/tests.yml index 7d326c6ff11..804f802bbd7 100644 --- a/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/tests.yml +++ b/tests/integration/targets/autoscaling_complete_lifecycle_action/tasks/tests.yml @@ -3,7 +3,7 @@ block: #---------------------------------------------------------------------- - name: Create lifecycle hook - ec2_asg_lifecycle_hook: + autoscaling_lifecycle_hook: autoscaling_group_name: "{{ asg_name }}" lifecycle_hook_name: "{{ resource_prefix }}-lifecycle-hook" transition: autoscaling:EC2_INSTANCE_LAUNCHING @@ -18,7 +18,7 @@ - output is not failed - name: Create lifecycle hook - ec2_asg_lifecycle_hook: + autoscaling_lifecycle_hook: autoscaling_group_name: "{{ asg_name }}" lifecycle_hook_name: "{{ resource_prefix }}-lifecycle-hook-terminate" transition: autoscaling:EC2_INSTANCE_TERMINATING @@ -33,7 +33,7 @@ - output is not failed - name: Trigger scale-up - ec2_asg: + autoscaling_group: name: "{{ asg_name }}" replace_all_instances: yes min_size: 0 @@ -47,7 +47,7 @@ - scale_asg is changed - name: Describe ASG - ec2_asg_info: + autoscaling_group_info: name: "{{ asg_name }}" register: scaled_asg retries: 24 @@ -62,7 +62,7 @@ instance_ids: '{{ scaled_asg.results[0].instances | map(attribute="instance_id") | list }}' - name: Describe ASG - ec2_asg_info: + autoscaling_group_info: name: "{{ asg_name }}" - name: Complete Lifecycle Hook @@ -80,7 +80,7 @@ instance_id: '{{ instance_ids[1] }}' - name: Describe ASG - ec2_asg_info: + autoscaling_group_info: name: "{{ asg_name }}" register: hooks_pending retries: 24 @@ -104,7 +104,7 @@ always: - name: Delete lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: autoscaling_group_name: "{{ asg_name }}" lifecycle_hook_name: "{{ resource_prefix }}-lifecycle-hook" state: absent @@ -112,7 +112,7 @@ ignore_errors: True - name: Delete lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: autoscaling_group_name: "{{ asg_name }}" lifecycle_hook_name: "{{ resource_prefix }}-lifecycle-hook-terminate" state: absent diff --git a/tests/integration/targets/autoscaling_instance_refresh/tasks/main.yml b/tests/integration/targets/autoscaling_instance_refresh/tasks/main.yml index f6780d18b3e..f19b7c3c24a 100644 --- a/tests/integration/targets/autoscaling_instance_refresh/tasks/main.yml +++ b/tests/integration/targets/autoscaling_instance_refresh/tasks/main.yml @@ -47,7 +47,7 @@ - "{{ testing_subnet.subnet.id }}" - name: create a security group with the vpc created in the ec2_setup - ec2_group: + ec2_security_group: name: "{{ sg_name }}" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" @@ -63,7 +63,7 @@ register: sg - name: ensure launch configs exist - ec2_lc: + autoscaling_launch_config: name: "{{ item }}" assign_public_ip: true image_id: "{{ ec2_ami_id }}" @@ -81,7 +81,7 @@ - "{{ lc_name_2 }}" - name: launch asg and do not wait for instances to be deemed healthy (no ELB) - ec2_asg: + autoscaling_group: name: "{{ asg_name }}" launch_config_name: "{{ lc_name_1 }}" desired_capacity: 1 @@ -99,7 +99,7 @@ # ============================================================ - name: test invalid cancelation - V1 - (pre-refresh) - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" ignore_errors: yes @@ -110,7 +110,7 @@ - "'An error occurred (ActiveInstanceRefreshNotFound) when calling the CancelInstanceRefresh operation: No in progress or pending Instance Refresh found for Auto Scaling group {{ resource_prefix }}-asg' in result.msg" - name: test starting a refresh with a valid ASG name - check_mode - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" check_mode: true @@ -123,7 +123,7 @@ - '"autoscaling:StartInstanceRefresh" not in output.resource_actions' - name: test starting a refresh with a valid ASG name - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" register: output @@ -133,7 +133,7 @@ - "'instance_refresh_id' in output.instance_refreshes" - name: test starting a refresh with a valid ASG name - Idempotent - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" ignore_errors: true @@ -145,7 +145,7 @@ - '"Failed to start InstanceRefresh: An error occurred (InstanceRefreshInProgress) when calling the StartInstanceRefresh operation: An Instance Refresh is already in progress and blocks the execution of this Instance Refresh." in output.msg' - name: test starting a refresh with a valid ASG name - Idempotent (check_mode) - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" ignore_errors: true @@ -159,7 +159,7 @@ - '"In check_mode - Instance Refresh is already in progress, can not start new instance refresh." in output.msg' - name: test starting a refresh with a nonexistent ASG name - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "nonexistentname-asg" state: "started" ignore_errors: yes @@ -170,7 +170,7 @@ - "'Failed to start InstanceRefresh: An error occurred (ValidationError) when calling the StartInstanceRefresh operation: AutoScalingGroup name not found' in result.msg" - name: test canceling a refresh with an ASG name - check_mode - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" check_mode: true @@ -183,7 +183,7 @@ - '"autoscaling:CancelInstanceRefresh" not in output.resource_actions' - name: test canceling a refresh with an ASG name - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" register: output @@ -193,7 +193,7 @@ - "'instance_refresh_id' in output.instance_refreshes" - name: test canceling a refresh with a ASG name - Idempotent - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" ignore_errors: yes @@ -204,7 +204,7 @@ - output is not changed - name: test cancelling a refresh with a valid ASG name - Idempotent (check_mode) - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" ignore_errors: true @@ -217,7 +217,7 @@ - output is not failed - name: test starting a refresh with an ASG name and preferences dict - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" preferences: @@ -232,7 +232,7 @@ - "'instance_refresh_id' in output.instance_refreshes" - name: re-test canceling a refresh with an ASG name - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" register: output @@ -242,7 +242,7 @@ - "'instance_refresh_id' in output.instance_refreshes" - name: test valid start - V1 - (with preferences missing instance_warmup) - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" preferences: @@ -257,7 +257,7 @@ - "'instance_refresh_id' in output.instance_refreshes" - name: re-test canceling a refresh with an ASG name - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" register: output @@ -267,7 +267,7 @@ - "'instance_refresh_id' in output.instance_refreshes" - name: test valid start - V2 - (with preferences missing min_healthy_percentage) - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" preferences: @@ -282,7 +282,7 @@ - "'instance_refresh_id' in output.instance_refreshes" - name: test invalid cancelation - V2 - (with preferences) - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" preferences: @@ -302,7 +302,7 @@ loop: "{{ query('sequence', 'start=1 end=3') }}" - name: test getting info for an ASG name - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" region: "{{ aws_region }}" ignore_errors: yes @@ -315,7 +315,7 @@ inst_refresh_id_json_query: instance_refreshes[].instance_refresh_id - name: test using fake refresh ID - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" ids: ['0e367f58-blabla-bla-bla-ca870dc5dbfe'] ignore_errors: yes @@ -326,7 +326,7 @@ - "{{ output.instance_refreshes|length }} == 0" - name: test using a real refresh ID - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" ids: [ '{{ refreshout.instance_refreshes.instance_refresh_id }}' ] ignore_errors: yes @@ -337,7 +337,7 @@ - "{{ output.instance_refreshes |length }} == 1" - name: test getting info for an ASG name which doesn't exist - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: n0n3x1stentname27b ignore_errors: yes register: output @@ -347,7 +347,7 @@ - "'Failed to describe InstanceRefreshes: An error occurred (ValidationError) when calling the DescribeInstanceRefreshes operation: AutoScalingGroup name not found - AutoScalingGroup n0n3x1stentname27b not found' == output.msg" - name: assert that the correct number of records are returned - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" ignore_errors: yes register: output @@ -357,7 +357,7 @@ - "{{ output.instance_refreshes|length }} == 7" - name: assert that valid message with fake-token is returned - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" next_token: "fake-token-123" ignore_errors: yes @@ -368,7 +368,7 @@ - '"Failed to describe InstanceRefreshes: An error occurred (InvalidNextToken) when calling the DescribeInstanceRefreshes operation: The token ''********'' is invalid." == output.msg' - name: assert that max records=1 returns no more than one record - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" max_records: 1 ignore_errors: yes @@ -379,7 +379,7 @@ - "{{ output.instance_refreshes|length }} < 2" - name: assert that valid message with real-token is returned - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" next_token: "{{ output.next_token }}" ignore_errors: yes @@ -390,7 +390,7 @@ - "{{ output.instance_refreshes|length }} == 7" - name: test using both real nextToken and max_records=1 - ec2_asg_instance_refresh_info: + autoscaling_instance_refresh_info: name: "{{ asg_name }}" max_records: 1 next_token: "{{ output.next_token }}" @@ -404,7 +404,7 @@ always: - name: kill asg - ec2_asg: + autoscaling_group: name: "{{ asg_name }}" state: absent register: removed @@ -414,7 +414,7 @@ # Remove the testing dependencies - name: remove the load balancer - ec2_elb_lb: + elb_classic_lb: name: "{{ load_balancer_name }}" state: absent security_group_ids: @@ -440,7 +440,7 @@ retries: 10 - name: remove launch configs - ec2_lc: + autoscaling_launch_config: name: "{{ item }}" state: absent register: removed @@ -461,7 +461,7 @@ ignore_errors: true - name: remove the security group - ec2_group: + ec2_security_group: name: "{{ sg_name }}" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/autoscaling_instance_refresh/tasks/refresh_and_cancel_three_times.yml b/tests/integration/targets/autoscaling_instance_refresh/tasks/refresh_and_cancel_three_times.yml index 9ec92e4b5fc..9b051a054e0 100644 --- a/tests/integration/targets/autoscaling_instance_refresh/tasks/refresh_and_cancel_three_times.yml +++ b/tests/integration/targets/autoscaling_instance_refresh/tasks/refresh_and_cancel_three_times.yml @@ -1,13 +1,13 @@ --- - name: try to cancel pre-loop - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" ignore_errors: yes - name: test starting a refresh with an ASG name - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "started" access_key: "{{ aws_access_key }}" @@ -20,7 +20,7 @@ until: refreshout is not failed - name: test cancelling a refresh with an ASG name - ec2_asg_instance_refresh: + autoscaling_instance_refresh: name: "{{ asg_name }}" state: "cancelled" access_key: "{{ aws_access_key }}" diff --git a/tests/integration/targets/autoscaling_launch_config/tasks/env_cleanup.yml b/tests/integration/targets/autoscaling_launch_config/tasks/env_cleanup.yml index 9e5ae6a9380..ce626b69c3d 100644 --- a/tests/integration/targets/autoscaling_launch_config/tasks/env_cleanup.yml +++ b/tests/integration/targets/autoscaling_launch_config/tasks/env_cleanup.yml @@ -24,7 +24,7 @@ retries: 10 - name: remove the security group - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/autoscaling_launch_config/tasks/env_setup.yml b/tests/integration/targets/autoscaling_launch_config/tasks/env_setup.yml index 88f5bb6fe22..d48bae66c83 100644 --- a/tests/integration/targets/autoscaling_launch_config/tasks/env_setup.yml +++ b/tests/integration/targets/autoscaling_launch_config/tasks/env_setup.yml @@ -48,7 +48,7 @@ - "{{ testing_subnet_b.subnet.id }}" - name: create a security group with the vpc - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/autoscaling_launch_config/tasks/main.yml b/tests/integration/targets/autoscaling_launch_config/tasks/main.yml index 747ce994618..da1f2fb1f6f 100644 --- a/tests/integration/targets/autoscaling_launch_config/tasks/main.yml +++ b/tests/integration/targets/autoscaling_launch_config/tasks/main.yml @@ -14,7 +14,7 @@ include_tasks: env_setup.yml - name: Create launch configuration 1 - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc1' image_id: '{{ ec2_ami_id }}' assign_public_ip: yes @@ -28,7 +28,7 @@ register: lc_1_create - name: Gather information about launch configuration 1 - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: '{{ resource_prefix }}-lc1' register: lc_1_info_result @@ -42,7 +42,7 @@ - lc_1_info_result.launch_configurations[0].instance_type == 't2.micro' - name: Create launch configuration 1 - Idempotency - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc1' image_id: '{{ ec2_ami_id }}' assign_public_ip: yes @@ -61,7 +61,7 @@ - '"autoscaling:CreateLaunchConfiguration" not in lc_1_create_idem.resource_actions' - name: Create launch configuration 2 - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc2' image_id: '{{ ec2_ami_id }}' assign_public_ip: yes @@ -75,7 +75,7 @@ register: lc_2_create - name: Gather information about launch configuration 2 - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: '{{ resource_prefix }}-lc2' register: lc_2_info_result @@ -90,7 +90,7 @@ - '"autoscaling:CreateLaunchConfiguration" in lc_2_create.resource_actions' - name: Create launch configuration 2 - Idempotency - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc2' image_id: '{{ ec2_ami_id }}' assign_public_ip: yes @@ -109,7 +109,7 @@ - '"autoscaling:CreateLaunchConfiguration" not in lc_2_create_idem.resource_actions' - name: Create launch configuration 3 - test throughput parameter - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc3' image_id: '{{ ec2_ami_id }}' instance_type: '{{ ec2_instance_type }}' @@ -122,7 +122,7 @@ register: lc_3_create - name: Gather information about launch configuration 3 - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: '{{ resource_prefix }}-lc3' register: lc_3_info_result @@ -137,7 +137,7 @@ - '"autoscaling:CreateLaunchConfiguration" in lc_3_create.resource_actions' - name: Create launch configuration 3 - Idempotency - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc3' image_id: '{{ ec2_ami_id }}' instance_type: '{{ ec2_instance_type }}' @@ -155,7 +155,7 @@ - '"autoscaling:CreateLaunchConfiguration" not in lc_3_create_idem.resource_actions' - name: Search for the Launch Configurations that start with test resource_prefix - community.aws.ec2_lc_find: + community.aws.autoscaling_launch_config_find: name_regex: '{{ resource_prefix }}*' sort_order: descending register: lc_find_result @@ -166,7 +166,7 @@ - '"autoscaling:DescribeLaunchConfigurations" in lc_find_result.resource_actions' - name: Delete launch configuration 1 - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc1' state: absent register: lc_1_delete @@ -177,7 +177,7 @@ - '"autoscaling:DeleteLaunchConfiguration" in lc_1_delete.resource_actions' - name: Delete launch configuration 1 - Idempotency - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc1' state: absent register: lc_1_delete_idem @@ -188,7 +188,7 @@ - '"autoscaling:DeleteLaunchConfiguration" not in lc_1_delete_idem.resource_actions' - name: Gather information about launch configuration 1 - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: '{{ resource_prefix }}-lc1' register: lc_1_info_result @@ -198,7 +198,7 @@ - lc_1_info_result.launch_configurations | length == 0 - name: Delete launch configuration 2 - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc2' state: absent register: lc_2_delete @@ -209,7 +209,7 @@ - '"autoscaling:DeleteLaunchConfiguration" in lc_2_delete.resource_actions' - name: Delete launch configuration 2 - Idempotency - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc2' state: absent register: lc_2_delete_idem @@ -220,7 +220,7 @@ - '"autoscaling:DeleteLaunchConfiguration" not in lc_2_delete_idem.resource_actions' - name: Gather information about launch configuration 2 - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: '{{ resource_prefix }}-lc2' register: lc_2_info_result @@ -230,7 +230,7 @@ - lc_2_info_result.launch_configurations | length == 0 - name: Delete launch configuration 3 - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc3' state: absent register: lc_3_delete @@ -241,7 +241,7 @@ - '"autoscaling:DeleteLaunchConfiguration" in lc_3_delete.resource_actions' - name: Delete launch configuration 3 - Idempotency - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: '{{ resource_prefix }}-lc3' state: absent register: lc_3_delete_idem @@ -252,7 +252,7 @@ - '"autoscaling:DeleteLaunchConfiguration" not in lc_3_delete_idem.resource_actions' - name: Gather information about launch configuration 3 - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: '{{ resource_prefix }}-lc2' register: lc_3_info_result diff --git a/tests/integration/targets/autoscaling_lifecycle_hook/main.yml b/tests/integration/targets/autoscaling_lifecycle_hook/main.yml index 7a0cff663f7..e8fdfd37b0f 100644 --- a/tests/integration/targets/autoscaling_lifecycle_hook/main.yml +++ b/tests/integration/targets/autoscaling_lifecycle_hook/main.yml @@ -2,40 +2,38 @@ # Beware: most of our tests here are run in parallel. # To add new tests you'll need to add a new host to the inventory and a matching # '{{ inventory_hostname }}'.yml file in roles/ec2_asg_lifecycle_hook/tasks/ - - # Prepare the VPC and figure out which AMI to use - hosts: all - gather_facts: no + gather_facts: false tasks: - - module_defaults: - group/aws: - access_key: "{{ aws_access_key }}" - secret_key: "{{ aws_secret_key }}" - session_token: "{{ security_token | default(omit) }}" - region: "{{ aws_region }}" - vars: + - module_defaults: + group/aws: + access_key: "{{ aws_access_key }}" + secret_key: "{{ aws_secret_key }}" + session_token: "{{ security_token | default(omit) }}" + region: "{{ aws_region }}" + vars: # We can't just use "run_once" because the facts don't propagate when # running an 'include' that was run_once - setup_run_once: yes - block: - - include_role: - name: 'setup_ec2_facts' - - include_role: - name: 'ec2_asg_lifecycle_hook' - tasks_from: env_setup.yml - rescue: - - include_role: - name: 'ec2_asg_lifecycle_hook' - tasks_from: env_cleanup.yml - run_once: yes - - fail: - msg: 'Environment preparation failed' - run_once: yes + setup_run_once: true + block: + - ansible.builtin.include_role: + name: setup_ec2_facts + - ansible.builtin.include_role: + name: ec2_asg_lifecycle_hook + tasks_from: env_setup.yml + rescue: + - ansible.builtin.include_role: + name: ec2_asg_lifecycle_hook + tasks_from: env_cleanup.yml + run_once: true + - ansible.builtin.fail: + msg: Environment preparation failed + run_once: true # VPC should get cleaned up once all hosts have run - hosts: all - gather_facts: no + gather_facts: false strategy: free serial: 6 roles: diff --git a/tests/integration/targets/autoscaling_lifecycle_hook/meta/main.yml b/tests/integration/targets/autoscaling_lifecycle_hook/meta/main.yml index 1471b11f658..fcadd50dc68 100644 --- a/tests/integration/targets/autoscaling_lifecycle_hook/meta/main.yml +++ b/tests/integration/targets/autoscaling_lifecycle_hook/meta/main.yml @@ -1,2 +1,3 @@ +--- dependencies: - setup_ec2_facts diff --git a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml index 800ee635890..f6b92213e3c 100644 --- a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml +++ b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml @@ -2,47 +2,46 @@ - name: Test create/update/delete AutoScalingGroups Lifecycle Hooks with ec2_asg_lifecycle_hook block: - #---------------------------------------------------------------------- - - name: create a launch configuration - ec2_lc: + # ---------------------------------------------------------------------- + - name: Create a launch configuration + community.aws.autoscaling_launch_config: name: "{{ resource_prefix }}-lc" image_id: "{{ ec2_ami_id }}" region: "{{ aws_region }}" instance_type: t2.micro - assign_public_ip: yes + assign_public_ip: true register: create_lc - - name: ensure that lc is created - assert: + - name: Ensure that lc is created + ansible.builtin.assert: that: - create_lc is changed - create_lc.failed is false - #---------------------------------------------------------------------- - - name: create a AutoScalingGroup - ec2_asg: + # ---------------------------------------------------------------------- + - name: Create a AutoScalingGroup + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" health_check_period: 60 health_check_type: ELB - replace_all_instances: yes + replace_all_instances: true min_size: 1 max_size: 1 desired_capacity: 1 region: "{{ aws_region }}" register: create_asg - - name: ensure that AutoScalingGroup is created - assert: + - name: Ensure that AutoScalingGroup is created + ansible.builtin.assert: that: - create_asg is changed - create_asg.failed is false - '"autoscaling:CreateAutoScalingGroup" in create_asg.resource_actions' - #---------------------------------------------------------------------- - + # ---------------------------------------------------------------------- - name: Create lifecycle hook - check_mode - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -53,7 +52,7 @@ check_mode: true register: output - - assert: + - ansible.builtin.assert: that: - output is changed - output is not failed @@ -61,7 +60,7 @@ - '"Would have created AutoScalingGroup Lifecycle Hook if not in check_mode" in output.msg' - name: Create lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -71,7 +70,7 @@ state: present register: output - - assert: + - ansible.builtin.assert: that: - output is changed - output is not failed @@ -79,7 +78,7 @@ - output.lifecycle_hook_info[0].heartbeat_timeout == 7000 - name: Create lifecycle hook - Idempotency - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -89,14 +88,14 @@ state: present register: output - - assert: + - ansible.builtin.assert: that: - output is not changed - output is not failed - '"lifecycle_hook_info" not in output' - name: Create lifecycle hook - check_mode (Idempotency) - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -107,14 +106,14 @@ check_mode: true register: output - - assert: + - ansible.builtin.assert: that: - output is not changed - output is not failed - '"lifecycle_hook_info" not in output' - name: Update lifecycle hook - check_mode - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -125,7 +124,7 @@ check_mode: true register: output - - assert: + - ansible.builtin.assert: that: - output is changed - output is not failed @@ -133,7 +132,7 @@ - '"Would have modified AutoScalingGroup Lifecycle Hook if not in check_mode." in output.msg' - name: Update lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -143,7 +142,7 @@ state: present register: output - - assert: + - ansible.builtin.assert: that: - output is changed - output is not failed @@ -151,7 +150,7 @@ - output.lifecycle_hook_info[0].heartbeat_timeout == 6000 - name: Update lifecycle hook - Idempotency - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -161,14 +160,14 @@ state: present register: output - - assert: + - ansible.builtin.assert: that: - output is not changed - output is not failed - '"lifecycle_hook_info" not in output' - name: Update lifecycle hook - check_mode (Idempotency) - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -179,14 +178,14 @@ check_mode: true register: output - - assert: + - ansible.builtin.assert: that: - output is not changed - output is not failed - '"lifecycle_hook_info" not in output' - name: Delete lifecycle hook - check_mode - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -194,7 +193,7 @@ check_mode: true register: output - - assert: + - ansible.builtin.assert: that: - output is changed - output is not failed @@ -202,35 +201,35 @@ - '"Would have deleted AutoScalingGroup Lifecycle Hook if not in check_mode." in output.msg' - name: Delete lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" state: absent register: output - - assert: + - ansible.builtin.assert: that: - output is changed - output is not failed - '"lifecycle_hook_removed" in output' - name: Delete lifecycle hook - Idempotency - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" state: absent register: output - - assert: + - ansible.builtin.assert: that: - output is not changed - output is not failed - '"lifecycle_hook_removed" not in output' - name: Delete lifecycle hook - check_mode (Idempotency) - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: "{{ aws_region }}" autoscaling_group_name: "{{ resource_prefix }}-asg" lifecycle_hook_name: "{{ resource_prefix }}-test-hook" @@ -238,7 +237,7 @@ check_mode: true register: output - - assert: + - ansible.builtin.assert: that: - output is not changed - output is not failed diff --git a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml index 3b4ee869b42..1befe278a54 100644 --- a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml +++ b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml @@ -1,5 +1,6 @@ -- name: kill asg - ec2_asg: +--- +- name: Kill asg + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" state: absent register: removed @@ -8,8 +9,8 @@ retries: 10 # Remove the testing dependencies -- name: remove target group - elb_target_group: +- name: Remove target group + community.aws.elb_target_group: name: "{{ item }}" state: absent register: removed @@ -20,8 +21,8 @@ - "{{ tg1_name }}" - "{{ tg2_name }}" -- name: remove the load balancer - ec2_elb_lb: +- name: Remove the load balancer + amazon.aws.elb_classic_lb: name: "{{ load_balancer_name }}" state: absent security_group_ids: @@ -34,20 +35,20 @@ load_balancer_port: 80 instance_port: 80 health_check: - ping_protocol: tcp - ping_port: 80 - ping_path: "/" - response_timeout: 5 - interval: 10 - unhealthy_threshold: 4 - healthy_threshold: 2 + ping_protocol: tcp + ping_port: 80 + ping_path: / + response_timeout: 5 + interval: 10 + unhealthy_threshold: 4 + healthy_threshold: 2 register: removed until: removed is not failed ignore_errors: true retries: 10 -- name: remove launch configs - ec2_lc: +- name: Remove launch configs + community.aws.autoscaling_launch_config: name: "{{ item }}" state: absent register: removed @@ -57,8 +58,8 @@ loop: - "{{ resource_prefix }}-lc" -- name: delete launch template - ec2_launch_template: +- name: Delete launch template + community.aws.ec2_launch_template: name: "{{ resource_prefix }}-lt" state: absent register: del_lt @@ -66,8 +67,8 @@ until: del_lt is not failed ignore_errors: true -- name: remove the security group - ec2_group: +- name: Remove the security group + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" @@ -77,14 +78,14 @@ ignore_errors: true retries: 10 -- name: remove routing rules - ec2_vpc_route_table: +- name: Remove routing rules + amazon.aws.ec2_vpc_route_table: state: absent vpc_id: "{{ testing_vpc.vpc.id }}" tags: created: "{{ resource_prefix }}-route" routes: - - dest: 0.0.0.0/0 + - dest: "0.0.0.0/0" gateway_id: "{{ igw.gateway_id }}" subnets: - "{{ testing_subnet.subnet.id }}" @@ -93,8 +94,8 @@ ignore_errors: true retries: 10 -- name: remove internet gateway - ec2_vpc_igw: +- name: Remove internet gateway + amazon.aws.ec2_vpc_igw: vpc_id: "{{ testing_vpc.vpc.id }}" state: absent register: removed @@ -102,8 +103,8 @@ ignore_errors: true retries: 10 -- name: remove the subnet - ec2_vpc_subnet: +- name: Remove the subnet + amazon.aws.ec2_vpc_subnet: state: absent vpc_id: "{{ testing_vpc.vpc.id }}" cidr: 10.55.77.0/24 @@ -112,8 +113,8 @@ ignore_errors: true retries: 10 -- name: remove the VPC - ec2_vpc_net: +- name: Remove the VPC + amazon.aws.ec2_vpc_net: name: "{{ resource_prefix }}-vpc" cidr_block: 10.55.77.0/24 state: absent diff --git a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml index 8e9be1d5552..d516543100b 100644 --- a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml +++ b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml @@ -1,25 +1,25 @@ +--- - name: Run ec2_asg_lifecycle_hook integration tests. block: - # ============================================================ # Set up the testing dependencies: VPC, subnet, security group, and two launch configurations - name: Create VPC for use in testing - ec2_vpc_net: + amazon.aws.ec2_vpc_net: name: "{{ resource_prefix }}-vpc" cidr_block: 10.55.77.0/24 tenancy: default register: testing_vpc - name: Create internet gateway for use in testing - ec2_vpc_igw: + amazon.aws.ec2_vpc_igw: vpc_id: "{{ testing_vpc.vpc.id }}" state: present register: igw - name: Create subnet for use in testing - ec2_vpc_subnet: + amazon.aws.ec2_vpc_subnet: state: present vpc_id: "{{ testing_vpc.vpc.id }}" cidr: 10.55.77.0/24 @@ -28,19 +28,19 @@ Name: "{{ resource_prefix }}-subnet" register: testing_subnet - - name: create routing rules - ec2_vpc_route_table: + - name: Create routing rules + amazon.aws.ec2_vpc_route_table: vpc_id: "{{ testing_vpc.vpc.id }}" tags: created: "{{ resource_prefix }}-route" routes: - - dest: 0.0.0.0/0 + - dest: "0.0.0.0/0" gateway_id: "{{ igw.gateway_id }}" subnets: - "{{ testing_subnet.subnet.id }}" - - name: create a security group with the vpc created in the ec2_setup - ec2_group: + - name: Create a security group with the vpc created in the ec2_setup + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" @@ -48,9 +48,9 @@ - proto: tcp from_port: 22 to_port: 22 - cidr_ip: 0.0.0.0/0 + cidr_ip: "0.0.0.0/0" - proto: tcp from_port: 80 to_port: 80 - cidr_ip: 0.0.0.0/0 + cidr_ip: "0.0.0.0/0" register: sg diff --git a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml index d4510072a4a..e38324bda11 100644 --- a/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml +++ b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml @@ -3,7 +3,7 @@ # To add new tests you'll need to add a new host to the inventory and a matching # '{{ inventory_hostname }}'.yml file in roles/ec2_asg_lifecycle_hook/tasks/ -- name: "Wrap up all tests and setup AWS credentials" +- name: Wrap up all tests and setup AWS credentials module_defaults: group/aws: access_key: "{{ aws_access_key }}" @@ -15,26 +15,24 @@ # Unfortunately AWSRetry doesn't support paginators and boto3's paginators # don't support any configuration of the delay between retries. max_attempts: 20 - collections: - - community.aws block: - - debug: - msg: "{{ inventory_hostname }} start: {{ lookup('pipe','date') }}" - - include_tasks: '{{ inventory_hostname }}.yml' - - debug: - msg: "{{ inventory_hostname }} finish: {{ lookup('pipe','date') }}" + - ansible.builtin.debug: + msg: "{{ inventory_hostname }} start: {{ lookup('pipe', 'date') }}" + - ansible.builtin.include_tasks: "{{ inventory_hostname }}.yml" + - ansible.builtin.debug: + msg: "{{ inventory_hostname }} finish: {{ lookup('pipe', 'date') }}" always: - - set_fact: - _role_complete: True + - ansible.builtin.set_fact: + _role_complete: true - vars: completed_hosts: '{{ ansible_play_hosts_all | map("extract", hostvars, "_role_complete") | list | select("defined") | list | length }}' - hosts_in_play: '{{ ansible_play_hosts_all | length }}' - debug: + hosts_in_play: "{{ ansible_play_hosts_all | length }}" + ansible.builtin.debug: msg: "{{ completed_hosts }} of {{ hosts_in_play }} complete" - - include_tasks: env_cleanup.yml + - ansible.builtin.include_tasks: env_cleanup.yml vars: completed_hosts: '{{ ansible_play_hosts_all | map("extract", hostvars, "_role_complete") | list | select("defined") | list | length }}' - hosts_in_play: '{{ ansible_play_hosts_all | length }}' + hosts_in_play: "{{ ansible_play_hosts_all | length }}" when: - - completed_hosts == hosts_in_play + - completed_hosts == hosts_in_play diff --git a/tests/integration/targets/autoscaling_policy/tasks/main.yml b/tests/integration/targets/autoscaling_policy/tasks/main.yml index cd302dc8590..e3e42041f18 100644 --- a/tests/integration/targets/autoscaling_policy/tasks/main.yml +++ b/tests/integration/targets/autoscaling_policy/tasks/main.yml @@ -20,14 +20,14 @@ block: - name: create trivial launch_configuration - ec2_lc: + autoscaling_launch_config: name: "{{ scaling_policy_lc_name }}" state: present instance_type: t3.nano image_id: "{{ ec2_ami_id }}" - name: create trivial ASG - ec2_asg: + autoscaling_group: name: "{{ scaling_policy_asg_name }}" state: present launch_config_name: "{{ scaling_policy_lc_name }}" @@ -36,7 +36,7 @@ desired_capacity: 0 - name: Create Simple Scaling policy using implicit defaults - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_simplescaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: present @@ -50,7 +50,7 @@ - result.changed - name: Update Simple Scaling policy using explicit defaults - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_simplescaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: present @@ -65,7 +65,7 @@ - not result.changed - name: min_adjustment_step is ignored with ChangeInCapacity - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_simplescaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: present @@ -82,7 +82,7 @@ - result.adjustment_type == "ChangeInCapacity" - name: Change Simple Scaling policy adjustment_type to PercentChangeInCapacity - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_simplescaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: present @@ -99,7 +99,7 @@ - result.adjustment_type == "PercentChangeInCapacity" - name: Remove Simple Scaling policy - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_simplescaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: absent @@ -110,7 +110,7 @@ - result.changed - name: Create Step Scaling policy - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_stepscaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: present @@ -130,7 +130,7 @@ - result.changed - name: Add another step - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_stepscaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: present @@ -154,7 +154,7 @@ - result.adjustment_type == "PercentChangeInCapacity" - name: Remove Step Scaling policy - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_stepscaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: absent @@ -165,7 +165,7 @@ - result.changed - name: Remove Step Scaling policy (idemopotency) - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_stepscaling_policy" asg_name: "{{ scaling_policy_asg_name }}" state: absent @@ -177,7 +177,7 @@ - result is successful - name: create TargetTracking predefined policy - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_targettracking_predefined_policy" policy_type: TargetTrackingScaling target_tracking_config: @@ -194,7 +194,7 @@ - result is successful - name: create TargetTrackingScaling predefined policy (idempotency) - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_targettracking_predefined_policy" policy_type: TargetTrackingScaling target_tracking_config: @@ -211,7 +211,7 @@ # # It would be good to also test this but we would need an Target group and an ALB # - name: create TargetTracking predefined policy with resource_label -# ec2_scaling_policy: +# autoscaling_policy: # name: "{{ resource_prefix }}_targettracking_predefined_rl_policy" # policy_type: TargetTrackingScaling # target_tracking_config: @@ -229,7 +229,7 @@ # - result is successful # # - name: create TargetTracking predefined policy with resource_label (idempotency) -# ec2_scaling_policy: +# autoscaling_policy: # name: "{{ resource_prefix }}_targettracking_predefined_rl_policy" # policy_type: TargetTrackingScaling # target_tracking_config: @@ -246,7 +246,7 @@ # - result is not changed - name: create TargetTrackingScaling custom policy - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_targettracking_custom_policy" policy_type: TargetTrackingScaling target_tracking_config: @@ -268,7 +268,7 @@ - result is successful - name: create TargetTrackingScaling custom policy (idempotency) - ec2_scaling_policy: + autoscaling_policy: name: "{{ resource_prefix }}_targettracking_custom_policy" policy_type: TargetTrackingScaling target_tracking_config: @@ -292,7 +292,7 @@ # ============================================================ - name: Remove the scaling policies - ec2_scaling_policy: + autoscaling_policy: name: "{{ item }}" state: absent register: result @@ -305,13 +305,13 @@ ignore_errors: yes - name: remove the ASG - ec2_asg: + autoscaling_group: name: "{{ scaling_policy_asg_name }}" state: absent ignore_errors: yes - name: remove the Launch Configuration - ec2_lc: + autoscaling_launch_config: name: "{{ scaling_policy_lc_name }}" state: absent ignore_errors: yes diff --git a/tests/integration/targets/autoscaling_scheduled_action/tasks/main.yml b/tests/integration/targets/autoscaling_scheduled_action/tasks/main.yml index 2344a795c63..6de1d2dff7a 100644 --- a/tests/integration/targets/autoscaling_scheduled_action/tasks/main.yml +++ b/tests/integration/targets/autoscaling_scheduled_action/tasks/main.yml @@ -29,7 +29,7 @@ register: testing_subnet - name: create a security group with the vpc created in the ec2_setup - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" @@ -45,7 +45,7 @@ register: sg - name: ensure launch configs exist - ec2_lc: + autoscaling_launch_config: name: "{{ resource_prefix }}-lc" assign_public_ip: true image_id: "{{ ec2_ami_id }}" @@ -53,7 +53,7 @@ instance_type: t3.micro - name: Create ASG ready - ec2_asg: + autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" desired_capacity: 1 @@ -70,7 +70,7 @@ ## Create minimal basic scheduled action - name: Create basic scheduled_action - check_mode - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test" start_time: 2027 November 9 08:00 UTC @@ -87,7 +87,7 @@ - scheduled_action is changed - name: Create basic scheduled_action - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test" start_time: 2027 November 9 08:00 UTC @@ -105,7 +105,7 @@ - scheduled_action.desired_capacity == 2 - name: Create basic scheduled_action - idempotent - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test" start_time: 2027 November 9 08:00 UTC @@ -122,7 +122,7 @@ ## Update minimal basic scheduled action - name: Update basic scheduled_action - check_mode - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test" start_time: 2027 November 9 08:00 UTC @@ -140,7 +140,7 @@ - scheduled_action is changed - name: Update basic scheduled_action - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test" start_time: 2027 November 9 08:00 UTC @@ -160,7 +160,7 @@ - scheduled_action.min_size == 3 - name: Update basic scheduled_action - idempotent - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test" start_time: 2027 November 9 08:00 UTC @@ -178,7 +178,7 @@ ## Create advanced scheduled action - name: Create advanced scheduled_action - check_mode - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test" start_time: 2027 November 9 09:00 UTC @@ -199,7 +199,7 @@ - advanced_scheduled_action is changed - name: Create advanced scheduled_action - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test1" start_time: 2027 November 9 09:00 UTC @@ -224,7 +224,7 @@ - advanced_scheduled_action.time_zone == "Europe/London" - name: Create advanced scheduled_action - idempotent - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test1" start_time: 2027 November 9 09:00 UTC @@ -245,7 +245,7 @@ ## Delete scheduled action - name: Delete scheduled_action - check_mode - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test1" state: absent @@ -259,7 +259,7 @@ - scheduled_action_deletion is changed - name: Delete scheduled_action - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test1" state: absent @@ -272,7 +272,7 @@ - scheduled_action_deletion is changed - name: Delete scheduled_action - idempotent - ec2_asg_scheduled_action: + autoscaling_scheduled_action: autoscaling_group_name: "{{ resource_prefix }}-asg" scheduled_action_name: "{{ resource_prefix }}-test1" state: absent @@ -285,7 +285,7 @@ - scheduled_action_deletion is not changed always: - name: Remove ASG - ec2_asg: + autoscaling_group: name: "{{ resource_prefix }}-asg" state: absent register: removed @@ -295,7 +295,7 @@ # Remove the testing dependencies - name: Remove launch configs - ec2_lc: + autoscaling_launch_config: name: "{{ resource_prefix }}-lc" state: absent register: removed @@ -304,7 +304,7 @@ retries: 10 - name: Remove the security group - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/codebuild_project/tasks/description.yml b/tests/integration/targets/codebuild_project/tasks/description.yml index 13c12b5b639..e52c4326f21 100644 --- a/tests/integration/targets/codebuild_project/tasks/description.yml +++ b/tests/integration/targets/codebuild_project/tasks/description.yml @@ -4,14 +4,14 @@ description_two: 'Another_Description - {{ resource_prefix }}' # Mandatory settings module_defaults: - community.aws.aws_codebuild: + community.aws.codebuild_project: name: '{{ project_name }}' # community.aws.aws_codebuild_info: # name: '{{ project_name }}' block: # - name: test setting description aws_codebuild (check mode) -# aws_codebuild: +# codebuild_project: # description: '{{ description_one }}' # register: update_result # check_mode: yes @@ -21,7 +21,7 @@ # - update_result is changed - name: test setting description aws_codebuild - aws_codebuild: + codebuild_project: description: '{{ description_one }}' register: update_result - name: assert that update succeeded @@ -31,7 +31,7 @@ - update_result.project.description == description_one # - name: test setting description aws_codebuild - idempotency (check mode) -# aws_codebuild: +# codebuild_project: # description: '{{ description_one }}' # register: update_result # check_mode: yes @@ -41,7 +41,7 @@ # - update_result is not changed - name: test setting description aws_codebuild - idempotency - aws_codebuild: + codebuild_project: description: '{{ description_one }}' register: update_result - name: assert that update succeeded @@ -53,7 +53,7 @@ ### # - name: test updating description on aws_codebuild (check mode) -# aws_codebuild: +# codebuild_project: # description: '{{ description_two }}' # register: update_result # check_mode: yes @@ -63,7 +63,7 @@ # - update_result is changed - name: test updating description on aws_codebuild - aws_codebuild: + codebuild_project: description: '{{ description_two }}' register: update_result - name: assert that update succeeded @@ -73,7 +73,7 @@ - update_result.project.description == description_two # - name: test updating description on aws_codebuild - idempotency (check mode) -# aws_codebuild: +# codebuild_project: # description: '{{ description_two }}' # register: update_result # check_mode: yes @@ -83,7 +83,7 @@ # - update_result is not changed - name: test updating description on aws_codebuild - idempotency - aws_codebuild: + codebuild_project: description: '{{ description_two }}' register: update_result - name: assert that update succeeded @@ -105,7 +105,7 @@ # ### # - name: test no description param aws_codebuild (check mode) -# aws_codebuild: {} +# codebuild_project: {} # register: update_result # check_mode: yes # - name: assert no change @@ -116,7 +116,7 @@ - name: test no description param aws_codebuild - aws_codebuild: {} + codebuild_project: {} register: update_result - name: assert no change assert: diff --git a/tests/integration/targets/codebuild_project/tasks/main.yml b/tests/integration/targets/codebuild_project/tasks/main.yml index 584c0f3f54c..3f8a22fd7ba 100644 --- a/tests/integration/targets/codebuild_project/tasks/main.yml +++ b/tests/integration/targets/codebuild_project/tasks/main.yml @@ -27,7 +27,7 @@ # ================== integration test ========================================== - name: create CodeBuild project - aws_codebuild: + codebuild_project: name: "{{ project_name }}" description: Build project for testing the Ansible aws_codebuild module service_role: "{{ codebuild_iam_role.iam_role.arn }}" @@ -61,7 +61,7 @@ - output.project.resource_tags.purpose == "ansible-test" - name: idempotence check rerunning same Codebuild task - aws_codebuild: + codebuild_project: name: "{{ project_name }}" description: Build project for testing the Ansible aws_codebuild module service_role: "{{ codebuild_iam_role.iam_role.arn }}" @@ -96,7 +96,7 @@ - include_tasks: 'description.yml' - name: delete CodeBuild project - aws_codebuild: + codebuild_project: name: "{{ output.project.name }}" source: type: CODEPIPELINE diff --git a/tests/integration/targets/codebuild_project/tasks/tagging.yml b/tests/integration/targets/codebuild_project/tasks/tagging.yml index a26f2a33708..2e31df2d87c 100644 --- a/tests/integration/targets/codebuild_project/tasks/tagging.yml +++ b/tests/integration/targets/codebuild_project/tasks/tagging.yml @@ -27,7 +27,7 @@ new_snake_case_key: snake_case_value # Mandatory settings module_defaults: - community.aws.aws_codebuild: + community.aws.codebuild_project: name: '{{ project_name }}' # community.aws.aws_codebuild_info: # name: '{{ project_name }}' @@ -36,7 +36,7 @@ ### # - name: test adding tags to aws_codebuild (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: '{{ first_tags }}' # purge_tags: True # register: update_result @@ -47,7 +47,7 @@ # - update_result is changed - name: test adding tags to aws_codebuild - aws_codebuild: + codebuild_project: resource_tags: '{{ first_tags }}' purge_tags: True register: update_result @@ -58,7 +58,7 @@ - update_result.project.resource_tags == first_tags # - name: test adding tags to aws_codebuild - idempotency (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: '{{ first_tags }}' # purge_tags: True # register: update_result @@ -69,7 +69,7 @@ # - update_result is not changed - name: test adding tags to aws_codebuild - idempotency - aws_codebuild: + codebuild_project: resource_tags: '{{ first_tags }}' purge_tags: True register: update_result @@ -82,7 +82,7 @@ ### # - name: test updating tags with purge on aws_codebuild (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: '{{ second_tags }}' # purge_tags: True # register: update_result @@ -93,7 +93,7 @@ # - update_result is changed - name: test updating tags with purge on aws_codebuild - aws_codebuild: + codebuild_project: resource_tags: '{{ second_tags }}' purge_tags: True register: update_result @@ -104,7 +104,7 @@ - update_result.project.resource_tags == second_tags # - name: test updating tags with purge on aws_codebuild - idempotency (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: '{{ second_tags }}' # purge_tags: True # register: update_result @@ -115,7 +115,7 @@ # - update_result is not changed - name: test updating tags with purge on aws_codebuild - idempotency - aws_codebuild: + codebuild_project: resource_tags: '{{ second_tags }}' purge_tags: True register: update_result @@ -128,7 +128,7 @@ ### # - name: test updating tags without purge on aws_codebuild (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: '{{ third_tags }}' # purge_tags: False # register: update_result @@ -139,7 +139,7 @@ # - update_result is changed - name: test updating tags without purge on aws_codebuild - aws_codebuild: + codebuild_project: resource_tags: '{{ third_tags }}' purge_tags: False register: update_result @@ -150,7 +150,7 @@ - update_result.project.resource_tags == final_tags # - name: test updating tags without purge on aws_codebuild - idempotency (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: '{{ third_tags }}' # purge_tags: False # register: update_result @@ -161,7 +161,7 @@ # - update_result is not changed - name: test updating tags without purge on aws_codebuild - idempotency - aws_codebuild: + codebuild_project: resource_tags: '{{ third_tags }}' purge_tags: False register: update_result @@ -184,7 +184,7 @@ # ### # - name: test no tags param aws_codebuild (check mode) -# aws_codebuild: {} +# codebuild_project: {} # register: update_result # check_mode: yes # - name: assert no change @@ -195,7 +195,7 @@ # - name: test no tags param aws_codebuild - aws_codebuild: {} + codebuild_project: {} register: update_result - name: assert no change assert: @@ -206,7 +206,7 @@ ### # - name: test removing tags from aws_codebuild (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: {} # purge_tags: True # register: update_result @@ -217,7 +217,7 @@ # - update_result is changed - name: test removing tags from aws_codebuild - aws_codebuild: + codebuild_project: resource_tags: {} purge_tags: True register: update_result @@ -228,7 +228,7 @@ - update_result.project.resource_tags == {} # - name: test removing tags from aws_codebuild - idempotency (check mode) -# aws_codebuild: +# codebuild_project: # resource_tags: {} # purge_tags: True # register: update_result @@ -239,7 +239,7 @@ # - update_result is not changed - name: test removing tags from aws_codebuild - idempotency - aws_codebuild: + codebuild_project: resource_tags: {} purge_tags: True register: update_result diff --git a/tests/integration/targets/codecommit_repository/tasks/main.yml b/tests/integration/targets/codecommit_repository/tasks/main.yml index fe93aae03d7..20c09fd8b6d 100644 --- a/tests/integration/targets/codecommit_repository/tasks/main.yml +++ b/tests/integration/targets/codecommit_repository/tasks/main.yml @@ -8,7 +8,7 @@ block: # ============================================================ - name: Create a repository (CHECK MODE) - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" description: original comment state: present @@ -19,7 +19,7 @@ - output is changed - name: Create a repository - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" description: original comment state: present @@ -31,7 +31,7 @@ - output.repository_metadata.repository_description == 'original comment' - name: No-op update to repository - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" description: original comment state: present @@ -43,7 +43,7 @@ - output.repository_metadata.repository_description == 'original comment' - name: Update repository description (CHECK MODE) - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" description: new comment state: present @@ -56,7 +56,7 @@ - output.repository_metadata.repository_description == 'original comment' - name: Update repository description - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" description: new comment state: present @@ -69,7 +69,7 @@ # ============================================================ - name: Delete a repository (CHECK MODE) - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" state: absent register: output @@ -79,7 +79,7 @@ - output is changed - name: Delete a repository - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" state: absent register: output @@ -88,7 +88,7 @@ - output is changed - name: Delete a non-existent repository - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" state: absent register: output @@ -97,7 +97,7 @@ - output is not changed - name: Create a repository without description - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" state: present register: output @@ -107,7 +107,7 @@ - output.repository_metadata.repository_name == '{{ resource_prefix }}_repo' - name: No-op update to repository without description - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" state: present register: output @@ -117,7 +117,7 @@ - output.repository_metadata.repository_name == '{{ resource_prefix }}_repo' - name: Delete a repository without description - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" state: absent register: output @@ -128,7 +128,7 @@ always: ###### TEARDOWN STARTS HERE ###### - name: Delete a repository - aws_codecommit: + codecommit_repository: name: "{{ resource_prefix }}_repo" state: absent ignore_errors: yes diff --git a/tests/integration/targets/codepipeline/tasks/main.yml b/tests/integration/targets/codepipeline/tasks/main.yml index 04feb1eefd8..4e6e4368315 100644 --- a/tests/integration/targets/codepipeline/tasks/main.yml +++ b/tests/integration/targets/codepipeline/tasks/main.yml @@ -23,7 +23,7 @@ # ================== integration test ========================================== - name: create CodePipeline - aws_codepipeline: + codepipeline: name: "{{ codepipeline_name }}" role_arn: "{{ codepipeline_iam_role.iam_role.arn }}" artifact_store: @@ -70,7 +70,7 @@ - output.pipeline.stages|length > 1 - name: idempotence check rerunning same CodePipeline task - aws_codepipeline: + codepipeline: name: "{{ codepipeline_name }}" role_arn: "{{ codepipeline_iam_role.iam_role.arn }}" artifact_store: @@ -113,7 +113,7 @@ - rerun_test_output.pipeline == output.pipeline - name: Test deletion of CodePipeline - aws_codepipeline: + codepipeline: name: "{{ codepipeline_name }}" role_arn: '' artifact_store: {} @@ -131,7 +131,7 @@ always: - name: Cleanup - delete test CodePipeline - aws_codepipeline: + codepipeline: name: "{{ codepipeline_name }}" role_arn: '' artifact_store: {} diff --git a/tests/integration/targets/config/tasks/main.yaml b/tests/integration/targets/config/tasks/main.yaml index 0c7daa2bb4f..244c4b29b7b 100644 --- a/tests/integration/targets/config/tasks/main.yaml +++ b/tests/integration/targets/config/tasks/main.yaml @@ -62,7 +62,7 @@ # Module requirement testing # ============================================================ - name: test rule with no source parameter - aws_config_rule: + config_rule: name: random_name state: present register: output @@ -75,7 +75,7 @@ - 'output.msg.startswith("missing required arguments:")' - name: test resource_type delivery_channel with no s3_bucket parameter - aws_config_delivery_channel: + config_delivery_channel: name: random_name state: present register: output @@ -88,7 +88,7 @@ - 'output.msg.startswith("missing required arguments:")' - name: test resource_type configuration_recorder with no role_arn parameter - aws_config_recorder: + config_recorder: name: random_name state: present register: output @@ -101,7 +101,7 @@ - 'output.msg.startswith("state is present but all of the following are missing")' - name: test resource_type configuration_recorder with no recording_group parameter - aws_config_recorder: + config_recorder: name: random_name state: present role_arn: 'arn:aws:iam::123456789012:role/AwsConfigRecorder' @@ -115,7 +115,7 @@ - 'output.msg.startswith("state is present but all of the following are missing")' - name: test resource_type aggregation_authorization with no authorized_account_id parameter - aws_config_aggregation_authorization: + config_aggregation_authorization: state: present register: output ignore_errors: true @@ -127,7 +127,7 @@ - 'output.msg.startswith("missing required arguments:")' - name: test resource_type aggregation_authorization with no authorized_aws_region parameter - aws_config_aggregation_authorization: + config_aggregation_authorization: state: present authorized_account_id: '123456789012' register: output @@ -140,7 +140,7 @@ - 'output.msg.startswith("missing required arguments:")' - name: test resource_type configuration_aggregator with no account_sources parameter - aws_config_aggregator: + config_aggregator: name: random_name state: present register: output @@ -153,7 +153,7 @@ - 'output.msg.startswith("missing required arguments: account_sources")' - name: test resource_type configuration_aggregator with no organization_source parameter - aws_config_aggregator: + config_aggregator: name: random_name state: present account_sources: [] @@ -170,7 +170,7 @@ # Creation testing # ============================================================ - name: Create Configuration Recorder for AWS Config - aws_config_recorder: + config_recorder: name: '{{ resource_prefix }}-recorder' state: present role_arn: "{{ config_iam_role.arn }}" @@ -184,7 +184,7 @@ - output.changed - name: Create Delivery Channel for AWS Config - aws_config_delivery_channel: + config_delivery_channel: name: '{{ resource_prefix }}-channel' state: present s3_bucket: "{{ config_s3_bucket }}" @@ -198,7 +198,7 @@ - output.changed - name: Create Delivery Channel for AWS Config with a KMS key - aws_config_delivery_channel: + config_delivery_channel: name: '{{ resource_prefix }}-channel' state: present s3_bucket: "{{ config_s3_bucket }}" @@ -213,7 +213,7 @@ - output.changed - name: Create Config Rule for AWS Config - aws_config_rule: + config_rule: name: '{{ resource_prefix }}-rule' state: present description: 'This AWS Config rule checks for public write access on S3 buckets' @@ -230,7 +230,7 @@ - output.changed - name: Create aws_config_aggregator - aws_config_aggregator: + config_aggregator: name: random_name state: present account_sources: [] @@ -245,7 +245,7 @@ - output is changed - name: Create aws_config_aggregator - idempotency - aws_config_aggregator: + config_aggregator: name: random_name state: present account_sources: [] @@ -263,7 +263,7 @@ # Update testing # ============================================================ - name: Update Configuration Recorder - aws_config_recorder: + config_recorder: name: '{{ resource_prefix }}-recorder' state: present role_arn: "{{ config_iam_role.arn }}" @@ -279,7 +279,7 @@ - output.changed - name: Update Delivery Channel - aws_config_delivery_channel: + config_delivery_channel: name: '{{ resource_prefix }}-channel' state: present s3_bucket: "{{ config_s3_bucket }}" @@ -292,7 +292,7 @@ - output.changed - name: Update Delivery Channel with KMS key - aws_config_delivery_channel: + config_delivery_channel: name: '{{ resource_prefix }}-channel' state: present s3_bucket: "{{ config_s3_bucket }}" @@ -306,7 +306,7 @@ - output.changed - name: Update Config Rule - aws_config_rule: + config_rule: name: '{{ resource_prefix }}-rule' state: present description: 'This AWS Config rule checks for public write access on S3 buckets' @@ -323,7 +323,7 @@ - output.changed - name: Update Config Rule - idempotency - aws_config_rule: + config_rule: name: '{{ resource_prefix }}-rule' state: present description: 'This AWS Config rule checks for public write access on S3 buckets' @@ -340,7 +340,7 @@ - output is not changed - name: Update aws_config_aggregator - aws_config_aggregator: + config_aggregator: name: random_name state: present account_sources: [] @@ -357,7 +357,7 @@ - output is changed - name: Update aws_config_aggregator - idempotency - aws_config_aggregator: + config_aggregator: name: random_name state: present account_sources: [] @@ -377,7 +377,7 @@ # Read testing # ============================================================ - name: Don't update Configuration Recorder - aws_config_recorder: + config_recorder: name: '{{ resource_prefix }}-recorder' state: present role_arn: "{{ config_iam_role.arn }}" @@ -393,7 +393,7 @@ - not output.changed - name: Don't update Delivery Channel - aws_config_delivery_channel: + config_delivery_channel: name: '{{ resource_prefix }}-channel' state: present s3_bucket: "{{ config_s3_bucket }}" @@ -406,7 +406,7 @@ - not output.changed - name: Don't update Config Rule - aws_config_rule: + config_rule: name: '{{ resource_prefix }}-rule' state: present description: 'This AWS Config rule checks for public write access on S3 buckets' @@ -425,7 +425,7 @@ always: - name: delete aws_config_aggregator - aws_config_aggregator: + config_aggregator: name: random_name state: absent register: output @@ -435,7 +435,7 @@ # Destroy testing # ============================================================ - name: Destroy Configuration Recorder - aws_config_recorder: + config_recorder: name: '{{ resource_prefix }}-recorder' state: absent register: output @@ -446,7 +446,7 @@ # - output.changed - name: Destroy Delivery Channel - aws_config_delivery_channel: + config_delivery_channel: name: '{{ resource_prefix }}-channel' state: absent s3_bucket: "{{ config_s3_bucket }}" @@ -460,7 +460,7 @@ # - output.changed - name: Destroy Config Rule - aws_config_rule: + config_rule: name: '{{ resource_prefix }}-rule' state: absent description: 'This AWS Config rule checks for public write access on S3 buckets' diff --git a/tests/integration/targets/ec2_launch_template/tasks/tags_and_vpc_settings.yml b/tests/integration/targets/ec2_launch_template/tasks/tags_and_vpc_settings.yml index 026c59907c0..41ff9082b76 100644 --- a/tests/integration/targets/ec2_launch_template/tasks/tags_and_vpc_settings.yml +++ b/tests/integration/targets/ec2_launch_template/tasks/tags_and_vpc_settings.yml @@ -31,7 +31,7 @@ register: testing_subnet_b - name: create a security group with the vpc - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" @@ -164,7 +164,7 @@ always: - name: remove the security group - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/ec2_placement_group/tasks/env_cleanup.yml b/tests/integration/targets/ec2_placement_group/tasks/env_cleanup.yml index 9e5ae6a9380..ce626b69c3d 100644 --- a/tests/integration/targets/ec2_placement_group/tasks/env_cleanup.yml +++ b/tests/integration/targets/ec2_placement_group/tasks/env_cleanup.yml @@ -24,7 +24,7 @@ retries: 10 - name: remove the security group - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/ec2_placement_group/tasks/env_setup.yml b/tests/integration/targets/ec2_placement_group/tasks/env_setup.yml index 88f5bb6fe22..d48bae66c83 100644 --- a/tests/integration/targets/ec2_placement_group/tasks/env_setup.yml +++ b/tests/integration/targets/ec2_placement_group/tasks/env_setup.yml @@ -48,7 +48,7 @@ - "{{ testing_subnet_b.subnet.id }}" - name: create a security group with the vpc - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/ecs_cluster/tasks/01_create_requirements.yml b/tests/integration/targets/ecs_cluster/tasks/01_create_requirements.yml index 0d07add14ab..14c1b6337b7 100644 --- a/tests/integration/targets/ecs_cluster/tasks/01_create_requirements.yml +++ b/tests/integration/targets/ecs_cluster/tasks/01_create_requirements.yml @@ -72,7 +72,7 @@ register: igw - name: create a security group to use for creating an ec2 instance - ec2_group: + ec2_security_group: name: '{{ resource_prefix }}_ecs_cluster-sg' description: 'created by Ansible integration tests' state: present diff --git a/tests/integration/targets/ecs_cluster/tasks/99_terminate_everything.yml b/tests/integration/targets/ecs_cluster/tasks/99_terminate_everything.yml index 7d43cf47494..5d7ba5c72d9 100644 --- a/tests/integration/targets/ecs_cluster/tasks/99_terminate_everything.yml +++ b/tests/integration/targets/ecs_cluster/tasks/99_terminate_everything.yml @@ -261,7 +261,7 @@ register: this_deletion - name: remove security groups - ec2_group: + ec2_security_group: name: '{{ item }}' description: 'created by Ansible integration tests' state: absent diff --git a/tests/integration/targets/ecs_ecr/tasks/main.yml b/tests/integration/targets/ecs_ecr/tasks/main.yml index 2b6773a7bc4..88a31fbe9ff 100644 --- a/tests/integration/targets/ecs_ecr/tasks/main.yml +++ b/tests/integration/targets/ecs_ecr/tasks/main.yml @@ -15,7 +15,7 @@ register: aws_caller_info - name: create KMS key for testing - aws_kms: + kms_key: alias: "{{ resource_prefix }}-ecr" description: a key used for testing ECR state: present @@ -607,6 +607,6 @@ state: absent - name: Delete KMS key - aws_kms: + kms_key: key_id: '{{ kms_test_key.key_arn }}' state: absent diff --git a/tests/integration/targets/efs/tasks/main.yml b/tests/integration/targets/efs/tasks/main.yml index 5100927100d..19e0ee7a5a9 100644 --- a/tests/integration/targets/efs/tasks/main.yml +++ b/tests/integration/targets/efs/tasks/main.yml @@ -41,7 +41,7 @@ register: testing_subnet_b - name: Get default security group id for vpc - ec2_group_info: + ec2_security_group_info: filters: vpc-id: "{{ testing_vpc.vpc.id }}" register: sg_facts diff --git a/tests/integration/targets/eks_cluster/tasks/full_test.yml b/tests/integration/targets/eks_cluster/tasks/full_test.yml index bc6ebedea2a..71cc1fc87e5 100644 --- a/tests/integration/targets/eks_cluster/tasks/full_test.yml +++ b/tests/integration/targets/eks_cluster/tasks/full_test.yml @@ -4,7 +4,7 @@ # If us-west-1 does become supported, change this test to use an unsupported region # or if all regions are supported, delete this test - name: attempt to use eks in unsupported region - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" state: absent access_key: "{{ aws_access_key }}" @@ -21,7 +21,7 @@ - '"msg" in aws_eks_unsupported_region' - name: delete an as yet non-existent EKS cluster - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" state: absent register: aws_eks_delete_non_existent @@ -64,7 +64,7 @@ - "{{ eks_subnets }}" - name: create security groups to use for EKS - ec2_group: + ec2_security_group: name: "{{ item.name }}" description: "{{ item.description }}" state: present @@ -75,7 +75,7 @@ register: setup_security_groups - name: create EKS cluster - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" security_groups: "{{ eks_security_groups | map(attribute='name') }}" subnets: "{{ setup_subnets.results | map(attribute='subnet.id') }}" @@ -93,7 +93,7 @@ - eks_create.tags.another == "foobar" - name: create EKS cluster with same details but wait for it to become active - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" security_groups: "{{ eks_security_groups | map(attribute='name') }}" subnets: "{{ setup_subnets.results | map(attribute='subnet.id') }}" @@ -113,7 +113,7 @@ - eks_create.endpoint != "" - name: create EKS cluster with same details but using SG ids - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" security_groups: "{{ setup_security_groups.results | map(attribute='group_id') }}" subnets: "{{ setup_subnets.results | map(attribute='subnet.id') }}" @@ -127,7 +127,7 @@ - eks_create.name == eks_cluster_name - name: remove EKS cluster, waiting until complete - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" state: absent wait: yes @@ -139,7 +139,7 @@ - eks_delete is changed - name: create EKS cluster with same details but wait for it to become active - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" security_groups: "{{ eks_security_groups | map(attribute='name') }}" subnets: "{{ setup_subnets.results | map(attribute='subnet.id') }}" @@ -154,7 +154,7 @@ - eks_create.name == eks_cluster_name - name: remove EKS cluster, without waiting this time - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" state: absent register: eks_delete @@ -165,7 +165,7 @@ - eks_delete is changed - name: create EKS cluster with short name - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_short_name }}" security_groups: "{{ eks_security_groups | map(attribute='name') }}" subnets: "{{ setup_subnets.results | map(attribute='subnet.id') }}" @@ -180,7 +180,7 @@ - eks_create is not failed - name: remove EKS cluster with short name - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_short_name }}" state: absent wait: yes @@ -192,7 +192,7 @@ msg: "***** TESTING COMPLETE. COMMENCE TEARDOWN *****" - name: remove EKS cluster - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_name }}" state: absent wait: yes @@ -200,7 +200,7 @@ ignore_errors: yes - name: remove EKS cluster - aws_eks_cluster: + eks_cluster: name: "{{ eks_cluster_short_name }}" state: absent wait: yes @@ -216,7 +216,7 @@ - name: "{{ eks_cluster_name }}-workers-sg" - name: set all security group rule lists to empty to remove circular dependency - ec2_group: + ec2_security_group: name: "{{ item.name }}" description: "{{ item.description }}" state: present @@ -229,7 +229,7 @@ ignore_errors: yes - name: remove security groups - ec2_group: + ec2_security_group: name: '{{ item.name }}' state: absent vpc_id: '{{ setup_vpc.vpc.id }}' diff --git a/tests/integration/targets/eks_fargate_profile/tasks/cleanup_eks_cluster.yml b/tests/integration/targets/eks_fargate_profile/tasks/cleanup_eks_cluster.yml index d30761fa3ce..21adb30a8b7 100644 --- a/tests/integration/targets/eks_fargate_profile/tasks/cleanup_eks_cluster.yml +++ b/tests/integration/targets/eks_fargate_profile/tasks/cleanup_eks_cluster.yml @@ -5,7 +5,7 @@ ignore_errors: true - name: remove EKS cluster - aws_eks_cluster: + eks_cluster: name: '{{ eks_cluster_name }}' state: absent wait: 'yes' @@ -17,7 +17,7 @@ - name: '{{ eks_cluster_name }}-workers-sg' - name: set all security group rule lists to empty to remove circular dependency - ec2_group: + ec2_security_group: name: '{{ item.name }}' description: '{{ item.description }}' state: present @@ -30,7 +30,7 @@ ignore_errors: 'yes' - name: remove security groups - ec2_group: + ec2_security_group: name: '{{ item.name }}' state: absent vpc_id: '{{ setup_vpc.vpc.id }}' diff --git a/tests/integration/targets/eks_fargate_profile/tasks/create_eks_cluster.yml b/tests/integration/targets/eks_fargate_profile/tasks/create_eks_cluster.yml index 6023b190492..48fbbef8017 100644 --- a/tests/integration/targets/eks_fargate_profile/tasks/create_eks_cluster.yml +++ b/tests/integration/targets/eks_fargate_profile/tasks/create_eks_cluster.yml @@ -72,7 +72,7 @@ register: nat_route_table - name: create security groups to use for EKS - ec2_group: + ec2_security_group: name: '{{ item.name }}' description: '{{ item.description }}' state: present @@ -83,7 +83,7 @@ register: setup_security_groups - name: create EKS cluster - aws_eks_cluster: + eks_cluster: name: '{{ eks_cluster_name }}' security_groups: '{{ eks_security_groups | map(attribute=''name'') }}' subnets: '{{ setup_subnets.results | map(attribute=''subnet.id'') }}' diff --git a/tests/integration/targets/eks_nodegroup/tasks/cleanup.yml b/tests/integration/targets/eks_nodegroup/tasks/cleanup.yml index ff841f0f5ec..20db67c6c6a 100644 --- a/tests/integration/targets/eks_nodegroup/tasks/cleanup.yml +++ b/tests/integration/targets/eks_nodegroup/tasks/cleanup.yml @@ -5,7 +5,7 @@ ignore_errors: yes - name: remove EKS cluster - aws_eks_cluster: + eks_cluster: name: '{{ eks_cluster_name }}' state: absent wait: 'yes' @@ -17,7 +17,7 @@ - name: '{{ eks_cluster_name }}-workers-sg' - name: set all security group rule lists to empty to remove circular dependency - ec2_group: + ec2_security_group: name: '{{ item.name }}' description: '{{ item.description }}' state: present @@ -30,7 +30,7 @@ ignore_errors: 'yes' - name: remove security groups - ec2_group: + ec2_security_group: name: '{{ item.name }}' state: absent vpc_id: '{{ setup_vpc.vpc.id }}' diff --git a/tests/integration/targets/eks_nodegroup/tasks/dependecies.yml b/tests/integration/targets/eks_nodegroup/tasks/dependecies.yml index dd6efd27af6..7289930c96d 100644 --- a/tests/integration/targets/eks_nodegroup/tasks/dependecies.yml +++ b/tests/integration/targets/eks_nodegroup/tasks/dependecies.yml @@ -52,7 +52,7 @@ register: public_route_table - name: create security groups to use for EKS - ec2_group: + ec2_security_group: name: '{{ item.name }}' description: '{{ item.description }}' state: present @@ -63,7 +63,7 @@ register: setup_security_groups - name: create EKS cluster - aws_eks_cluster: + eks_cluster: name: '{{ eks_cluster_name }}' security_groups: '{{ eks_security_groups | map(attribute=''name'') }}' subnets: '{{ setup_subnets.results | map(attribute=''subnet.id'') }}' diff --git a/tests/integration/targets/elasticache/tasks/main.yml b/tests/integration/targets/elasticache/tasks/main.yml index 84604274daf..6e567fe687c 100644 --- a/tests/integration/targets/elasticache/tasks/main.yml +++ b/tests/integration/targets/elasticache/tasks/main.yml @@ -64,7 +64,7 @@ - elasticache_redis.elasticache.data.CacheSubnetGroupName == "{{ elasticache_subnet_group_name }}" - name: Add security group for Redis access in Elasticache - ec2_group: + ec2_security_group: name: "{{ elasticache_redis_sg_name }}" description: Allow access to Elasticache Redis for testing EC module vpc_id: "{{ elasticache_vpc.vpc.id }}" @@ -186,7 +186,7 @@ state: absent - name: Make sure Redis Security Group is deleted again - ec2_group: + ec2_security_group: name: "{{ elasticache_redis_sg_name }}" state: absent diff --git a/tests/integration/targets/elasticbeanstalk_app/tasks/main.yml b/tests/integration/targets/elasticbeanstalk_app/tasks/main.yml index 43124d562ba..e1deb9df988 100644 --- a/tests/integration/targets/elasticbeanstalk_app/tasks/main.yml +++ b/tests/integration/targets/elasticbeanstalk_app/tasks/main.yml @@ -12,7 +12,7 @@ # ============================================================ - name: test with no parameters - aws_elasticbeanstalk_app: + elasticbeanstalk_app: register: result ignore_errors: true @@ -23,7 +23,7 @@ # ============================================================ - name: test create app - aws_elasticbeanstalk_app: + elasticbeanstalk_app: app_name: "{{ app_name }}" description: "{{ description }}" state: present @@ -36,7 +36,7 @@ # ============================================================ - name: test create when app already exists - aws_elasticbeanstalk_app: + elasticbeanstalk_app: app_name: "{{ app_name }}" description: "{{ description }}" state: present @@ -49,7 +49,7 @@ # ============================================================ - name: make an update to an existing app - aws_elasticbeanstalk_app: + elasticbeanstalk_app: app_name: "{{ app_name }}" description: "{{ alternate_description }}" state: present @@ -62,7 +62,7 @@ # # ============================================================ # - name: fail deleting an app that has environments that exist -# aws_elasticbeanstalk_app: +# elasticbeanstalk_app: # app_name: "non_app" # state: absent # register: result @@ -75,7 +75,7 @@ # # ============================================================ # - name: deleting an app that has environments that exist with terminate_by_force True -# aws_elasticbeanstalk_app: +# elasticbeanstalk_app: # app_name: "non_app" # state: absent # terminate_by_force: True @@ -98,7 +98,7 @@ # # ============================================================ # - name: deleting an app that has environments that exist with terminate_by_force True -# aws_elasticbeanstalk_app: +# elasticbeanstalk_app: # app_name: "non_app" # state: absent # terminate_by_force: True @@ -111,7 +111,7 @@ # # ============================================================ - name: delete non existent app - aws_elasticbeanstalk_app: + elasticbeanstalk_app: app_name: "non_app" state: absent register: result @@ -125,7 +125,7 @@ # ============================================================ - name: delete existing app - aws_elasticbeanstalk_app: + elasticbeanstalk_app: app_name: "{{ app_name }}" state: absent register: result @@ -140,6 +140,6 @@ always: - name: delete existing app - aws_elasticbeanstalk_app: + elasticbeanstalk_app: app_name: "{{ app_name }}" state: absent diff --git a/tests/integration/targets/elb_instance/tasks/cleanup_instances.yml b/tests/integration/targets/elb_instance/tasks/cleanup_instances.yml index 7ae91ac00b7..262bc99b2f0 100644 --- a/tests/integration/targets/elb_instance/tasks/cleanup_instances.yml +++ b/tests/integration/targets/elb_instance/tasks/cleanup_instances.yml @@ -9,14 +9,14 @@ ignore_errors: true - name: Delete ASG - ec2_asg: + autoscaling_group: name: '{{ asg_name }}' state: absent ignore_errors: true register: ec2_asg_a - name: Delete Launch Template - ec2_lc: + autoscaling_launch_config: name: '{{ lc_name }}' state: absent ignore_errors: true diff --git a/tests/integration/targets/elb_instance/tasks/cleanup_vpc.yml b/tests/integration/targets/elb_instance/tasks/cleanup_vpc.yml index 9abeb74a279..754b685f64f 100644 --- a/tests/integration/targets/elb_instance/tasks/cleanup_vpc.yml +++ b/tests/integration/targets/elb_instance/tasks/cleanup_vpc.yml @@ -1,6 +1,6 @@ --- - name: delete security groups - ec2_group: + ec2_security_group: name: '{{ item }}' state: absent ignore_errors: true diff --git a/tests/integration/targets/elb_instance/tasks/manage_asgs.yml b/tests/integration/targets/elb_instance/tasks/manage_asgs.yml index f0e9db601b5..ea726b8fe5c 100644 --- a/tests/integration/targets/elb_instance/tasks/manage_asgs.yml +++ b/tests/integration/targets/elb_instance/tasks/manage_asgs.yml @@ -1,6 +1,6 @@ --- - name: Get ASG info - ec2_asg_info: + autoscaling_group_info: name: "{{ asg_name }}$" register: asg_info diff --git a/tests/integration/targets/elb_instance/tasks/setup_instances.yml b/tests/integration/targets/elb_instance/tasks/setup_instances.yml index b89b38d20bd..455a9886b8c 100644 --- a/tests/integration/targets/elb_instance/tasks/setup_instances.yml +++ b/tests/integration/targets/elb_instance/tasks/setup_instances.yml @@ -25,7 +25,7 @@ instance_b: "{{ ec2_instance_b.instance_ids[0] }}" - name: Create a Launch Template - ec2_lc: + autoscaling_launch_config: name: "{{ lc_name }}" image_id: "{{ ec2_ami_id }}" security_groups: "{{ sg_a }}" @@ -34,7 +34,7 @@ register: ec2_lc_a - name: Create an ASG - ec2_asg: + autoscaling_group: name: "{{ asg_name }}" load_balancers: - "{{ elb_name_1 }}" diff --git a/tests/integration/targets/elb_instance/tasks/setup_vpc.yml b/tests/integration/targets/elb_instance/tasks/setup_vpc.yml index 26fafa41c94..60c85b8eb34 100644 --- a/tests/integration/targets/elb_instance/tasks/setup_vpc.yml +++ b/tests/integration/targets/elb_instance/tasks/setup_vpc.yml @@ -32,7 +32,7 @@ register: setup_subnet_2 - name: create a security group - ec2_group: + ec2_security_group: name: '{{ sg_name_1 }}' description: 'created by Ansible integration tests' state: present @@ -45,7 +45,7 @@ register: setup_sg_1 - name: create a security group - ec2_group: + ec2_security_group: name: '{{ sg_name_2 }}' description: 'created by Ansible integration tests' state: present diff --git a/tests/integration/targets/elb_network_lb/tasks/main.yml b/tests/integration/targets/elb_network_lb/tasks/main.yml index 16739543d04..e277fffd713 100644 --- a/tests/integration/targets/elb_network_lb/tasks/main.yml +++ b/tests/integration/targets/elb_network_lb/tasks/main.yml @@ -89,7 +89,7 @@ gateway_id: "{{ igw.gateway_id }}" register: route_table - - ec2_group: + - ec2_security_group: name: "{{ resource_prefix }}" description: "security group for Ansible NLB integration tests" state: present @@ -173,7 +173,7 @@ ignore_errors: yes - name: destroy sec group - ec2_group: + ec2_security_group: name: "{{ sec_group.group_name }}" description: "security group for Ansible NLB integration tests" state: absent diff --git a/tests/integration/targets/elb_network_lb/tasks/test_nlb_with_asg.yml b/tests/integration/targets/elb_network_lb/tasks/test_nlb_with_asg.yml index 06fab22b513..295e5e46904 100644 --- a/tests/integration/targets/elb_network_lb/tasks/test_nlb_with_asg.yml +++ b/tests/integration/targets/elb_network_lb/tasks/test_nlb_with_asg.yml @@ -1,17 +1,17 @@ - block: # create instances - - ec2_asg: + - autoscaling_group: state: absent name: "{{ resource_prefix }}-webservers" wait_timeout: 900 - - ec2_lc: + - autoscaling_launch_config: name: "{{ resource_prefix }}-web-lcfg" state: absent - name: Create launch config for testing - ec2_lc: + autoscaling_launch_config: name: "{{ resource_prefix }}-web-lcfg" assign_public_ip: true image_id: "{{ ec2_ami_id }}" @@ -31,7 +31,7 @@ delete_on_termination: true - name: Create autoscaling group for app server fleet - ec2_asg: + autoscaling_group: name: "{{ resource_prefix }}-webservers" vpc_zone_identifier: "{{ nlb_subnets }}" launch_config_name: "{{ resource_prefix }}-web-lcfg" @@ -50,13 +50,13 @@ always: - - ec2_asg: + - autoscaling_group: state: absent name: "{{ resource_prefix }}-webservers" wait_timeout: 900 ignore_errors: yes - - ec2_lc: + - autoscaling_launch_config: name: "{{ resource_prefix }}-web-lcfg" state: absent ignore_errors: yes diff --git a/tests/integration/targets/elb_target/tasks/alb_target.yml b/tests/integration/targets/elb_target/tasks/alb_target.yml index d3638a63c8a..446b5903159 100644 --- a/tests/integration/targets/elb_target/tasks/alb_target.yml +++ b/tests/integration/targets/elb_target/tasks/alb_target.yml @@ -51,7 +51,7 @@ register: route_table - name: create testing security group - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ vpc.vpc.id }}" @@ -177,7 +177,7 @@ ignore_errors: true - name: remove testing security group - ec2_group: + ec2_security_group: state: absent name: "{{ resource_prefix }}-sg" register: removed diff --git a/tests/integration/targets/elb_target/tasks/ec2_target.yml b/tests/integration/targets/elb_target/tasks/ec2_target.yml index 611aca26f13..af11b655f9e 100644 --- a/tests/integration/targets/elb_target/tasks/ec2_target.yml +++ b/tests/integration/targets/elb_target/tasks/ec2_target.yml @@ -58,7 +58,7 @@ register: route_table - name: create testing security group - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ vpc.vpc.id }}" @@ -603,7 +603,7 @@ ignore_errors: true - name: remove testing security group - ec2_group: + ec2_security_group: state: absent name: "{{ resource_prefix }}-sg" register: removed diff --git a/tests/integration/targets/elb_target_info/tasks/main.yml b/tests/integration/targets/elb_target_info/tasks/main.yml index 201620c3f31..031a1c7177c 100644 --- a/tests/integration/targets/elb_target_info/tasks/main.yml +++ b/tests/integration/targets/elb_target_info/tasks/main.yml @@ -66,7 +66,7 @@ register: route_table - name: create testing security group - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ vpc.vpc.id }}" @@ -407,7 +407,7 @@ ignore_errors: true - name: remove testing security group - ec2_group: + ec2_security_group: state: absent name: "{{ resource_prefix }}-sg" description: a security group for ansible tests diff --git a/tests/integration/targets/glue_connection/tasks/test_connection_jdbc.yml b/tests/integration/targets/glue_connection/tasks/test_connection_jdbc.yml index 966d8156f9d..a3b052ba933 100644 --- a/tests/integration/targets/glue_connection/tasks/test_connection_jdbc.yml +++ b/tests/integration/targets/glue_connection/tasks/test_connection_jdbc.yml @@ -5,7 +5,7 @@ # TODO: description, match_criteria, security_groups, and subnet_id are unused module options - name: create glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" connection_properties: JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}" @@ -19,7 +19,7 @@ - result.changed - name: test idempotence creating glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" connection_properties: JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}" @@ -33,7 +33,7 @@ - not result.changed - name: test updating JDBC connection url - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" connection_properties: JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}-updated" @@ -47,7 +47,7 @@ - result.changed - name: delete glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" state: absent register: result @@ -57,7 +57,7 @@ - result.changed - name: test idempotence removing glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" state: absent register: result @@ -69,6 +69,6 @@ always: - name: delete glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" state: absent diff --git a/tests/integration/targets/glue_connection/tasks/test_connection_network.yml b/tests/integration/targets/glue_connection/tasks/test_connection_network.yml index 2300155851b..bc7d5cb4cf9 100644 --- a/tests/integration/targets/glue_connection/tasks/test_connection_network.yml +++ b/tests/integration/targets/glue_connection/tasks/test_connection_network.yml @@ -26,7 +26,7 @@ register: glue_subnet_a - name: Create security group 1 - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg-glue-1" description: A security group for Ansible tests vpc_id: "{{ glue_vpc.vpc.id }}" @@ -37,7 +37,7 @@ rule_desc: Connections from Glue - name: Create security group 2 - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg-glue-2" description: A security group for Ansible tests vpc_id: "{{ glue_vpc.vpc.id }}" @@ -48,7 +48,7 @@ rule_desc: Connections from Glue - name: Create Glue connection (check mode) - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" availability_zone: "{{ aws_region }}a" connection_properties: @@ -69,7 +69,7 @@ - glue_connection_check.description is not defined - name: Create Glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" availability_zone: "{{ aws_region }}a" connection_properties: @@ -109,7 +109,7 @@ - glue_connection.raw_connection_properties == connection_info["Connection"]["ConnectionProperties"] - name: Create Glue connection (idempotent) (check mode) - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" availability_zone: "{{ aws_region }}a" connection_properties: @@ -149,7 +149,7 @@ - connection_info_idempotent_check["Connection"]["PhysicalConnectionRequirements"]["AvailabilityZone"] == connection_info["Connection"]["PhysicalConnectionRequirements"]["AvailabilityZone"] - name: Create Glue connection (idempotent) - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" availability_zone: "{{ aws_region }}a" connection_properties: @@ -188,7 +188,7 @@ - connection_info_idempotent["Connection"]["PhysicalConnectionRequirements"]["AvailabilityZone"] == connection_info["Connection"]["PhysicalConnectionRequirements"]["AvailabilityZone"] - name: Update Glue connection (check mode) - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" availability_zone: "{{ aws_region }}a" connection_properties: @@ -229,7 +229,7 @@ - glue_connection_update_check.raw_connection_properties == connection_info_update_check["Connection"]["ConnectionProperties"] - name: Update Glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" availability_zone: "{{ aws_region }}a" connection_properties: @@ -269,7 +269,7 @@ - glue_connection_update.raw_connection_properties == connection_info_update["Connection"]["ConnectionProperties"] - name: Delete Glue connection (check mode) - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" state: absent check_mode: true @@ -295,7 +295,7 @@ - connection_info["Connection"]["Name"] == connection_info_delete_check["Connection"]["Name"] - name: Delete Glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" state: absent register: glue_connection_delete @@ -307,17 +307,17 @@ always: - name: Delete Glue connection - aws_glue_connection: + glue_connection: name: "{{ resource_prefix }}" state: absent ignore_errors: true - name: Delete security group 1 - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg-glue-1" state: absent ignore_errors: true - name: Delete security group 2 - ec2_group: + ec2_security_group: name: "{{ resource_prefix }}-sg-glue-2" state: absent ignore_errors: true diff --git a/tests/integration/targets/glue_crawler/tasks/main.yml b/tests/integration/targets/glue_crawler/tasks/main.yml index 143e0ad0707..82ff4addf4a 100644 --- a/tests/integration/targets/glue_crawler/tasks/main.yml +++ b/tests/integration/targets/glue_crawler/tasks/main.yml @@ -29,7 +29,7 @@ seconds: 10 - name: Create Glue crawler (check mode) - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" database_name: my_database description: "{{ glue_crawler_description }}" @@ -56,7 +56,7 @@ - glue_crawler_check.description is not defined - name: Create Glue crawler - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" database_name: my_database description: "{{ glue_crawler_description }}" @@ -102,7 +102,7 @@ - glue_crawler.targets.S3Targets == crawler_info["Crawler"]["Targets"]["S3Targets"] - name: Create Glue crawler (idempotent) (check mode) - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" database_name: my_database description: "{{ glue_crawler_description }}" @@ -149,7 +149,7 @@ - crawler_info["Crawler"]["Targets"]["S3Targets"] == crawler_info_idempotent_check["Crawler"]["Targets"]["S3Targets"] - name: Create Glue crawler (idempotent) - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" database_name: my_database description: "{{ glue_crawler_description }}" @@ -195,7 +195,7 @@ - crawler_info["Crawler"]["Targets"]["S3Targets"] == crawler_info_idempotent["Crawler"]["Targets"]["S3Targets"] - name: Update Glue crawler (check mode) - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" database_name: my_database_2 description: "{{ glue_crawler_description }}" @@ -242,7 +242,7 @@ - glue_crawler_update_check.targets.S3Targets == crawler_info_update_check["Crawler"]["Targets"]["S3Targets"] - name: Update Glue crawler - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" database_name: my_database_2 description: "{{ glue_crawler_description }}" @@ -288,7 +288,7 @@ - glue_crawler_update.targets.S3Targets == crawler_info_update["Crawler"]["Targets"]["S3Targets"] - name: Delete Glue crawler (check mode) - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" state: absent check_mode: true @@ -315,7 +315,7 @@ - crawler_info["Crawler"]["Name"] == crawler_info_delete_check["Crawler"]["Name"] - name: Delete Glue crawler - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" state: absent register: glue_crawler_delete @@ -327,7 +327,7 @@ always: - name: Delete Glue crawler - aws_glue_crawler: + glue_crawler: name: "{{ glue_crawler_name }}" state: absent ignore_errors: true diff --git a/tests/integration/targets/glue_job/tasks/main.yml b/tests/integration/targets/glue_job/tasks/main.yml index 0f367d499d6..85080fd02d7 100644 --- a/tests/integration/targets/glue_job/tasks/main.yml +++ b/tests/integration/targets/glue_job/tasks/main.yml @@ -30,7 +30,7 @@ - "arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess" - name: Create Glue job (check mode) - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" command_python_version: 3 command_script_location: "{{ glue_job_command_script_location }}" @@ -53,7 +53,7 @@ - glue_job_check.description is not defined - name: Create Glue job - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" command_python_version: 3 command_script_location: "{{ glue_job_command_script_location }}" @@ -93,7 +93,7 @@ - glue_job.role == job_info["Job"]["Role"] - name: Create Glue job (idempotent) (check mode) - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" command_python_version: 3 command_script_location: "{{ glue_job_command_script_location }}" @@ -135,7 +135,7 @@ - job_info["Job"]["Role"] == job_info_idempotent_check["Job"]["Role"] - name: Create Glue job (idempotent) - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" command_python_version: 3 command_script_location: "{{ glue_job_command_script_location }}" @@ -176,7 +176,7 @@ - job_info["Job"]["Role"] == job_info_idempotent["Job"]["Role"] - name: Update Glue job (check mode) - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" command_python_version: 2 command_script_location: "{{ glue_job_command_script_location }}" @@ -216,7 +216,7 @@ - glue_job_update_check.role == job_info_update_check["Job"]["Role"] - name: Update Glue job - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" command_python_version: 2 command_script_location: "{{ glue_job_command_script_location }}" @@ -255,7 +255,7 @@ - glue_job_update.role == job_info_update["Job"]["Role"] - name: Delete Glue job (check mode) - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" state: absent check_mode: true @@ -281,7 +281,7 @@ - job_info["Job"]["Name"] == job_info_delete_check["Job"]["Name"] - name: Delete Glue job - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" state: absent register: glue_job_delete @@ -293,7 +293,7 @@ always: - name: Delete Glue job - aws_glue_job: + glue_job: name: "{{ glue_job_name }}" state: absent ignore_errors: true diff --git a/tests/integration/targets/inspector_target/tasks/main.yml b/tests/integration/targets/inspector_target/tasks/main.yml index 6c80a02f949..a32e3bd6841 100644 --- a/tests/integration/targets/inspector_target/tasks/main.yml +++ b/tests/integration/targets/inspector_target/tasks/main.yml @@ -11,7 +11,7 @@ block: - name: Create AWS Inspector Target Group - aws_inspector_target: + inspector_target: name: "{{ aws_inspector_scan_name }}" state: present tags: @@ -20,7 +20,7 @@ register: target_group_create - name: Create AWS Inspector Target Group (Verify) - aws_inspector_target: + inspector_target: name: "{{ aws_inspector_scan_name }}" state: present tags: @@ -41,7 +41,7 @@ - target_group_create_verify.tags.changed == "no" - name: Change AWS Inspector Target Group Tags - aws_inspector_target: + inspector_target: name: "{{ aws_inspector_scan_name }}" state: present tags: @@ -50,7 +50,7 @@ register: target_group_tag_change - name: Change AWS Inspector Target Group Tags (Verify) - aws_inspector_target: + inspector_target: name: "{{ aws_inspector_scan_name }}" state: present tags: @@ -72,13 +72,13 @@ always: - name: Delete AWS Inspector Target Group - aws_inspector_target: + inspector_target: name: "{{ aws_inspector_scan_name }}" state: absent register: target_group_delete - name: Delete AWS Inspector Target Group (Verify) - aws_inspector_target: + inspector_target: name: "{{ aws_inspector_scan_name }}" state: absent register: target_group_delete_verify diff --git a/tests/integration/targets/kinesis_stream/tasks/main.yml b/tests/integration/targets/kinesis_stream/tasks/main.yml index d4e10850106..f219f0ae636 100644 --- a/tests/integration/targets/kinesis_stream/tasks/main.yml +++ b/tests/integration/targets/kinesis_stream/tasks/main.yml @@ -23,13 +23,13 @@ # Note: Because we're not a producer / consumer we don't actually need # access to the keys - name: 'Create KMS key 1' - aws_kms: + kms_key: alias: '{{ kms_cmk_alias_1 }}' state: present enabled: yes register: create_kms_1 - name: 'Create KMS key 2' - aws_kms: + kms_key: alias: '{{ kms_cmk_alias_2 }}' state: present enabled: yes @@ -680,7 +680,7 @@ block: - name: 'Delete the KMS keys' ignore_errors: yes - aws_kms: + kms_key: state: absent alias: '{{ item }}' loop: diff --git a/tests/integration/targets/mq/tasks/env_cleanup.yml b/tests/integration/targets/mq/tasks/env_cleanup.yml index 7e9ec997583..0ccb37907da 100644 --- a/tests/integration/targets/mq/tasks/env_cleanup.yml +++ b/tests/integration/targets/mq/tasks/env_cleanup.yml @@ -1,5 +1,5 @@ - name: remove the security group - ec2_group: + ec2_security_group: name: "{{ sg_name }}" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/mq/tasks/env_setup.yml b/tests/integration/targets/mq/tasks/env_setup.yml index 764bd8ec643..e27b66f27ad 100644 --- a/tests/integration/targets/mq/tasks/env_setup.yml +++ b/tests/integration/targets/mq/tasks/env_setup.yml @@ -18,7 +18,7 @@ register: testing_subnet_a - name: create a security group with the vpc - ec2_group: + ec2_security_group: name: "{{ sg_name }}" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" diff --git a/tests/integration/targets/msk_cluster-auth/tasks/main.yml b/tests/integration/targets/msk_cluster-auth/tasks/main.yml index db0464d56da..9ed2e92d5f1 100644 --- a/tests/integration/targets/msk_cluster-auth/tasks/main.yml +++ b/tests/integration/targets/msk_cluster-auth/tasks/main.yml @@ -42,7 +42,7 @@ # ============================================================ - name: create msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: @@ -55,14 +55,14 @@ always: - name: delete msk cluster - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: absent wait: true ignore_errors: yes - name: remove msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: absent ignore_errors: yes diff --git a/tests/integration/targets/msk_cluster-auth/tasks/test_create_auth.yml b/tests/integration/targets/msk_cluster-auth/tasks/test_create_auth.yml index d7cdd3a718b..0ef0f157ccb 100644 --- a/tests/integration/targets/msk_cluster-auth/tasks/test_create_auth.yml +++ b/tests/integration/targets/msk_cluster-auth/tasks/test_create_auth.yml @@ -1,6 +1,6 @@ --- - name: create a msk cluster with authentication flipped from default (check mode) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" @@ -24,7 +24,7 @@ - msk_cluster is changed - name: create a msk cluster with authentication flipped from default - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" @@ -65,7 +65,7 @@ - "msk_cluster.cluster_info.cluster_arn.startswith('arn:aws:kafka:{{ aws_region }}:')" - name: create a msk cluster with authentication flipped from default (idempotency) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" @@ -89,7 +89,7 @@ ### Keep delete simple as we're not checking delete here - name: delete msk cluster - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "absent" wait: true diff --git a/tests/integration/targets/msk_cluster/tasks/main.yml b/tests/integration/targets/msk_cluster/tasks/main.yml index c6de8e4d6ac..6425d7ec79a 100644 --- a/tests/integration/targets/msk_cluster/tasks/main.yml +++ b/tests/integration/targets/msk_cluster/tasks/main.yml @@ -42,7 +42,7 @@ # ============================================================ - name: create msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: @@ -61,14 +61,14 @@ always: - name: delete msk cluster - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: absent wait: true ignore_errors: yes - name: remove msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: absent ignore_errors: yes diff --git a/tests/integration/targets/msk_cluster/tasks/test_create.yml b/tests/integration/targets/msk_cluster/tasks/test_create.yml index 4fd7073cc5c..5569762bc8e 100644 --- a/tests/integration/targets/msk_cluster/tasks/test_create.yml +++ b/tests/integration/targets/msk_cluster/tasks/test_create.yml @@ -1,6 +1,6 @@ --- - name: create msk cluster (check mode) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" @@ -20,7 +20,7 @@ - msk_cluster is changed - name: create msk cluster - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" @@ -53,7 +53,7 @@ - "msk_cluster.cluster_info.cluster_arn.startswith('arn:aws:kafka:{{ aws_region }}:')" - name: create msk cluster (idempotency) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" diff --git a/tests/integration/targets/msk_cluster/tasks/test_delete.yml b/tests/integration/targets/msk_cluster/tasks/test_delete.yml index efd90fa14cc..53a0d7c8fe9 100644 --- a/tests/integration/targets/msk_cluster/tasks/test_delete.yml +++ b/tests/integration/targets/msk_cluster/tasks/test_delete.yml @@ -1,6 +1,6 @@ --- - name: delete msk cluster (check mode) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "absent" wait: true @@ -13,7 +13,7 @@ - msk_cluster is changed - name: delete msk cluster - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "absent" wait: true @@ -25,7 +25,7 @@ - msk_cluster is changed - name: delete msk cluster (idempotency) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "absent" wait: true diff --git a/tests/integration/targets/msk_cluster/tasks/test_update.yml b/tests/integration/targets/msk_cluster/tasks/test_update.yml index 50ac9171836..600d8eb59bd 100644 --- a/tests/integration/targets/msk_cluster/tasks/test_update.yml +++ b/tests/integration/targets/msk_cluster/tasks/test_update.yml @@ -1,6 +1,6 @@ --- - name: update msk cluster (check mode) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" @@ -22,7 +22,7 @@ - msk_cluster is changed - name: update msk cluster - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" @@ -51,7 +51,7 @@ - "msk_cluster.cluster_info.tags.key3 == 'value3'" - name: update msk cluster (idempotency) - aws_msk_cluster: + msk_cluster: name: "{{ msk_cluster_name }}" state: "present" version: "{{ msk_version }}" diff --git a/tests/integration/targets/msk_config/tasks/main.yml b/tests/integration/targets/msk_config/tasks/main.yml index eace6614f2b..095ec21c2d8 100644 --- a/tests/integration/targets/msk_config/tasks/main.yml +++ b/tests/integration/targets/msk_config/tasks/main.yml @@ -10,7 +10,7 @@ - amazon.aws block: - name: create msk configuration (check mode) - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: "{{ msk_kafka_versions }}" @@ -24,7 +24,7 @@ - msk_config is changed - name: create msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: "{{ msk_kafka_versions }}" @@ -37,7 +37,7 @@ - msk_config is changed - name: create msk configuration (idempotency) - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: "{{ msk_kafka_versions }}" @@ -58,7 +58,7 @@ - "'zookeeper.session.timeout.ms=18000' in msk_config.server_properties" - name: update msk configuration (check mode) - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: "{{ msk_kafka_versions }}" @@ -72,7 +72,7 @@ - msk_config is changed - name: update msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: "{{ msk_kafka_versions }}" @@ -93,7 +93,7 @@ - "'zookeeper.session.timeout.ms=36000' in msk_config.server_properties" - name: update msk configuration (idempotency) - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "present" kafka_versions: "{{ msk_kafka_versions }}" @@ -106,7 +106,7 @@ - msk_config is not changed - name: delete msk configuration (check mode) - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "absent" check_mode: yes @@ -118,7 +118,7 @@ - msk_config is changed - name: delete msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "absent" register: msk_config @@ -129,7 +129,7 @@ - msk_config is changed - name: delete msk configuration (idempotency) - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: "absent" register: msk_config @@ -142,7 +142,7 @@ always: - name: remove msk configuration - aws_msk_config: + msk_config: name: "{{ msk_config_name }}" state: absent ignore_errors: yes diff --git a/tests/integration/targets/opensearch/tasks/test_create_cert.yml b/tests/integration/targets/opensearch/tasks/test_create_cert.yml index ad44f6faefe..5492bb922ee 100644 --- a/tests/integration/targets/opensearch/tasks/test_create_cert.yml +++ b/tests/integration/targets/opensearch/tasks/test_create_cert.yml @@ -21,7 +21,7 @@ privatekey_path: '{{ tempdir_1.path }}/rsa-private-key.pem' selfsigned_digest: sha256 - name: import certificate to ACM - aws_acm: + acm_certificate: name_tag: 'opensearch.ansible-integ-test.com' domain_name: 'opensearch.ansible-integ-test.com' certificate: "{{ lookup('file', tempdir_1.path + '/rsa-certificate.pem') }}" diff --git a/tests/integration/targets/opensearch/tasks/test_delete_resources.yml b/tests/integration/targets/opensearch/tasks/test_delete_resources.yml index d9ddfc91347..470706f15f2 100644 --- a/tests/integration/targets/opensearch/tasks/test_delete_resources.yml +++ b/tests/integration/targets/opensearch/tasks/test_delete_resources.yml @@ -43,12 +43,12 @@ vpc_name: "{{ item.tags['Name'] }}" - name: collect info about KMS keys used for test purpose - aws_kms_info: + kms_key_info: filters: "tag:AnsibleTest": "AnsibleTestVpc" register: kms_info - name: Delete KMS keys that were created for test purpose - aws_kms: + kms_key: key_id: "{{ kms_arn }}" state: absent with_items: "{{ kms_info.kms_keys }}" @@ -56,6 +56,6 @@ kms_arn: "{{ item.key_arn }}" - name: delete certificate from ACM - aws_acm: + acm_certificate: name_tag: 'opensearch.ansible-integ-test.com' state: absent diff --git a/tests/integration/targets/opensearch/tasks/test_delete_vpc_resources.yml b/tests/integration/targets/opensearch/tasks/test_delete_vpc_resources.yml index 5fb803c9095..b0cfa64343d 100644 --- a/tests/integration/targets/opensearch/tasks/test_delete_vpc_resources.yml +++ b/tests/integration/targets/opensearch/tasks/test_delete_vpc_resources.yml @@ -30,13 +30,13 @@ when: route53_zone_ids | length > 0 - name: Get security groups that have been created for test purpose in the VPC - ec2_group_info: + ec2_security_group_info: filters: vpc-id: "{{ vpc_id }}" register: sg_info - name: Delete security groups - ec2_group: + ec2_security_group: group_id: "{{ sg_id }}" state: absent loop_control: diff --git a/tests/integration/targets/opensearch/tasks/test_vpc_setup.yml b/tests/integration/targets/opensearch/tasks/test_vpc_setup.yml index 90aeb50bbd6..6e1fec1ab9f 100644 --- a/tests/integration/targets/opensearch/tasks/test_vpc_setup.yml +++ b/tests/integration/targets/opensearch/tasks/test_vpc_setup.yml @@ -83,7 +83,7 @@ AnsibleTest: AnsibleTestVpc - name: Create security group for use in testing - ec2_group: + ec2_security_group: name: "{{ tiny_prefix }}-sg" description: a security group for ansible tests vpc_id: "{{ testing_vpc.vpc.id }}" @@ -120,7 +120,7 @@ - name: Create KMS key for test purpose # The key is needed for OpenSearch encryption at rest. - aws_kms: + kms_key: alias: "{{ tiny_prefix }}-kms" description: a key used for encryption at rest in test OpenSearch cluster state: present diff --git a/tests/integration/targets/s3_bucket_info/tasks/basic.yml b/tests/integration/targets/s3_bucket_info/tasks/basic.yml index bf09665af4c..cf4ab8881f8 100644 --- a/tests/integration/targets/s3_bucket_info/tasks/basic.yml +++ b/tests/integration/targets/s3_bucket_info/tasks/basic.yml @@ -1,6 +1,6 @@ --- - name: Get simple S3 bucket list - aws_s3_bucket_info: + s3_bucket_info: register: bucket_list - name: Assert result.changed == False and bucket list was retrieved @@ -10,7 +10,7 @@ - bucket_list.buckets - name: Get complex S3 bucket list - aws_s3_bucket_info: + s3_bucket_info: name_filter: "{{ name_pattern }}" bucket_facts: bucket_accelerate_configuration: true diff --git a/tests/integration/targets/s3_bucket_info/tasks/bucket_ownership_controls.yml b/tests/integration/targets/s3_bucket_info/tasks/bucket_ownership_controls.yml index 3acd99cf6de..de0a6d61141 100644 --- a/tests/integration/targets/s3_bucket_info/tasks/bucket_ownership_controls.yml +++ b/tests/integration/targets/s3_bucket_info/tasks/bucket_ownership_controls.yml @@ -1,6 +1,6 @@ --- - name: Get S3 bucket ownership controls - aws_s3_bucket_info: + s3_bucket_info: name_filter: "{{ name_pattern }}" bucket_facts: bucket_ownership_controls: true @@ -17,7 +17,7 @@ label: "{{ item.name }}" - name: Get complex S3 bucket list (including ownership controls) - aws_s3_bucket_info: + s3_bucket_info: name_filter: "{{ name_pattern }}" bucket_facts: bucket_accelerate_configuration: true diff --git a/tests/integration/targets/s3_sync/tasks/main.yml b/tests/integration/targets/s3_sync/tasks/main.yml index eb8810ee580..2263df2bf54 100644 --- a/tests/integration/targets/s3_sync/tasks/main.yml +++ b/tests/integration/targets/s3_sync/tasks/main.yml @@ -158,14 +158,14 @@ - name: Empty all buckets before deleting block: - name: list test_bucket objects - aws_s3: + s3_object: bucket: "{{ test_bucket }}" mode: list register: objects ignore_errors: true - name: remove objects from test_bucket - aws_s3: + s3_object: bucket: "{{ test_bucket }}" mode: delobj object: "{{ obj }}" @@ -175,14 +175,14 @@ ignore_errors: true - name: list test_bucket_2 objects - aws_s3: + s3_object: bucket: "{{ test_bucket_2 }}" mode: list register: objects ignore_errors: true - name: remove objects from test_bucket_2 - aws_s3: + s3_object: bucket: "{{ test_bucket_2 }}" mode: delobj object: "{{ obj }}" @@ -192,14 +192,14 @@ ignore_errors: true - name: list test_bucket_3 objects - aws_s3: + s3_object: bucket: "{{ test_bucket_3 }}" mode: list register: objects ignore_errors: true - name: remove objects from test_bucket_3 - aws_s3: + s3_object: bucket: "{{ test_bucket_3 }}" mode: delobj object: "{{ obj }}" diff --git a/tests/integration/targets/secretsmanager_secret/tasks/basic.yml b/tests/integration/targets/secretsmanager_secret/tasks/basic.yml index 9b273de9fa9..ea285ee0533 100644 --- a/tests/integration/targets/secretsmanager_secret/tasks/basic.yml +++ b/tests/integration/targets/secretsmanager_secret/tasks/basic.yml @@ -73,7 +73,7 @@ # Creation testing # ============================================================ - name: add secret to AWS Secrets Manager - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: present secret_type: 'string' @@ -100,7 +100,7 @@ secret_arn: '{{ result.secret.arn }}' - name: no changes to secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: present secret_type: 'string' @@ -122,7 +122,7 @@ - result.secret.version_ids_to_stages | length == 1 - name: Set secret description - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -151,7 +151,7 @@ ############################################################### - name: Set tags (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -167,7 +167,7 @@ - result is changed - name: Set tags - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -197,7 +197,7 @@ - result.secret.version_ids_to_stages | length == 2 - name: Set tags - idempotency (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -213,7 +213,7 @@ - result is not changed - name: Set tags - idempotency - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -245,7 +245,7 @@ ### - name: Update tags with purge (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -261,7 +261,7 @@ - result is changed - name: Update tags with purge - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -291,7 +291,7 @@ - result.secret.version_ids_to_stages | length == 2 - name: Update tags with purge - idempotency (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -307,7 +307,7 @@ - result is not changed - name: Update tags with purge - idempotency - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -339,7 +339,7 @@ ### - name: Update tags without purge (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -356,7 +356,7 @@ - result is changed - name: Update tags without purge - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -387,7 +387,7 @@ - result.secret.version_ids_to_stages | length == 2 - name: Update tags without purge - idempotency (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -404,7 +404,7 @@ - result is not changed - name: Update tags without purge - idempotency - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -437,7 +437,7 @@ ### - name: Tags not set - idempotency (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -452,7 +452,7 @@ - result is not changed - name: Tags not set - idempotency - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -483,7 +483,7 @@ ### - name: remove all tags from secret (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -499,7 +499,7 @@ - result is changed - name: remove all tags from secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -529,7 +529,7 @@ - result.secret.version_ids_to_stages | length == 2 - name: remove all tags from secret - idempotency (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -545,7 +545,7 @@ - result is not changed - name: remove all tags from secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -579,7 +579,7 @@ ############################################################### - name: add resource policy to secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -594,7 +594,7 @@ - result.changed - name: remove existing resource policy from secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -608,7 +608,7 @@ - result.changed - name: remove resource policy from secret (idempotency) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -626,7 +626,7 @@ # ============================================================ - name: Update secret with JSON (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -642,7 +642,7 @@ - result.changed - name: Update secret with JSON - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: present description: 'this is a change to this secret' @@ -657,7 +657,7 @@ - result.changed - name: Update secret with JSON - idempotency (CHECK_MODE) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -673,7 +673,7 @@ - result is not changed - name: Update secret with JSON - idempotency - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to this secret' state: present @@ -693,7 +693,7 @@ # ============================================================ - name: Create secret with overwrite = False (Check mode) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-2" state: present secret_type: 'string' @@ -708,7 +708,7 @@ - result is changed - name: Create secret with overwrite = False - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-2" state: present secret_type: 'string' @@ -722,7 +722,7 @@ - result is changed - name: Update secret with overwrite = False (Check mode) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-2" state: present secret_type: 'string' @@ -737,7 +737,7 @@ - result is not changed - name: Create secret with overwrite = False - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-2" state: present secret_type: 'string' @@ -755,7 +755,7 @@ # ============================================================ - name: remove secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 7 @@ -767,7 +767,7 @@ - result.changed - name: remove secret (idempotency) - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 7 @@ -779,7 +779,7 @@ - not result.changed - name: immediate secret removal - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 0 @@ -793,7 +793,7 @@ # AWS Doesn't expose when the secret will be removed, all we can do is # check that we didn't throw an error - name: immediate secret removal - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 0 @@ -806,14 +806,14 @@ always: - name: remove secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 0 ignore_errors: yes - name: remove secret 2 - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-2" state: absent recovery_window: 0 diff --git a/tests/integration/targets/secretsmanager_secret/tasks/replication.yml b/tests/integration/targets/secretsmanager_secret/tasks/replication.yml index 30d3a948423..30f178c06ea 100644 --- a/tests/integration/targets/secretsmanager_secret/tasks/replication.yml +++ b/tests/integration/targets/secretsmanager_secret/tasks/replication.yml @@ -4,7 +4,7 @@ # Creation/Deletion testing # ============================================================ - name: add secret to AWS Secrets Manager - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: present secret_type: 'string' @@ -28,7 +28,7 @@ - result.version_ids_to_stages is not none - name: no changes to secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: present secret: "{{ super_secret_string }}" @@ -45,7 +45,7 @@ - result.arn is not none - name: remove region replica - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to remove replication' secret: "{{ super_secret_string }}" @@ -60,7 +60,7 @@ - '"replication_status" not in result.secret' - name: add region replica to an existing secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change add replication' secret: "{{ super_secret_string }}" @@ -80,7 +80,7 @@ - result.secret.replication_status[1]["kms_key_id"] == 'alias/aws/secretsmanager' - name: change replica regions - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: present secret: "{{ super_secret_string }}" @@ -100,7 +100,7 @@ always: - name: remove region replica - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" description: 'this is a change to remove replication' state: present @@ -109,7 +109,7 @@ ignore_errors: yes - name: remove secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 0 diff --git a/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml b/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml index 273a5ae04fe..697c5ecc279 100644 --- a/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml +++ b/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml @@ -70,7 +70,7 @@ # Creation/Deletion testing # ============================================================ - name: add secret to AWS Secrets Manager - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-rotate" state: present secret_type: 'string' @@ -95,7 +95,7 @@ principal: "secretsmanager.amazonaws.com" - name: add rotation lambda to secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-rotate" description: 'this is a change to this secret' state: present @@ -113,7 +113,7 @@ - result.changed - name: remove rotation lambda from secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-rotate" description: 'this is a change to this secret' state: present @@ -127,7 +127,7 @@ - result.changed - name: remove rotation lambda from secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-rotate" description: 'this is a change to this secret' state: present @@ -141,7 +141,7 @@ - not result.changed - name: remove secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-rotate" state: absent recovery_window: 0 @@ -149,7 +149,7 @@ always: - name: remove secret - aws_secret: + secretsmanager_secret: name: "{{ secret_name }}-rotate" state: absent recovery_window: 0 diff --git a/tests/integration/targets/ses_identity/tasks/main.yaml b/tests/integration/targets/ses_identity/tasks/main.yaml index c7554e1a693..3ecb68c38de 100644 --- a/tests/integration/targets/ses_identity/tasks/main.yaml +++ b/tests/integration/targets/ses_identity/tasks/main.yaml @@ -14,7 +14,7 @@ - name: test register email identity block: - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present register: result @@ -27,14 +27,14 @@ identity: "{{ email_identity }}" always: - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ - name: test register domain identity block: - name: register domain identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: result @@ -51,18 +51,18 @@ - result.verification_attributes.verification_token always: - name: cleanup domain identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test email_identity unchanged when already existing block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present - name: duplicate register identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present register: result @@ -75,18 +75,18 @@ identity: "{{ email_identity }}" always: - name: cleanup identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ - name: test domain_identity unchanged when already existing block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present - name: duplicate register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: result @@ -99,7 +99,7 @@ identity: "{{ domain_identity }}" always: - name: cleanup identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ @@ -110,7 +110,7 @@ - name: test register identity without explicit region block: - name: register email identity without explicit region - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present region: "{{ omit }}" @@ -126,14 +126,14 @@ identity: "{{ email_identity }}" always: - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ - name: test register email identity check mode block: - name: register email identity check mode - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present register: result @@ -150,7 +150,7 @@ always: - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent register: result @@ -163,7 +163,7 @@ - name: test register domain identity check mode block: - name: register domain identity check mode - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: result @@ -180,7 +180,7 @@ always: - name: cleanup domain identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent register: result @@ -191,7 +191,7 @@ - result.changed == False # ============================================================ - name: remove non-existent email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent register: result @@ -201,7 +201,7 @@ - result.changed == False # ============================================================ - name: remove non-existent domain identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent register: result @@ -213,13 +213,13 @@ - name: test remove email identity check mode block: - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present register: result - name: remove email identity check mode - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent register: result @@ -231,7 +231,7 @@ - result.changed == True always: - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent register: result @@ -244,13 +244,13 @@ - name: test remove domain identity check mode block: - name: register domain identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: result - name: remove domain identity check mode - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent register: result @@ -262,7 +262,7 @@ - result.changed == True always: - name: cleanup domain identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent register: result @@ -284,7 +284,7 @@ - complaint - delivery - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: @@ -316,7 +316,7 @@ - complaint - delivery - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ @@ -332,11 +332,11 @@ - complaint - delivery - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present - name: set notification topics - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: @@ -366,7 +366,7 @@ - complaint - delivery - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ @@ -382,7 +382,7 @@ - complaint - delivery - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: @@ -392,7 +392,7 @@ delivery_notifications: topic: "{{ topic_info.results[2].sns_arn }}" - name: Make no change to identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present register: result @@ -402,7 +402,7 @@ - result.changed == False - name: clear notification settings - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: {} @@ -426,7 +426,7 @@ - complaint - delivery - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ @@ -443,12 +443,12 @@ - delivery - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present - name: set notification settings check mode - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: @@ -481,7 +481,7 @@ - result.notification_attributes.forwarding_enabled == False - name: re-register base email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present register: result @@ -508,14 +508,14 @@ - delivery - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ - name: test include headers on notification queues block: - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: @@ -533,7 +533,7 @@ - result.notification_attributes.headers_in_delivery_notifications_enabled == True always: - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ @@ -548,7 +548,7 @@ - bounce - complaint - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: @@ -570,14 +570,14 @@ - bounce - complaint - name: cleanup email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ - name: test disable feedback forwarding fails if no topics block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present feedback_forwarding: No @@ -589,7 +589,7 @@ - '"Invalid Parameter Value" in result.msg' always: - name: cleanup identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ @@ -601,7 +601,7 @@ state: present register: topic_info - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present bounce_notifications: @@ -619,7 +619,7 @@ name: "{{ notification_queue_name }}-bounce" state: absent - name: cleanup identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent # ============================================================ @@ -631,7 +631,7 @@ state: present register: topic_info - name: register email identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: present complaint_notifications: @@ -649,6 +649,6 @@ name: "{{ notification_queue_name }}-complaint" state: absent - name: cleanup identity - aws_ses_identity: + ses_identity: identity: "{{ email_identity }}" state: absent diff --git a/tests/integration/targets/ses_identity_policy/tasks/main.yaml b/tests/integration/targets/ses_identity_policy/tasks/main.yaml index 798dcf8c644..8fe290b561c 100644 --- a/tests/integration/targets/ses_identity_policy/tasks/main.yaml +++ b/tests/integration/targets/ses_identity_policy/tasks/main.yaml @@ -14,13 +14,13 @@ - name: test add identity policy block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: register identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" policy: "{{ lookup('template', 'policy.json.j2') }}" @@ -40,27 +40,27 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test add duplicate identity policy block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: register identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" policy: "{{ lookup('template', 'policy.json.j2') }}" state: present - name: register duplicate identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" policy: "{{ lookup('template', 'policy.json.j2') }}" @@ -80,20 +80,20 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test add identity policy by identity arn block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: register identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ identity_info.identity_arn }}" policy_name: "{{ policy_name }}" policy: "{{ lookup('template', 'policy.json.j2') }}" @@ -113,20 +113,20 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test add multiple identity policies block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: register identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}-{{ item }}" policy: "{{ lookup('template', 'policy.json.j2') }}" @@ -145,20 +145,20 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test add inline identity policy block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: register identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" policy: @@ -185,7 +185,7 @@ - result.policies|select('equalto', policy_name)|list|length == 1 - name: register duplicate identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" policy: @@ -207,27 +207,27 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test remove identity policy block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: register identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" policy: "{{ lookup('template', 'policy.json.j2') }}" state: present - name: delete identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" state: absent @@ -245,20 +245,20 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test remove missing identity policy block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: delete identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" state: absent @@ -276,20 +276,20 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent # ============================================================ - name: test add identity policy with invalid policy block: - name: register identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: present register: identity_info - name: register identity policy - aws_ses_identity_policy: + ses_identity_policy: identity: "{{ domain_identity }}" policy_name: "{{ policy_name }}" policy: '{"noSuchAttribute": 2}' @@ -304,6 +304,6 @@ always: - name: clean-up identity - aws_ses_identity: + ses_identity: identity: "{{ domain_identity }}" state: absent diff --git a/tests/integration/targets/ses_rule_set/tasks/active-rule-set-tests.yaml b/tests/integration/targets/ses_rule_set/tasks/active-rule-set-tests.yaml index ea79dbbccde..d83cd2f85f2 100644 --- a/tests/integration/targets/ses_rule_set/tasks/active-rule-set-tests.yaml +++ b/tests/integration/targets/ses_rule_set/tasks/active-rule-set-tests.yaml @@ -10,10 +10,10 @@ - name: mark rule set active block: - name: create rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" - name: mark rule set active - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True register: result @@ -23,7 +23,7 @@ - result.changed == True - result.active == True - name: remark rule set active - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True register: result @@ -33,7 +33,7 @@ - result.changed == False always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -42,7 +42,7 @@ - name: create rule set active block: - name: create rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True register: result @@ -53,7 +53,7 @@ - result.active == True - "default_rule_set in result.rule_sets|map(attribute='name')" - name: remark rule set active - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True register: result @@ -63,7 +63,7 @@ - result.changed == False always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -72,11 +72,11 @@ - name: mark rule set inactive block: - name: create active rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: mark rule set inactive - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: False register: result @@ -86,7 +86,7 @@ - result.changed == True - result.active == False - name: remark rule set inactive - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: False register: result @@ -96,7 +96,7 @@ - result.changed == False always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -105,11 +105,11 @@ - name: Absent active flag does not change active status block: - name: create active rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: recreate rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" register: result - name: assert not changed and still active @@ -119,7 +119,7 @@ - result.active == True always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -128,11 +128,11 @@ - name: Cannot Remove Active Rule Set block: - name: create active rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: remove rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent register: result @@ -143,7 +143,7 @@ - "result.error.code == 'CannotDelete'" always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -152,11 +152,11 @@ - name: Remove Active Rule Set with Force block: - name: create active rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: force remove rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -168,7 +168,7 @@ - "default_rule_set not in result.rule_sets|map(attribute='name')" always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -177,15 +177,15 @@ - name: Force Remove of Inactive Rule Set does Not Affect Active Rule Set block: - name: create active rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: create inactive rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ second_rule_set }}" active: False - name: force remove inactiave rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ second_rule_set }}" state: absent force: True @@ -196,7 +196,7 @@ - result.changed == True - "second_rule_set not in result.rule_sets|map(attribute='name')" - name: remark active rule set active - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True register: result @@ -206,7 +206,7 @@ - result.changed == False always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ item }}" state: absent force: True @@ -218,11 +218,11 @@ - name: mark rule set inactive in check mode block: - name: create rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: mark rule set inactive in check mode - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: False register: result @@ -233,7 +233,7 @@ - result.changed == True - result.active == False - name: remark rule set inactive - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: False register: result @@ -243,7 +243,7 @@ - result.changed == True always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -252,11 +252,11 @@ - name: Cannot Remove Active Rule Set in check mode block: - name: create active rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: remove rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent register: result @@ -268,7 +268,7 @@ - "result.error.code == 'CannotDelete'" always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -277,11 +277,11 @@ - name: Remove Active Rule Set with Force in check mode block: - name: create active rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True - name: force remove rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -294,7 +294,7 @@ - "default_rule_set not in result.rule_sets|map(attribute='name')" always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True diff --git a/tests/integration/targets/ses_rule_set/tasks/inactive-rule-set-tests.yaml b/tests/integration/targets/ses_rule_set/tasks/inactive-rule-set-tests.yaml index 845168c23c4..92321b3eb69 100644 --- a/tests/integration/targets/ses_rule_set/tasks/inactive-rule-set-tests.yaml +++ b/tests/integration/targets/ses_rule_set/tasks/inactive-rule-set-tests.yaml @@ -14,7 +14,7 @@ - name: test create rule sets block: - name: create rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" register: result - name: assert changed to exists inactive @@ -24,7 +24,7 @@ - result.active == False - "default_rule_set in result.rule_sets|map(attribute='name')" - name: recreate rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" register: result - name: assert changed is False @@ -33,7 +33,7 @@ - result.changed == False always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -41,7 +41,7 @@ - name: Remove No Such Rules Set block: - name: remove ruleset - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent register: result @@ -54,10 +54,10 @@ - name: Remove Inactive Rule Set block: - name: create rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" - name: remove rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent register: result @@ -68,7 +68,7 @@ - "default_rule_set not in result.rule_sets|map(attribute='name')" always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -76,7 +76,7 @@ - name: test create in check mode block: - name: create rule set in check mode - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" register: result check_mode: True @@ -88,7 +88,7 @@ - "default_rule_set in result.rule_sets|map(attribute='name')" always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -101,10 +101,10 @@ - name: mark rule set active in check mode block: - name: create rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" - name: mark rule set active in check mode - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: True register: result @@ -118,7 +118,7 @@ # it active again as that way this test can be run in # parallel - name: Ensure rule set is inactive - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" active: False register: result @@ -128,7 +128,7 @@ - result.changed == False always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True @@ -136,10 +136,10 @@ - name: Remove Inactive Rule Set in check mode block: - name: create rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" - name: remove rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent register: result @@ -151,7 +151,7 @@ - "default_rule_set not in result.rule_sets|map(attribute='name')" always: - name: cleanup rule set - aws_ses_rule_set: + ses_rule_set: name: "{{ default_rule_set }}" state: absent force: True diff --git a/tests/integration/targets/setup_connection_aws_ssm/tasks/cleanup.yml b/tests/integration/targets/setup_connection_aws_ssm/tasks/cleanup.yml index 413dc381e57..fce828a3cef 100644 --- a/tests/integration/targets/setup_connection_aws_ssm/tasks/cleanup.yml +++ b/tests/integration/targets/setup_connection_aws_ssm/tasks/cleanup.yml @@ -73,7 +73,7 @@ when: iam_role_vars_file.stat.exists == true - name: Delete the KMS key - aws_kms: + kms_key: state: absent alias: '{{ kms_key_name }}' diff --git a/tests/integration/targets/setup_connection_aws_ssm/tasks/encryption.yml b/tests/integration/targets/setup_connection_aws_ssm/tasks/encryption.yml index 949892d1831..1379b042814 100644 --- a/tests/integration/targets/setup_connection_aws_ssm/tasks/encryption.yml +++ b/tests/integration/targets/setup_connection_aws_ssm/tasks/encryption.yml @@ -1,7 +1,7 @@ --- ## Task file for setup/teardown AWS resources for aws_ssm integration testing - name: create a KMS key - aws_kms: + kms_key: alias: '{{ kms_key_name }}' grants: - name: SSM-Agent-Access diff --git a/tests/integration/targets/setup_ec2_facts/defaults/main.yml b/tests/integration/targets/setup_ec2_facts/defaults/main.yml index 6fbe55e83f0..11a1e561e5b 100644 --- a/tests/integration/targets/setup_ec2_facts/defaults/main.yml +++ b/tests/integration/targets/setup_ec2_facts/defaults/main.yml @@ -1,6 +1,7 @@ +--- # CentOS Community Platform Engineering (CPE) -ec2_ami_owner_id: '125523088429' -#ec2_ami_name: 'Fedora-Cloud-Base-*.x86_64*' -ec2_ami_name: 'CentOS Stream 9 x86_64*' -#ec2_ami_ssh_user: 'fedora' -ec2_ami_ssh_user: 'centos' +ec2_ami_owner_id: "125523088429" +# ec2_ami_name: 'Fedora-Cloud-Base-*.x86_64*' +ec2_ami_name: CentOS Stream 9 x86_64* +# ec2_ami_ssh_user: 'fedora' +ec2_ami_ssh_user: centos diff --git a/tests/integration/targets/setup_ec2_facts/meta/main.yml b/tests/integration/targets/setup_ec2_facts/meta/main.yml index 32cf5dda7ed..23d65c7ef45 100644 --- a/tests/integration/targets/setup_ec2_facts/meta/main.yml +++ b/tests/integration/targets/setup_ec2_facts/meta/main.yml @@ -1 +1,2 @@ +--- dependencies: [] diff --git a/tests/integration/targets/setup_ec2_facts/tasks/main.yml b/tests/integration/targets/setup_ec2_facts/tasks/main.yml index 56a4e1db05f..bd059c8664a 100644 --- a/tests/integration/targets/setup_ec2_facts/tasks/main.yml +++ b/tests/integration/targets/setup_ec2_facts/tasks/main.yml @@ -8,46 +8,47 @@ # rather than hardcoding the IDs so we're not limited to specific Regions # - ec2_ami_id # -- module_defaults: +- name: Setup common EC2 related facts. + module_defaults: group/aws: - access_key: '{{ aws_access_key }}' - secret_key: '{{ aws_secret_key }}' - session_token: '{{ security_token | default(omit) }}' - region: '{{ aws_region }}' + access_key: "{{ aws_access_key }}" + secret_key: "{{ aws_secret_key }}" + session_token: "{{ security_token | default(omit) }}" + region: "{{ aws_region }}" - run_once: True + run_once: true block: # ============================================================ - - name: Get available AZs - aws_az_info: - filters: - region-name: '{{ aws_region }}' - register: _az_info + - name: Get available AZs + amazon.aws.aws_az_info: + filters: + region-name: "{{ aws_region }}" + register: _az_info - - name: Pick an AZ - set_fact: - ec2_availability_zone_names: '{{ _az_info.availability_zones | selectattr("zone_name", "defined") | map(attribute="zone_name") | list }}' + - name: Pick an AZ + ansible.builtin.set_fact: + ec2_availability_zone_names: '{{ _az_info.availability_zones | selectattr("zone_name", "defined") | map(attribute="zone_name") | list }}' - # ============================================================ + # ============================================================ - - name: Get a list of images - ec2_ami_info: - filters: - name: '{{ ec2_ami_name }}' - owner-id: '{{ ec2_ami_owner_id }}' - architecture: x86_64 - virtualization-type: hvm - root-device-type: ebs - register: _images_info - # Very spammy - no_log: True + - name: Get a list of images + amazon.aws.ec2_ami_info: + filters: + name: "{{ ec2_ami_name }}" + owner-id: "{{ ec2_ami_owner_id }}" + architecture: x86_64 + virtualization-type: hvm + root-device-type: ebs + register: _images_info + # Very spammy + no_log: true - - name: Set Fact for latest AMI - vars: - latest_image: '{{ _images_info.images | sort(attribute="creation_date") | reverse | first }}' - set_fact: - ec2_ami_id: '{{ latest_image.image_id }}' - ec2_ami_details: '{{ latest_image }}' - ec2_ami_root_disk: '{{ latest_image.block_device_mappings[0].device_name }}' - ec2_ami_ssh_user: '{{ ec2_ami_ssh_user }}' + - name: Set Fact for latest AMI + vars: + latest_image: '{{ _images_info.images | sort(attribute="creation_date") | reverse | first }}' + ansible.builtin.set_fact: + ec2_ami_id: "{{ latest_image.image_id }}" + ec2_ami_details: "{{ latest_image }}" + ec2_ami_root_disk: "{{ latest_image.block_device_mappings[0].device_name }}" + ec2_ami_ssh_user: "{{ ec2_ami_ssh_user }}" diff --git a/tests/integration/targets/ssm_parameter/tasks/main.yml b/tests/integration/targets/ssm_parameter/tasks/main.yml index 02283bb980c..efc09bc4b5b 100644 --- a/tests/integration/targets/ssm_parameter/tasks/main.yml +++ b/tests/integration/targets/ssm_parameter/tasks/main.yml @@ -87,7 +87,7 @@ # Create - name: Create key/value pair in aws parameter store (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ simple_description }}' value: '{{ simple_value }}' @@ -98,7 +98,7 @@ - result is changed - name: Create key/value pair in aws parameter store - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ simple_description }}' value: '{{ simple_value }}' @@ -129,7 +129,7 @@ - result.parameter_metadata.type == 'String' - name: Create key/value pair in aws parameter store - idempotency (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ simple_description }}' value: '{{ simple_value }}' @@ -140,7 +140,7 @@ - result is not changed - name: Create key/value pair in aws parameter store - idempotency - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ simple_description }}' value: '{{ simple_value }}' @@ -174,7 +174,7 @@ # Update description - name: Update description (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ updated_description }}' register: result @@ -184,7 +184,7 @@ - result is changed - name: Update description - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ updated_description }}' register: result @@ -214,7 +214,7 @@ - result.parameter_metadata.type == 'String' - name: Update description - idempotency (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ updated_description }}' register: result @@ -224,7 +224,7 @@ - result is not changed - name: Update description - idempotency - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' description: '{{ updated_description }}' register: result @@ -258,7 +258,7 @@ # Update value - name: Update key/value pair in aws parameter store (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ updated_value }}' register: result @@ -268,7 +268,7 @@ - result is changed - name: Update key/value pair in aws parameter store - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ updated_value }}' register: result @@ -298,7 +298,7 @@ - result.parameter_metadata.type == 'String' - name: Update key/value pair in aws parameter store - idempotency (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ updated_value }}' register: result @@ -308,7 +308,7 @@ - result is not changed - name: Update key/value pair in aws parameter store - idempotency - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ updated_value }}' register: result @@ -341,7 +341,7 @@ # Complex update - name: Complex update to key/value pair in aws parameter store (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ simple_value }}' description: '{{ simple_description }}' @@ -352,7 +352,7 @@ - result is changed - name: Complex update to key/value pair in aws parameter store - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ simple_value }}' description: '{{ simple_description }}' @@ -383,7 +383,7 @@ - result.parameter_metadata.type == 'String' - name: Complex update to key/value pair in aws parameter store - idempotency (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ simple_value }}' description: '{{ simple_description }}' @@ -394,7 +394,7 @@ - result is not changed - name: Complex update to key/value pair in aws parameter store - idempotency - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ simple_value }}' description: '{{ simple_description }}' @@ -428,7 +428,7 @@ # Delete - name: Delete key/value pair in aws parameter store (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' state: absent register: result @@ -438,7 +438,7 @@ - result is changed - name: Delete key/value pair in aws parameter store - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' state: absent register: result @@ -454,7 +454,7 @@ - info_result is failed - name: Delete key/value pair in aws parameter store - idempotency (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' state: absent register: result @@ -464,7 +464,7 @@ - result is not changed - name: Delete key/value pair in aws parameter store - idempotency - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' state: absent register: result @@ -474,7 +474,7 @@ - result is not changed - name: Create key/value pair in aws parameter store with no description - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ simple_value }}' register: result @@ -485,7 +485,7 @@ - '"description" not in result.parameter_metadata' - name: Add a description - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_name }}' value: '{{ simple_value }}' description: '{{ simple_description }}' @@ -501,7 +501,7 @@ # Test tags - Create parameter with tags case - name: Create parameter with tags case - Create parameter (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -513,7 +513,7 @@ - result is changed - name: Create parameter with tags case - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -560,7 +560,7 @@ # Test tags - Update description only case - name: Update description only case - Update parameter (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_updated_description }}' register: result @@ -570,7 +570,7 @@ - result is changed - name: Update description only case - Update parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_updated_description }}' register: result @@ -615,7 +615,7 @@ # Test tags - Add tag to existing parameter case - name: Add tag to existing parameter case - Update parameter (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_add_owner }}' register: result @@ -625,7 +625,7 @@ - result is changed - name: Add tag to existing parameter case - Update parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_add_owner }}' register: result @@ -667,7 +667,7 @@ - result.parameter_metadata.type == 'String' - name: Add tag to existing parameter case - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -678,7 +678,7 @@ # Test tags - update tags only - change tag - name: Change single tag case - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -686,7 +686,7 @@ register: result - name: Change single tag case - Update tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_change_environment }}' register: result @@ -696,7 +696,7 @@ - result is changed - name: Change single tag case - Update tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_change_environment }}' register: result @@ -738,7 +738,7 @@ - result.parameter_metadata.type == 'String' - name: Change single tag case - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -749,7 +749,7 @@ # Test tags - delete tag case - name: Delete single tag case - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -757,7 +757,7 @@ register: result - name: Delete single tag case - Update tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_delete_version }}' register: result @@ -767,7 +767,7 @@ - result is changed - name: Delete single tag case - Update tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_delete_version }}' register: result @@ -809,7 +809,7 @@ - result.parameter_metadata.type == 'String' - name: Delete single tag case - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -820,7 +820,7 @@ # Test tags - delete tag w/ spaces case - name: Delete single tag w/ spaces case - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -828,7 +828,7 @@ register: result - name: Delete single tag w/ spaces case - Update tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_delete_tag_with_space }}' register: result @@ -838,7 +838,7 @@ - result is changed - name: Delete single tag w/ spaces case - Update tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_delete_tag_with_space }}' register: result @@ -880,7 +880,7 @@ - result.parameter_metadata.type == 'String' - name: Delete single tag w/ spaces case - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -891,7 +891,7 @@ # Test tags - Add/delete/change tags case - name: Add/delete/change tags case - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -899,7 +899,7 @@ register: result - name: Add/delete/change tags case - Update tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_add_delete_change }}' register: result @@ -909,7 +909,7 @@ - result is changed - name: Add/delete/change tags case - Update tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_add_delete_change }}' register: result @@ -951,7 +951,7 @@ - result.parameter_metadata.type == 'String' - name: Add/delete/change tags case - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -962,7 +962,7 @@ # Test tags - Delete all tags case - name: Delete all tags case - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -970,7 +970,7 @@ register: result - name: Delete all tags case - Update tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_delete_all_tags }}' register: result @@ -980,7 +980,7 @@ - result is changed - name: Delete all tags case - Update tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_delete_all_tags }}' register: result @@ -1022,7 +1022,7 @@ - result.parameter_metadata.type == 'String' - name: Delete all tags case - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -1033,7 +1033,7 @@ # Test tags - Add tag case (purge_tags=false) - name: Add tag case (purge_tags=false) - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -1041,7 +1041,7 @@ register: result - name: Add tag case (purge_tags=false) - Add tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_add_owner }}' purge_tags: False @@ -1052,7 +1052,7 @@ - result is changed - name: Add tag case (purge_tags=false) - Add tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_add_owner }}' purge_tags: False @@ -1100,7 +1100,7 @@ - result.parameter_metadata.type == 'String' - name: Add tag case (purge_tags=false) - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -1111,7 +1111,7 @@ # Test tags - Add multiple tags case (purge_tags=false) - name: Add multiple tags case (purge_tags=false) - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -1119,7 +1119,7 @@ register: result - name: Add multiple tags case (purge_tags=false) - Add tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_add_multiple }}' purge_tags: False @@ -1130,7 +1130,7 @@ - result is changed - name: Add multiple tags case (purge_tags=false) - Add tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_add_multiple }}' purge_tags: False @@ -1178,7 +1178,7 @@ - result.parameter_metadata.type == 'String' - name: Add multiple tags case (purge_tags=false) - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -1189,7 +1189,7 @@ # Test tags - Change tag case (purge_tags=false) - name: Change tag case (purge_tags=false) - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -1197,7 +1197,7 @@ register: result - name: Change tag case (purge_tags=false) - Change tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_change_environment}}' purge_tags: False @@ -1208,7 +1208,7 @@ - result is changed - name: Change tag case (purge_tags=false) - Change tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_change_environment }}' purge_tags: False @@ -1259,7 +1259,7 @@ - result.parameter_metadata.type == 'String' - name: Change tag case (purge_tags=false) - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -1270,7 +1270,7 @@ # Test tags - Change multiple tags case (purge_tags=false) - name: Change multiple tags (purge_tags=false) - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -1278,7 +1278,7 @@ register: result - name: Change multiple tags (purge_tags=false) - Change tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_change_multiple}}' purge_tags: False @@ -1289,7 +1289,7 @@ - result is changed - name: Change multiple tags (purge_tags=false) - Change tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_change_multiple }}' purge_tags: False @@ -1340,7 +1340,7 @@ - result.parameter_metadata.type == 'String' - name: Change multiple tags (purge_tags=false) - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -1351,7 +1351,7 @@ # Test tags - Add/Change multiple tags case (purge_tags=false) - name: Add/Change multiple tags (purge_tags=false) - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -1359,7 +1359,7 @@ register: result - name: Add/Change multiple tags (purge_tags=false) - Change tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_add_and_change}}' purge_tags: False @@ -1370,7 +1370,7 @@ - result is changed - name: Add/Change multiple tags (purge_tags=false) - Change tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: '{{ simple_tags_purge_false_add_and_change }}' purge_tags: False @@ -1421,7 +1421,7 @@ - result.parameter_metadata.type == 'String' - name: Add/Change multiple tags (purge_tags=false) - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -1432,7 +1432,7 @@ # Test tags - Empty tags dict case (purge_tags=false) # should be no change - name: Empty tags dict (purge_tags=false) - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -1440,7 +1440,7 @@ register: result - name: Empty tags dict (purge_tags=false) - Change tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: {} purge_tags: False @@ -1451,7 +1451,7 @@ - result != 'changed' - name: Empty tags dict (purge_tags=false) - Change tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' tags: {} purge_tags: False @@ -1500,7 +1500,7 @@ - result.parameter_metadata.type == 'String' - name: Empty tags dict (purge_tags=false) - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True @@ -1511,7 +1511,7 @@ # Test tags - No tags parameter (purge_tags=true) case # should be no change - name: No tags parameter (purge_tags=true) - Create parameter - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_description }}' value: '{{ simple_tag_param_value }}' @@ -1519,7 +1519,7 @@ register: result - name: No tags parameter (purge_tags=true) - Change tag (CHECK) - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_updated_description }}' register: result @@ -1529,7 +1529,7 @@ - result is changed - name: No tags parameter (purge_tags=true) - Change tag - aws_ssm_parameter_store: + ssm_parameter: name: '{{ simple_tag_param_name }}' description: '{{ simple_tag_param_updated_description }}' register: result @@ -1578,7 +1578,7 @@ - result.parameter_metadata.type == 'String' - name: No tags parameter (purge_tags=true) - Delete parameter - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: true @@ -1588,7 +1588,7 @@ always: # ============================================================ - name: Delete remaining key/value pairs in aws parameter store - aws_ssm_parameter_store: + ssm_parameter: name: "{{item}}" state: absent ignore_errors: True diff --git a/tests/integration/targets/stepfunctions_state_machine/tasks/main.yml b/tests/integration/targets/stepfunctions_state_machine/tasks/main.yml index e88430259a9..a1919f1aedf 100644 --- a/tests/integration/targets/stepfunctions_state_machine/tasks/main.yml +++ b/tests/integration/targets/stepfunctions_state_machine/tasks/main.yml @@ -33,7 +33,7 @@ # ==== Tests =================================================== - name: Create a new state machine -- check_mode - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" definition: "{{ lookup('file','state_machine.json') }}" role_arn: "{{ step_functions_role.iam_role.arn }}" @@ -49,7 +49,7 @@ - creation_check.output == 'State machine would be created.' - name: Create a new state machine - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" definition: "{{ lookup('file','state_machine.json') }}" role_arn: "{{ step_functions_role.iam_role.arn }}" @@ -68,7 +68,7 @@ seconds: 5 - name: Idempotent rerun of same state function -- check_mode - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" definition: "{{ lookup('file','state_machine.json') }}" role_arn: "{{ step_functions_role.iam_role.arn }}" @@ -84,7 +84,7 @@ - result.output == 'State is up-to-date.' - name: Idempotent rerun of same state function - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" definition: "{{ lookup('file','state_machine.json') }}" role_arn: "{{ step_functions_role.iam_role.arn }}" @@ -99,7 +99,7 @@ - result.state_machine_arn == creation_output.state_machine_arn - name: Update an existing state machine -- check_mode - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" definition: "{{ lookup('file','alternative_state_machine.json') }}" role_arn: "{{ step_functions_role.iam_role.arn }}" @@ -115,7 +115,7 @@ - "update_check.output == 'State machine would be updated: {{ creation_output.state_machine_arn }}'" - name: Update an existing state machine - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" definition: "{{ lookup('file','alternative_state_machine.json') }}" role_arn: "{{ step_functions_role.iam_role.arn }}" @@ -130,7 +130,7 @@ - update_output.state_machine_arn == creation_output.state_machine_arn - name: Start execution of state machine -- check_mode - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: name: "{{ execution_name }}" execution_input: "{}" state_machine_arn: "{{ creation_output.state_machine_arn }}" @@ -143,7 +143,7 @@ - "start_execution_output.output == 'State machine execution would be started.'" - name: Start execution of state machine - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: name: "{{ execution_name }}" execution_input: "{}" state_machine_arn: "{{ creation_output.state_machine_arn }}" @@ -156,7 +156,7 @@ - "'start_date' in start_execution_output" - name: Start execution of state machine (check for idempotency) (check mode) - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: name: "{{ execution_name }}" execution_input: "{}" state_machine_arn: "{{ creation_output.state_machine_arn }}" @@ -169,7 +169,7 @@ - "start_execution_output_idem_check.output == 'State machine execution already exists.'" - name: Start execution of state machine (check for idempotency) - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: name: "{{ execution_name }}" execution_input: "{}" state_machine_arn: "{{ creation_output.state_machine_arn }}" @@ -180,7 +180,7 @@ - not start_execution_output_idem.changed - name: Stop execution of state machine -- check_mode - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: action: stop execution_arn: "{{ start_execution_output.execution_arn }}" cause: "cause of the failure" @@ -194,7 +194,7 @@ - "stop_execution_output.output == 'State machine execution would be stopped.'" - name: Stop execution of state machine - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: action: stop execution_arn: "{{ start_execution_output.execution_arn }}" cause: "cause of the failure" @@ -207,7 +207,7 @@ - "'stop_date' in stop_execution_output" - name: Stop execution of state machine (check for idempotency) - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: action: stop execution_arn: "{{ start_execution_output.execution_arn }}" cause: "cause of the failure" @@ -219,7 +219,7 @@ - not stop_execution_output.changed - name: Try stopping a non-running execution -- check_mode - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: action: stop execution_arn: "{{ start_execution_output.execution_arn }}" cause: "cause of the failure" @@ -233,7 +233,7 @@ - "stop_execution_output.output == 'State machine execution is not running.'" - name: Try stopping a non-running execution - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: action: stop execution_arn: "{{ start_execution_output.execution_arn }}" cause: "cause of the failure" @@ -246,7 +246,7 @@ - not stop_execution_output.changed - name: Start execution of state machine with the same execution name - aws_step_functions_state_machine_execution: + stepfunctions_state_machine_execution: name: "{{ execution_name }}" state_machine_arn: "{{ creation_output.state_machine_arn }}" register: start_execution_output_again @@ -256,7 +256,7 @@ - not start_execution_output_again.changed - name: Remove state machine -- check_mode - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" state: absent register: deletion_check @@ -268,7 +268,7 @@ - "deletion_check.output == 'State machine would be deleted: {{ creation_output.state_machine_arn }}'" - name: Remove state machine - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" state: absent register: deletion_output @@ -279,7 +279,7 @@ - deletion_output.state_machine_arn == creation_output.state_machine_arn - name: Non-existent state machine is absent - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "non_existing_state_machine" state: absent register: result @@ -293,7 +293,7 @@ always: - name: Cleanup - delete state machine - aws_step_functions_state_machine: + stepfunctions_state_machine: name: "{{ state_machine_name }}" state: absent ignore_errors: true diff --git a/tests/integration/targets/waf_web_acl/tasks/main.yml b/tests/integration/targets/waf_web_acl/tasks/main.yml index 9884d2ee3e5..285ee2b3742 100644 --- a/tests/integration/targets/waf_web_acl/tasks/main.yml +++ b/tests/integration/targets/waf_web_acl/tasks/main.yml @@ -15,7 +15,7 @@ ################################################## - name: create WAF IP condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "10.0.0.0/8" @@ -23,7 +23,7 @@ register: create_waf_ip_condition - name: add an IP address to WAF condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "10.0.0.0/8" @@ -37,7 +37,7 @@ - add_ip_address_to_waf_condition.condition.ip_set_descriptors|length == 2 - name: add an IP address to WAF condition (rely on purge_filters defaulting to false) - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "192.168.10.0/24" @@ -51,7 +51,7 @@ - add_ip_address_to_waf_condition_no_purge.changed - name: add an IP address to WAF condition (set purge_filters) - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "192.168.20.0/24" @@ -66,7 +66,7 @@ - add_ip_address_to_waf_condition_purge.changed - name: create WAF byte condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_byte_condition" filters: - field_to_match: header @@ -77,7 +77,7 @@ register: create_waf_byte_condition - name: recreate WAF byte condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_byte_condition" filters: - field_to_match: header @@ -93,7 +93,7 @@ - not recreate_waf_byte_condition.changed - name: create WAF geo condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_geo_condition" filters: - country: US @@ -103,7 +103,7 @@ register: create_waf_geo_condition - name: create WAF size condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_size_condition" filters: - field_to_match: query_string @@ -113,7 +113,7 @@ register: create_waf_size_condition - name: create WAF sql condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_sql_condition" filters: - field_to_match: query_string @@ -122,7 +122,7 @@ register: create_waf_sql_condition - name: create WAF xss condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_xss_condition" filters: - field_to_match: query_string @@ -131,7 +131,7 @@ register: create_waf_xss_condition - name: create WAF regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" filters: - field_to_match: query_string @@ -145,7 +145,7 @@ register: create_waf_regex_condition - name: create a second WAF regex condition with the same regex - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition_part_2" filters: - field_to_match: header @@ -169,7 +169,7 @@ - name: delete first WAF regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" filters: - field_to_match: query_string @@ -184,7 +184,7 @@ register: delete_waf_regex_condition - name: delete second WAF regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition_part_2" filters: - field_to_match: header @@ -200,7 +200,7 @@ register: delete_second_waf_regex_condition - name: create WAF regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" filters: - field_to_match: query_string @@ -221,7 +221,7 @@ create_waf_regex_condition.condition.regex_match_tuples[0].regex_pattern_set_id - name: create WAF Regional IP condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "10.0.0.0/8" @@ -231,7 +231,7 @@ register: create_waf_regional_ip_condition - name: add an IP address to WAF Regional condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "10.0.0.0/8" @@ -247,7 +247,7 @@ - add_ip_address_to_waf_regional_condition.condition.ip_set_descriptors|length == 2 - name: add an IP address to WAF Regional condition (rely on purge_filters defaulting to false) - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "192.168.10.0/24" @@ -263,7 +263,7 @@ - add_ip_address_to_waf_regional_condition_no_purge.changed - name: add an IP address to WAF Regional condition (set purge_filters) - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" filters: - ip_address: "192.168.20.0/24" @@ -280,7 +280,7 @@ - add_ip_address_to_waf_regional_condition_purge.changed - name: create WAF Regional byte condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_byte_condition" filters: - field_to_match: header @@ -293,7 +293,7 @@ register: create_waf_regional_byte_condition - name: recreate WAF Regional byte condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_byte_condition" filters: - field_to_match: header @@ -311,7 +311,7 @@ - not recreate_waf_regional_byte_condition.changed - name: create WAF Regional geo condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_geo_condition" filters: - country: US @@ -323,7 +323,7 @@ register: create_waf_regional_geo_condition - name: create WAF Regional size condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_size_condition" filters: - field_to_match: query_string @@ -335,7 +335,7 @@ register: create_waf_regional_size_condition - name: create WAF Regional sql condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_sql_condition" filters: - field_to_match: query_string @@ -346,7 +346,7 @@ register: create_waf_regional_sql_condition - name: create WAF Regional xss condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_xss_condition" filters: - field_to_match: query_string @@ -357,7 +357,7 @@ register: create_waf_regional_xss_condition - name: create WAF Regional regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" filters: - field_to_match: query_string @@ -373,7 +373,7 @@ register: create_waf_regional_regex_condition - name: create a second WAF Regional regex condition with the same regex - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition_part_2" filters: - field_to_match: header @@ -399,7 +399,7 @@ - name: delete first WAF Regional regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" filters: - field_to_match: query_string @@ -416,7 +416,7 @@ register: delete_waf_regional_regex_condition - name: delete second WAF Regional regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition_part_2" filters: - field_to_match: header @@ -434,7 +434,7 @@ register: delete_second_waf_regional_regex_condition - name: create WAF Regional regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" filters: - field_to_match: query_string @@ -461,7 +461,7 @@ ################################################## - name: create WAF rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_regex_condition" @@ -483,7 +483,7 @@ - create_aws_waf_rule.rule.predicates|length == 3 - name: recreate WAF rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_regex_condition" @@ -504,7 +504,7 @@ - create_aws_waf_rule.rule.predicates|length == 3 - name: add further WAF rules relying on purge_conditions defaulting to false - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_ip_condition" @@ -525,7 +525,7 @@ - add_conditions_to_aws_waf_rule.rule.predicates|length == 6 - name: remove some rules through purging conditions - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_ip_condition" @@ -550,7 +550,7 @@ - add_and_remove_waf_rule_conditions.rule.predicates|length == 4 - name: attempt to remove an in use condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_size_condition" type: size state: absent @@ -564,7 +564,7 @@ - "'Condition {{ resource_prefix }}_size_condition is in use' in remove_in_use_condition.msg" - name: create WAF Regional rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_regex_condition" @@ -588,7 +588,7 @@ - create_aws_waf_regional_rule.rule.predicates|length == 3 - name: recreate WAF Regional rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_regex_condition" @@ -611,7 +611,7 @@ - create_aws_waf_regional_rule.rule.predicates|length == 3 - name: add further WAF Regional rules relying on purge_conditions defaulting to false - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_ip_condition" @@ -634,7 +634,7 @@ - add_conditions_to_aws_waf_regional_rule.rule.predicates|length == 6 - name: remove some rules through purging conditions - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" conditions: - name: "{{ resource_prefix }}_ip_condition" @@ -661,7 +661,7 @@ - add_and_remove_waf_regional_rule_conditions.rule.predicates|length == 4 - name: attempt to remove an WAF Regional in use condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_size_condition" type: size state: absent @@ -681,7 +681,7 @@ ################################################## - name: create web ACL - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule" @@ -693,7 +693,7 @@ register: create_web_acl - name: recreate web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule" @@ -710,7 +710,7 @@ - recreate_web_acl.web_acl.rules|length == 1 - name: create a second WAF rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule_2" conditions: - name: "{{ resource_prefix }}_ip_condition" @@ -724,7 +724,7 @@ negated: no - name: add a new rule to the web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule_2" @@ -741,7 +741,7 @@ - web_acl_add_rule.web_acl.rules|length == 2 - name: use purge rules to remove the first rule - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule_2" @@ -759,7 +759,7 @@ - web_acl_add_rule.web_acl.rules|length == 1 - name: swap two rules of same priority - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule" @@ -771,7 +771,7 @@ register: web_acl_swap_rule - name: attempt to delete the inuse first rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" state: absent ignore_errors: yes @@ -783,7 +783,7 @@ - remove_inuse_rule.failed - name: delete the web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" state: absent register: delete_web_acl @@ -795,12 +795,12 @@ - not delete_web_acl.web_acl - name: delete the no longer in use first rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" state: absent - name: create WAF Regional web ACL - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule" @@ -814,7 +814,7 @@ register: create_waf_regional_web_acl - name: recreate WAF Regional web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule" @@ -833,7 +833,7 @@ - recreate_waf_regional_web_acl.web_acl.rules|length == 1 - name: create a second WAF Regional rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule_2" conditions: - name: "{{ resource_prefix }}_ip_condition" @@ -849,7 +849,7 @@ waf_regional: true - name: add a new rule to the WAF Regional web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule_2" @@ -868,7 +868,7 @@ - waf_regional_web_acl_add_rule.web_acl.rules|length == 2 - name: use purge rules to remove the WAF Regional first rule - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule_2" @@ -888,7 +888,7 @@ - waf_regional_web_acl_add_rule.web_acl.rules|length == 1 - name: swap two WAF Regional rules of same priority - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" rules: - name: "{{ resource_prefix }}_rule" @@ -902,7 +902,7 @@ register: waf_regional_web_acl_swap_rule - name: attempt to delete the WAF Regional inuse first rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" state: absent region: "{{ aws_region }}" @@ -916,7 +916,7 @@ - remove_waf_regional_inuse_rule.failed - name: delete the WAF Regional web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" state: absent region: "{{ aws_region }}" @@ -930,7 +930,7 @@ - not delete_waf_regional_web_acl.web_acl - name: delete the no longer in use WAF Regional first rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" state: absent region: "{{ aws_region }}" @@ -945,84 +945,84 @@ msg: "****** TEARDOWN STARTS HERE ******" - name: delete the web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" state: absent purge_rules: yes ignore_errors: yes - name: remove second WAF rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule_2" state: absent purge_conditions: yes ignore_errors: yes - name: remove WAF rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" state: absent purge_conditions: yes ignore_errors: yes - name: remove XSS condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_xss_condition" type: xss state: absent ignore_errors: yes - name: remove SQL condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_sql_condition" type: sql state: absent ignore_errors: yes - name: remove size condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_size_condition" type: size state: absent ignore_errors: yes - name: remove geo condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_geo_condition" type: geo state: absent ignore_errors: yes - name: remove byte condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_byte_condition" type: byte state: absent ignore_errors: yes - name: remove ip address condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" type: ip state: absent ignore_errors: yes - name: remove regex part 2 condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition_part_2" type: regex state: absent ignore_errors: yes - name: remove first regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" type: regex state: absent ignore_errors: yes - name: delete the WAF Regional web acl - aws_waf_web_acl: + waf_web_acl: name: "{{ resource_prefix }}_web_acl" state: absent purge_rules: yes @@ -1031,7 +1031,7 @@ ignore_errors: yes - name: remove second WAF Regional rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule_2" state: absent purge_conditions: yes @@ -1040,7 +1040,7 @@ ignore_errors: yes - name: remove WAF Regional rule - aws_waf_rule: + waf_rule: name: "{{ resource_prefix }}_rule" state: absent purge_conditions: yes @@ -1049,7 +1049,7 @@ ignore_errors: yes - name: remove WAF Regional XSS condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_xss_condition" type: xss state: absent @@ -1058,7 +1058,7 @@ ignore_errors: yes - name: remove WAF Regional SQL condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_sql_condition" type: sql state: absent @@ -1067,7 +1067,7 @@ ignore_errors: yes - name: remove WAF Regional size condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_size_condition" type: size state: absent @@ -1076,7 +1076,7 @@ ignore_errors: yes - name: remove WAF Regional geo condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_geo_condition" type: geo state: absent @@ -1085,7 +1085,7 @@ ignore_errors: yes - name: remove WAF Regional byte condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_byte_condition" type: byte state: absent @@ -1094,7 +1094,7 @@ ignore_errors: yes - name: remove WAF Regional ip address condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_ip_condition" type: ip state: absent @@ -1103,7 +1103,7 @@ ignore_errors: yes - name: remove WAF Regional regex part 2 condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition_part_2" type: regex state: absent @@ -1112,7 +1112,7 @@ ignore_errors: yes - name: remove first WAF Regional regex condition - aws_waf_condition: + waf_condition: name: "{{ resource_prefix }}_regex_condition" type: regex state: absent diff --git a/tests/integration/targets/wafv2/tasks/alb.yml b/tests/integration/targets/wafv2/tasks/alb.yml index 32aeb376a3b..c56ad6d46e0 100644 --- a/tests/integration/targets/wafv2/tasks/alb.yml +++ b/tests/integration/targets/wafv2/tasks/alb.yml @@ -63,7 +63,7 @@ gateway_id: '{{ igw.gateway_id }}' register: route_table -- ec2_group: +- ec2_security_group: name: '{{ resource_prefix }}' description: security group for Ansible ALB integration tests state: present diff --git a/tests/integration/targets/wafv2/tasks/main.yml b/tests/integration/targets/wafv2/tasks/main.yml index 5ce694e4d37..a536cf4051f 100644 --- a/tests/integration/targets/wafv2/tasks/main.yml +++ b/tests/integration/targets/wafv2/tasks/main.yml @@ -126,7 +126,7 @@ ignore_errors: true - name: destroy sec group - ec2_group: + ec2_security_group: name: '{{ sec_group.group_name }}' description: security group for Ansible ALB integration tests state: absent