From c0e2ab61731371ce2e9af81789e8a45862bf78d1 Mon Sep 17 00:00:00 2001 From: Mike Graves Date: Sat, 9 Dec 2023 15:34:13 -0500 Subject: [PATCH] Fix additional FQCNs (#1914) Fix additional FQCNs SUMMARY #1902 attempted to fix FQCNs using ansible-lint --fix, but this apparently missed quite a few instances. This hopefully fixes the rest. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Mark Chappell Reviewed-by: Alina Buzachis --- .../ec2_asg/tasks/create_update_delete.yml | 68 +++++----- .../roles/ec2_asg/tasks/env_cleanup.yml | 6 +- .../roles/ec2_asg/tasks/env_setup.yml | 2 +- .../roles/ec2_asg/tasks/instance_detach.yml | 26 ++-- .../roles/ec2_asg/tasks/tag_operations.yml | 52 ++++---- .../targets/backup_vault/tasks/main.yml | 4 +- .../targets/cloudtrail/tasks/main.yml | 68 +++++----- .../targets/cloudtrail/tasks/tagging.yml | 2 +- .../tasks/env_cleanup.yml | 2 +- .../tasks/env_setup.yml | 2 +- .../cloudwatch_metric_alarm/tasks/main.yml | 30 ++--- .../targets/ec2_ami/tasks/main.yml | 4 +- .../targets/ec2_ami_instance/tasks/main.yml | 4 +- .../targets/ec2_ami_snapshot/tasks/main.yml | 4 +- .../targets/ec2_ami_tpm/tasks/main.yml | 4 +- .../targets/ec2_eip/tasks/main.yml | 4 +- .../targets/ec2_eni/tasks/main.yaml | 4 +- .../targets/ec2_key/tasks/main.yml | 18 +-- .../ec2_metadata_facts/playbooks/setup.yml | 2 +- .../ec2_metadata_facts/playbooks/teardown.yml | 2 +- .../tasks/data_validation.yml | 6 +- .../ec2_security_group/tasks/diff_mode.yml | 16 +-- .../ec2_security_group/tasks/egress_tests.yml | 22 ++-- .../ec2_security_group/tasks/group_info.yml | 16 +-- .../ec2_security_group/tasks/icmp_verbs.yml | 30 ++--- .../tasks/ipv6_default_tests.yml | 10 +- .../targets/ec2_security_group/tasks/main.yml | 124 +++++++++--------- .../tasks/multi_account.yml | 12 +- .../tasks/multi_nested_target.yml | 18 +-- .../tasks/numeric_protos.yml | 10 +- .../tasks/rule_group_create.yml | 18 +-- .../targets/ec2_snapshot/tasks/main.yml | 4 +- .../targets/ec2_spot_instance/tasks/main.yaml | 28 ++-- .../targets/ec2_vpc_endpoint/tasks/main.yml | 10 +- .../tasks/main.yml | 8 +- .../elb_classic_lb/tasks/basic_internal.yml | 2 +- .../elb_classic_lb/tasks/basic_public.yml | 2 +- .../elb_classic_lb/tasks/cleanup_vpc.yml | 2 +- .../elb_classic_lb/tasks/schema_change.yml | 8 +- .../elb_classic_lb/tasks/setup_vpc.yml | 6 +- .../targets/iam_access_key/tasks/main.yml | 80 +++++------ .../iam_instance_profile/tasks/main.yml | 70 +++++----- .../iam_instance_profile/tasks/tags.yml | 54 ++++---- .../targets/iam_role/tasks/main.yml | 2 +- .../iam_role/tasks/parameter_checks.yml | 2 +- .../playbooks/test_inventory_ssm.yml | 2 +- .../targets/inventory_aws_ec2/tasks/setup.yml | 2 +- .../inventory_aws_ec2/tasks/tear_down.yml | 2 +- .../roles/aws_kms/tasks/test_grants.yml | 20 +-- .../roles/aws_kms/tasks/test_modify.yml | 24 ++-- .../roles/aws_kms/tasks/test_multi_region.yml | 12 +- .../roles/aws_kms/tasks/test_states.yml | 50 +++---- .../roles/aws_kms/tasks/test_tagging.yml | 14 +- .../integration/targets/lambda/tasks/main.yml | 18 +-- .../targets/lambda_layer/tasks/main.yml | 34 ++--- .../targets/lambda_policy/tasks/main.yml | 6 +- .../tasks/main.yaml | 6 +- .../lookup_ssm_parameter/tasks/main.yml | 14 +- .../rds_cluster_create/tasks/main.yaml | 16 +-- .../rds_cluster_create_sgs/tasks/main.yaml | 18 +-- .../rds_cluster_modify/tasks/main.yaml | 20 +-- .../rds_cluster_multi_az/tasks/main.yml | 8 +- .../rds_cluster_promote/tasks/main.yaml | 20 +-- .../rds_cluster_restore/tasks/main.yaml | 16 +-- .../rds_cluster_snapshot/tasks/main.yml | 40 +++--- .../targets/rds_cluster_states/tasks/main.yml | 12 +- .../targets/rds_cluster_tag/tasks/main.yaml | 20 +-- .../rds_instance_aurora/tasks/main.yml | 4 +- .../rds_instance_sgroups/tasks/main.yml | 4 +- .../rds_instance_snapshot/tasks/main.yml | 38 +++--- .../rds_instance_snapshot_mgmt/tasks/main.yml | 4 +- .../s3_bucket/tasks/encryption_bucket_key.yml | 4 +- .../roles/s3_bucket/tasks/encryption_kms.yml | 4 +- .../roles/s3_bucket/tasks/encryption_sse.yml | 4 +- .../targets/s3_bucket_info/tasks/basic.yml | 4 +- .../tasks/bucket_ownership_controls.yml | 4 +- .../targets/s3_object/tasks/copy_object.yml | 16 +-- .../s3_object/tasks/copy_recursively.yml | 22 ++-- .../targets/s3_object/tasks/delete_bucket.yml | 4 +- .../targets/s3_object/tasks/main.yml | 114 ++++++++-------- .../setup_ec2_instance_env/tasks/cleanup.yml | 6 +- .../targets/setup_ec2_vpc/tasks/cleanup.yml | 6 +- 82 files changed, 740 insertions(+), 740 deletions(-) diff --git a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/create_update_delete.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/create_update_delete.yml index 900293cdd49..34af6d3edf1 100644 --- a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/create_update_delete.yml +++ b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/create_update_delete.yml @@ -6,7 +6,7 @@ # ============================================================ - name: test without specifying required module options - autoscaling_group: + amazon.aws.autoscaling_group: access_key: "{{ aws_access_key }}" secret_key: "{{ aws_secret_key }}" session_token: "{{ security_token | default(omit) }}" @@ -18,7 +18,7 @@ - "result.msg == 'missing required arguments: name'" - name: ensure launch configs exist - autoscaling_launch_config: + community.aws.autoscaling_launch_config: name: "{{ item }}" assign_public_ip: true image_id: "{{ ec2_ami_id }}" @@ -39,7 +39,7 @@ # ============================================================ - name: launch asg and wait for instances to be deemed healthy (no ELB) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" desired_capacity: 1 @@ -54,7 +54,7 @@ - output.viable_instances == 1 - name: Enable metrics collection - check_mode - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" metrics_collection: true register: output @@ -66,7 +66,7 @@ - '"autoscaling:UpdateAutoScalingGroup" not in output.resource_actions' - name: Enable metrics collection - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" metrics_collection: true register: output @@ -75,7 +75,7 @@ - output is changed - name: Enable metrics collection (idempotency) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" metrics_collection: true register: output @@ -84,7 +84,7 @@ - output is not changed - name: Disable metrics collection - check_mode - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" metrics_collection: false register: output @@ -96,7 +96,7 @@ - '"autoscaling:UpdateAutoScalingGroup" not in output.resource_actions' - name: Disable metrics collection - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" metrics_collection: false register: output @@ -105,7 +105,7 @@ - output is changed - name: Disable metrics collection (idempotency) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" metrics_collection: false register: output @@ -114,13 +114,13 @@ - output is not changed - name: kill asg - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" state: absent wait_timeout: 800 async: 400 - name: launch asg and do not wait for instances to be deemed healthy (no ELB) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" desired_capacity: 1 @@ -135,7 +135,7 @@ - output.viable_instances == 0 - name: kill asg - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" state: absent wait_timeout: 800 @@ -145,7 +145,7 @@ delay: 10 async: 400 - name: create asg with asg metrics enabled - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" metrics_collection: true launch_config_name: "{{ resource_prefix }}-lc" @@ -160,7 +160,7 @@ - "'Group' in output.metrics_collection.0.Metric" - name: kill asg - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" state: absent wait_timeout: 800 @@ -187,7 +187,7 @@ healthy_threshold: 2 register: load_balancer - name: launch asg and wait for instances to be deemed healthy (ELB) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" health_check_type: ELB @@ -209,7 +209,7 @@ # grow scaling group to 3 - name: add 2 more instances wait for instances to be deemed healthy (ELB) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" health_check_type: ELB @@ -231,7 +231,7 @@ # Test max_instance_lifetime option - name: enable asg max_instance_lifetime - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" max_instance_lifetime: 604801 register: output @@ -241,7 +241,7 @@ - output.max_instance_lifetime == 604801 - name: run without max_instance_lifetime - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" - name: ensure max_instance_lifetime not affected by defaults @@ -250,7 +250,7 @@ - output.max_instance_lifetime == 604801 - name: disable asg max_instance_lifetime - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" max_instance_lifetime: 0 @@ -264,7 +264,7 @@ # perform rolling replace with different launch configuration - name: perform rolling update to new AMI - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc-2" health_check_type: ELB @@ -291,7 +291,7 @@ # perform rolling replace with the original launch configuration - name: perform rolling update to new AMI while removing the load balancer - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" health_check_type: EC2 @@ -318,7 +318,7 @@ # perform rolling replace with new launch configuration and lc_check:false - name: "perform rolling update to new AMI with lc_check: false" - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc-2" health_check_type: EC2 @@ -335,7 +335,7 @@ wait_timeout: 1800 state: present - name: get autoscaling_group info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg" register: output - ansible.builtin.assert: @@ -345,13 +345,13 @@ # ============================================================ - name: kill asg - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" state: absent wait_timeout: 800 async: 400 - name: "new asg with lc_check: false" - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_config_name: "{{ resource_prefix }}-lc" health_check_type: EC2 @@ -368,7 +368,7 @@ wait_timeout: 1800 state: present - name: get autoscaling_group information - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg" register: output - ansible.builtin.assert: @@ -391,7 +391,7 @@ - "{{ sg.group_id }}" - name: update autoscaling group with mixed-instances policy with mixed instances types - check_mode - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" @@ -414,7 +414,7 @@ - '"autoscaling:CreateOrUpdateTags" not in output.resource_actions' - name: update autoscaling group with mixed-instances policy with mixed instances types - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" @@ -436,7 +436,7 @@ - output.mixed_instances_policy[1] == 't2.nano' - name: update autoscaling group with mixed-instances policy with instances_distribution - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" @@ -492,7 +492,7 @@ state: present register: out_tg2 - name: update autoscaling group with tg1 - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" @@ -509,7 +509,7 @@ - output.target_group_arns[0] == out_tg1.target_group_arn - name: update autoscaling group add tg2 - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" @@ -527,7 +527,7 @@ - output.target_group_arns | length == 2 - name: update autoscaling group remove tg1 - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" @@ -545,7 +545,7 @@ - output.target_group_arns[0] == out_tg2.target_group_arn - name: update autoscaling group remove tg2 and add tg1 - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" @@ -563,7 +563,7 @@ - output.target_group_arns[0] == out_tg1.target_group_arn - name: target group no change - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" launch_template: launch_template_name: "{{ resource_prefix }}-lt" diff --git a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_cleanup.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_cleanup.yml index 46e790daa09..e27407deb8a 100644 --- a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_cleanup.yml +++ b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_cleanup.yml @@ -1,6 +1,6 @@ --- - name: kill asg - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg" state: absent register: removed @@ -45,7 +45,7 @@ ignore_errors: true retries: 10 - name: remove launch configs - autoscaling_launch_config: + community.aws.autoscaling_launch_config: name: "{{ item }}" state: absent register: removed @@ -65,7 +65,7 @@ until: del_lt is not failed ignore_errors: true - name: remove the security group - ec2_security_group: + amazon.aws.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_group/roles/ec2_asg/tasks/env_setup.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_setup.yml index c28f5577330..8584423e5f2 100644 --- a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_setup.yml +++ b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_setup.yml @@ -35,7 +35,7 @@ - "{{ testing_subnet.subnet.id }}" - name: create a security group with the vpc created in the ec2_setup - ec2_security_group: + amazon.aws.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_group/roles/ec2_asg/tasks/instance_detach.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/instance_detach.yml index 67891e42a0d..d31558fcfbc 100644 --- a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/instance_detach.yml +++ b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/instance_detach.yml @@ -3,7 +3,7 @@ block: #---------------------------------------------------------------------- - name: create a launch configuration - autoscaling_launch_config: + community.aws.autoscaling_launch_config: name: "{{ resource_prefix }}-lc-detach-test" image_id: "{{ ec2_ami_id }}" region: "{{ aws_region }}" @@ -20,7 +20,7 @@ #---------------------------------------------------------------------- - name: create a AutoScalingGroup to be used for instance_detach test - check_mode - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" launch_config_name: "{{ resource_prefix }}-lc-detach-test" health_check_period: 60 @@ -39,7 +39,7 @@ - '"autoscaling:CreateAutoScalingGroup" not in create_asg.resource_actions' - name: create a AutoScalingGroup to be used for instance_detach test - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" launch_config_name: "{{ resource_prefix }}-lc-detach-test" health_check_period: 60 @@ -61,7 +61,7 @@ - '"autoscaling:CreateAutoScalingGroup" in create_asg.resource_actions' - name: gather info about asg, get instance ids - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-detach-test" register: asg_info - ansible.builtin.set_fact: @@ -85,7 +85,7 @@ #---------------------------------------------------------------------- - name: detach 2 instance from the asg and replace with other instances - check_mode - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" launch_config_name: "{{ resource_prefix }}-lc-detach-test" health_check_period: 60 @@ -106,7 +106,7 @@ - '"autoscaling:DetachInstances" not in detach_result.resource_actions' - name: detach 2 instance from the asg and replace with other instances - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" launch_config_name: "{{ resource_prefix }}-lc-detach-test" health_check_period: 60 @@ -123,7 +123,7 @@ - name: Pause for 30 seconds ansible.builtin.wait_for: timeout: 30 - - autoscaling_group_info: + - amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-detach-test" register: asg_info_replaced - ansible.builtin.set_fact: @@ -151,7 +151,7 @@ # detach 2 instances from the asg and reduce the desired capacity from 3 to 1 - name: detach 2 instance from the asg and reduce the desired capacity from 3 to 1 - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" launch_config_name: "{{ resource_prefix }}-lc-detach-test" health_check_period: 60 @@ -168,7 +168,7 @@ - name: Pause for 30 seconds to allow completion of above task ansible.builtin.wait_for: timeout: 30 - - autoscaling_group_info: + - amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-detach-test" register: asg_info_decrement - ansible.builtin.set_fact: @@ -208,7 +208,7 @@ - "{{ instance_replace_3 }}" - name: kill asg created in this test - check_mode - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" state: absent register: removed @@ -220,7 +220,7 @@ - '"autoscaling:DeleteAutoScalingGroup" not in removed.resource_actions' - name: kill asg created in this test - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" state: absent register: removed @@ -228,7 +228,7 @@ ignore_errors: true retries: 10 - name: kill asg created in this test - check_mode (idempotent) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-detach-test" state: absent register: removed @@ -240,7 +240,7 @@ - '"autoscaling:DeleteAutoScalingGroup" not in removed.resource_actions' - name: remove launch config created in this test - autoscaling_launch_config: + community.aws.autoscaling_launch_config: name: "{{ resource_prefix }}-lc-detach-test" state: absent register: removed diff --git a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/tag_operations.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/tag_operations.yml index 33905bd1a8f..51c69e67712 100644 --- a/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/tag_operations.yml +++ b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/tag_operations.yml @@ -3,7 +3,7 @@ block: #---------------------------------------------------------------------- - name: create a launch configuration - autoscaling_launch_config: + community.aws.autoscaling_launch_config: name: "{{ resource_prefix }}-lc-tag-test" image_id: "{{ ec2_ami_id }}" region: "{{ aws_region }}" @@ -19,7 +19,7 @@ #---------------------------------------------------------------------- - name: create a AutoScalingGroup to be used for tag_operations test - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" launch_config_name: "{{ resource_prefix }}-lc-tag-test" health_check_period: 60 @@ -40,7 +40,7 @@ #---------------------------------------------------------------------- - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.assert: @@ -48,7 +48,7 @@ - info_result.results[0].tags | length == 0 - name: Tag asg - check_mode - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - tag_a: value 1 @@ -64,7 +64,7 @@ - '"autoscaling:CreateOrUpdateTags" not in output.resource_actions' - name: Tag asg - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - tag_a: value 1 @@ -78,7 +78,7 @@ - output is changed - name: Re-Tag asg (different order) - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - tag_b: value 2 @@ -92,7 +92,7 @@ - output is not changed - name: Re-Tag asg new tags - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - tag_c: value 3 @@ -105,7 +105,7 @@ - output is changed - name: Re-Tag asg update propagate_at_launch - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - tag_c: value 3 @@ -117,13 +117,13 @@ - output is changed - name: Remove all tags - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: [] purge_tags: true register: add_empty - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.set_fact: @@ -136,7 +136,7 @@ - '"autoscaling:DeleteTags" in add_empty.resource_actions' - name: Add 4 new tags - do not purge existing tags - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - lowercase spaced: hello cruel world @@ -149,7 +149,7 @@ propagate_at_launch: false register: add_result - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.set_fact: @@ -165,7 +165,7 @@ - '"autoscaling:CreateOrUpdateTags" in add_result.resource_actions' - name: Add 4 new tags - do not purge existing tags - idempotency - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - lowercase spaced: hello cruel world @@ -178,7 +178,7 @@ propagate_at_launch: false register: add_result - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.assert: @@ -188,7 +188,7 @@ - '"autoscaling:CreateOrUpdateTags" not in add_result.resource_actions' - name: Add 2 new tags - purge existing tags - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - tag_a: val_a @@ -198,7 +198,7 @@ purge_tags: true register: add_purge_result - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.set_fact: @@ -216,7 +216,7 @@ - '"autoscaling:CreateOrUpdateTags" in add_purge_result.resource_actions' - name: Re-tag ASG - modify values - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - tag_a: new_val_a @@ -225,7 +225,7 @@ propagate_at_launch: true register: add_purge_result - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.set_fact: @@ -247,7 +247,7 @@ - '"autoscaling:CreateOrUpdateTags" in add_purge_result.resource_actions' - name: Add 2 more tags - do not purge existing tags - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: - lowercase spaced: hello cruel world @@ -256,7 +256,7 @@ propagate_at_launch: true register: add_result - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.set_fact: @@ -272,13 +272,13 @@ - '"autoscaling:CreateOrUpdateTags" in add_result.resource_actions' - name: Add empty tags with purge set to false to assert that existing tags are retained - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: [] purge_tags: false register: add_empty - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.set_fact: @@ -294,13 +294,13 @@ - '"autoscaling:CreateOrUpdateTags" not in add_empty.resource_actions' - name: Add empty tags with purge set to true to assert that existing tags are removed - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" tags: [] purge_tags: true register: add_empty - name: Get asg info - autoscaling_group_info: + amazon.aws.autoscaling_group_info: name: "{{ resource_prefix }}-asg-tag-test" register: info_result - ansible.builtin.set_fact: @@ -320,7 +320,7 @@ always: - name: kill asg created in this test - autoscaling_group: + amazon.aws.autoscaling_group: name: "{{ resource_prefix }}-asg-tag-test" state: absent register: removed @@ -328,7 +328,7 @@ ignore_errors: true retries: 10 - name: remove launch config created in this test - autoscaling_launch_config: + community.aws.autoscaling_launch_config: name: "{{ resource_prefix }}-lc-tag-test" state: absent register: removed diff --git a/tests/integration/targets/backup_vault/tasks/main.yml b/tests/integration/targets/backup_vault/tasks/main.yml index beca5a29243..a4bd68882fd 100644 --- a/tests/integration/targets/backup_vault/tasks/main.yml +++ b/tests/integration/targets/backup_vault/tasks/main.yml @@ -7,7 +7,7 @@ region: "{{ aws_region }}" block: - name: create a key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present enabled: true @@ -252,7 +252,7 @@ ignore_errors: true - name: finish off by deleting keys - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ kms_key_alias }}" pending_window: 7 diff --git a/tests/integration/targets/cloudtrail/tasks/main.yml b/tests/integration/targets/cloudtrail/tasks/main.yml index da7e5d9fe42..3d4f601445d 100644 --- a/tests/integration/targets/cloudtrail/tasks/main.yml +++ b/tests/integration/targets/cloudtrail/tasks/main.yml @@ -37,7 +37,7 @@ # Argument Tests # ============================================================ - name: S3 Bucket required when state is "present" - module_defaults: { cloudtrail: {}} + module_defaults: { amazon.aws.cloudtrail: {}} amazon.aws.cloudtrail: state: present name: "{{ cloudtrail_name }}" @@ -74,7 +74,7 @@ - '"cloudwatch_logs_role_arn" in output.msg' #- name: 'Global Logging must be enabled when enabling Multi-region' - # cloudtrail: + # amazon.aws.cloudtrail: # state: present # name: '{{ cloudtrail_name }}' # include_global_events: no @@ -126,14 +126,14 @@ policy: "{{ lookup('template', 'sns-policy.j2') | to_json }}" - name: Create KMS Key - kms_key: + amazon.aws.kms_key: state: present alias: "{{ kms_alias }}" enabled: true policy: "{{ lookup('template', 'kms-policy.j2') | to_json }}" register: kms_key - name: Create second KMS Key - kms_key: + amazon.aws.kms_key: state: present alias: "{{ kms_alias }}-2" enabled: true @@ -236,7 +236,7 @@ - output.trail.tags | length == 0 - name: Get the trail info - cloudtrail_info: + amazon.aws.cloudtrail_info: register: info - name: Get the trail name from the cloud trail info @@ -301,7 +301,7 @@ - output.trail.s3_key_prefix == cloudtrail_prefix - name: Get the trail info - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -347,7 +347,7 @@ - output.trail.s3_key_prefix == cloudtrail_prefix+"-2" - name: Get the trail info after updating S3 prefix - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -393,7 +393,7 @@ - output.trail.s3_key_prefix is none - name: Get the trail info after removing S3 prefix - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -453,7 +453,7 @@ - output.trail.sns_topic_name == sns_topic - name: Get the trail info with SNS topic - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -499,7 +499,7 @@ - output.trail.sns_topic_name == sns_topic+"-2" - name: Get the trail info with SNS topic after update - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -510,7 +510,7 @@ - info.trail_list[0].sns_topic_name == sns_topic+"-2" #- name: 'Remove SNS Topic (CHECK MODE)' - # cloudtrail: + # amazon.aws.cloudtrail: # state: present # name: '{{ cloudtrail_name }}' # sns_topic_name: '' @@ -521,7 +521,7 @@ # - output is changed #- name: 'Remove SNS Topic' - # cloudtrail: + # amazon.aws.cloudtrail: # state: present # name: '{{ cloudtrail_name }}' # sns_topic_name: '' @@ -533,7 +533,7 @@ # - output.trail.sns_topic_name is none #- name: 'Remove SNS Topic (no change)' - # cloudtrail: + # amazon.aws.cloudtrail: # state: present # name: '{{ cloudtrail_name }}' # sns_topic_name: '' @@ -599,7 +599,7 @@ - output.trail.cloud_watch_logs_role_arn == output_cloudwatch_role.arn - name: Get the trail info with CloudWatch Log Group - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -653,7 +653,7 @@ - output.trail.cloud_watch_logs_role_arn == output_cloudwatch_role.arn - name: Get the trail info with CloudWatch Log Group after update - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -665,7 +665,7 @@ - info.trail_list[0].cloud_watch_logs_role_arn == output_cloudwatch_role.arn #- name: 'Remove CloudWatch Log Group (CHECK MODE)' - # cloudtrail: + # amazon.aws.cloudtrail: # state: present # name: '{{ cloudtrail_name }}' # cloudwatch_logs_log_group_arn: '' @@ -680,7 +680,7 @@ # - output.trail.cloud_watch_logs_role_arn is none #- name: 'Remove CloudWatch Log Group' - # cloudtrail: + # amazon.aws.cloudtrail: # state: present # name: '{{ cloudtrail_name }}' # cloudwatch_logs_log_group_arn: '' @@ -694,7 +694,7 @@ # - output.trail.cloud_watch_logs_role_arn is none #- name: 'Remove CloudWatch Log Group (no change)' - # cloudtrail: + # amazon.aws.cloudtrail: # state: present # name: '{{ cloudtrail_name }}' # cloudwatch_logs_log_group_arn: '' @@ -745,7 +745,7 @@ - output.trail.s3_bucket_name == s3_bucket_name+"-2" - name: Get the trail info with S3 bucket name - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -803,7 +803,7 @@ - output.trail.is_logging == False - name: Get the trail info to check the logging state - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -851,7 +851,7 @@ - output.trail.is_logging == True - name: Get the trail info to check the logging state - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -899,7 +899,7 @@ - output.trail.include_global_service_events == False - name: Get the trail info to check the global logging state - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -947,7 +947,7 @@ - output.trail.include_global_service_events == True - name: Get the trail info to check the global logging state (default) - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -995,7 +995,7 @@ - output.trail.is_multi_region_trail == True - name: Get the trail info to check the multi-region logging state (default) - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1043,7 +1043,7 @@ - output.trail.is_multi_region_trail == False - name: Get the trail info to check the multi-region logging state (default) - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1102,7 +1102,7 @@ - output.trail.log_file_validation_enabled == True - name: Get the trail info to check the log file validation - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1148,7 +1148,7 @@ - output.trail.log_file_validation_enabled == False - name: Get the trail info to check the log file validation - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1216,7 +1216,7 @@ - output.trail.kms_key_id == kms_key.key_arn - name: Get the trail info to check the logging encryption - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1260,7 +1260,7 @@ - output.trail.kms_key_id == kms_key2.key_arn - name: Get the trail info to check the logging key encryption - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1319,7 +1319,7 @@ msg: "{{ output }}" - name: Get the trail info to check the logging key encryption after update - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1389,7 +1389,7 @@ # ============================================================ - name: Delete a trail without providing bucket_name (CHECK MODE) - module_defaults: { cloudtrail: {}} + module_defaults: { amazon.aws.cloudtrail: {}} amazon.aws.cloudtrail: state: absent name: "{{ cloudtrail_name }}" @@ -1492,7 +1492,7 @@ - output.trail.tags | length == 0 - name: Get the trail info of the created trail - cloudtrail_info: + amazon.aws.cloudtrail_info: trail_names: - "{{ trail_arn }}" register: info @@ -1535,12 +1535,12 @@ force: true ignore_errors: true - name: Delete KMS Key - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ kms_alias }}" ignore_errors: true - name: Delete second KMS Key - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ kms_alias }}-2" ignore_errors: true diff --git a/tests/integration/targets/cloudtrail/tasks/tagging.yml b/tests/integration/targets/cloudtrail/tasks/tagging.yml index 9b3411ff212..0d1503a5241 100644 --- a/tests/integration/targets/cloudtrail/tasks/tagging.yml +++ b/tests/integration/targets/cloudtrail/tasks/tagging.yml @@ -176,7 +176,7 @@ # ### # # - name: test that cloudtrail_info returns the tags - # cloudtrail_info: + # amazon.aws.cloudtrail_info: # register: tag_info # - name: assert tags present # assert: diff --git a/tests/integration/targets/cloudwatch_metric_alarm/tasks/env_cleanup.yml b/tests/integration/targets/cloudwatch_metric_alarm/tasks/env_cleanup.yml index b21c0c2cf10..5f1d0db2d8b 100644 --- a/tests/integration/targets/cloudwatch_metric_alarm/tasks/env_cleanup.yml +++ b/tests/integration/targets/cloudwatch_metric_alarm/tasks/env_cleanup.yml @@ -25,7 +25,7 @@ retries: 10 - name: remove the security group - ec2_security_group: + amazon.aws.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/cloudwatch_metric_alarm/tasks/env_setup.yml b/tests/integration/targets/cloudwatch_metric_alarm/tasks/env_setup.yml index c01f5082177..fe31e042594 100644 --- a/tests/integration/targets/cloudwatch_metric_alarm/tasks/env_setup.yml +++ b/tests/integration/targets/cloudwatch_metric_alarm/tasks/env_setup.yml @@ -47,7 +47,7 @@ - "{{ testing_subnet_b.subnet.id }}" - name: create a security group with the vpc - ec2_security_group: + amazon.aws.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/cloudwatch_metric_alarm/tasks/main.yml b/tests/integration/targets/cloudwatch_metric_alarm/tasks/main.yml index 888f1d32a80..4a0c6134331 100644 --- a/tests/integration/targets/cloudwatch_metric_alarm/tasks/main.yml +++ b/tests/integration/targets/cloudwatch_metric_alarm/tasks/main.yml @@ -31,12 +31,12 @@ register: ec2_instance_results - name: ensure alarm doesn't exist for a clean test - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: state: absent name: "{{ alarm_full_name }}" - name: create ec2 metric alarm on ec2 instance (check mode) - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -68,7 +68,7 @@ - alarm_info_check.metric_alarms | length == 0 - name: create ec2 metric alarm on ec2 instance - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -109,7 +109,7 @@ - ec2_instance_metric_alarm.treat_missing_data == alarm_info.metric_alarms[0].treat_missing_data - name: create ec2 metric alarm on ec2 instance (idempotent) (check mode) - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -157,7 +157,7 @@ - treat_missing_data - name: create ec2 metric alarm on ec2 instance (idempotent) - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -204,7 +204,7 @@ - treat_missing_data - name: update alarm (check mode) - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -244,7 +244,7 @@ - ec2_instance_metric_alarm_update_check.treat_missing_data == alarm_info.metric_alarms[0].treat_missing_data - name: update alarm - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -283,7 +283,7 @@ - ec2_instance_metric_alarm_update.treat_missing_data == alarm_info.metric_alarms[0].treat_missing_data - name: try to remove the alarm (check mode) - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: state: absent name: "{{ alarm_full_name }}" check_mode: true @@ -306,7 +306,7 @@ - alarm_info.metric_alarms | length > 0 - name: try to remove the alarm - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: state: absent name: "{{ alarm_full_name }}" register: ec2_instance_metric_alarm_deletion @@ -328,7 +328,7 @@ - alarm_info.metric_alarms | length == 0 - name: create ec2 metric alarm with no unit on ec2 instance - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -368,7 +368,7 @@ - ec2_instance_metric_alarm_no_unit.treat_missing_data == alarm_info_no_unit.metric_alarms[0].treat_missing_data - name: try to remove the alarm - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: state: absent name: "{{ alarm_full_name }}" register: ec2_instance_metric_alarm_deletion @@ -390,7 +390,7 @@ - alarm_info.metric_alarms | length == 0 - name: create ec2 metric alarm with metrics - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: state: present name: "{{ alarm_full_name }}" treat_missing_data: missing @@ -435,7 +435,7 @@ - ec2_instance_metric_alarm_metrics.metrics[0].return_data == alarm_info_metrics.metric_alarms[0].metrics[0].return_data - name: try to remove the alarm - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: state: absent name: "{{ alarm_full_name }}" register: ec2_instance_metric_alarm_deletion_no_unit @@ -457,7 +457,7 @@ - alarm_info_no_unit.metric_alarms | length == 0 - name: create ec2 metric alarm by providing mutually exclusive values - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: dimensions: InstanceId: "{{ ec2_instance_results.instances[0].instance_id }}" state: present @@ -494,7 +494,7 @@ always: - name: try to delete the alarm - cloudwatch_metric_alarm: + amazon.aws.cloudwatch_metric_alarm: state: absent name: "{{ alarm_full_name }}" ignore_errors: true diff --git a/tests/integration/targets/ec2_ami/tasks/main.yml b/tests/integration/targets/ec2_ami/tasks/main.yml index 467b1164c6e..e7e75b61048 100644 --- a/tests/integration/targets/ec2_ami/tasks/main.yml +++ b/tests/integration/targets/ec2_ami/tasks/main.yml @@ -39,7 +39,7 @@ register: setup_subnet - name: create a security group to use for creating an ec2 instance - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: present @@ -795,7 +795,7 @@ ignore_errors: true - name: remove setup security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: absent diff --git a/tests/integration/targets/ec2_ami_instance/tasks/main.yml b/tests/integration/targets/ec2_ami_instance/tasks/main.yml index f4cb800939c..19f611120fc 100644 --- a/tests/integration/targets/ec2_ami_instance/tasks/main.yml +++ b/tests/integration/targets/ec2_ami_instance/tasks/main.yml @@ -39,7 +39,7 @@ register: setup_subnet - name: create a security group to use for creating an ec2 instance - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: present @@ -364,7 +364,7 @@ ignore_errors: true - name: remove setup security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: absent diff --git a/tests/integration/targets/ec2_ami_snapshot/tasks/main.yml b/tests/integration/targets/ec2_ami_snapshot/tasks/main.yml index c98b4ee229b..3170cafe04c 100644 --- a/tests/integration/targets/ec2_ami_snapshot/tasks/main.yml +++ b/tests/integration/targets/ec2_ami_snapshot/tasks/main.yml @@ -39,7 +39,7 @@ register: setup_subnet - name: create a security group to use for creating an ec2 instance - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: present @@ -384,7 +384,7 @@ ignore_errors: true - name: remove setup security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: absent diff --git a/tests/integration/targets/ec2_ami_tpm/tasks/main.yml b/tests/integration/targets/ec2_ami_tpm/tasks/main.yml index a55dd1ebef7..6e6ff2bc5e4 100644 --- a/tests/integration/targets/ec2_ami_tpm/tasks/main.yml +++ b/tests/integration/targets/ec2_ami_tpm/tasks/main.yml @@ -39,7 +39,7 @@ register: setup_subnet - name: create a security group to use for creating an ec2 instance - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: present @@ -154,7 +154,7 @@ ignore_errors: true - name: remove setup security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_ami_name }}_setup" description: created by Ansible integration tests state: absent diff --git a/tests/integration/targets/ec2_eip/tasks/main.yml b/tests/integration/targets/ec2_eip/tasks/main.yml index 31f79523e28..b7051d69f26 100644 --- a/tests/integration/targets/ec2_eip/tasks/main.yml +++ b/tests/integration/targets/ec2_eip/tasks/main.yml @@ -60,7 +60,7 @@ register: vpc_igw - name: Create security group - ec2_security_group: + amazon.aws.ec2_security_group: state: present name: "{{ resource_prefix }}-sg" description: a security group for ansible tests @@ -1354,7 +1354,7 @@ ignore_errors: true - name: Cleanup security group - ec2_security_group: + amazon.aws.ec2_security_group: state: absent name: "{{ resource_prefix }}-sg" ignore_errors: true diff --git a/tests/integration/targets/ec2_eni/tasks/main.yaml b/tests/integration/targets/ec2_eni/tasks/main.yaml index babd173d5cd..450a2a75df9 100644 --- a/tests/integration/targets/ec2_eni/tasks/main.yaml +++ b/tests/integration/targets/ec2_eni/tasks/main.yaml @@ -35,7 +35,7 @@ register: vpc_subnet_result - name: create a security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-sg" description: Created by {{ resource_prefix }} rules: [] @@ -121,7 +121,7 @@ when: instance_id_1 is defined and instance_id_2 is defined - name: remove the security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-sg" description: "{{ resource_prefix }}" rules: [] diff --git a/tests/integration/targets/ec2_key/tasks/main.yml b/tests/integration/targets/ec2_key/tasks/main.yml index a8aec315069..8bae5d18709 100644 --- a/tests/integration/targets/ec2_key/tasks/main.yml +++ b/tests/integration/targets/ec2_key/tasks/main.yml @@ -75,7 +75,7 @@ - result is changed - name: assert that key pair was not created - ec2_key_info: + amazon.aws.ec2_key_info: names: - "{{ ec2_key_name }}" register: aws_keypair @@ -111,14 +111,14 @@ - result.key.tags['spaced key'] == 'Spaced value' - name: assert that key pair was created - ec2_key_info: + amazon.aws.ec2_key_info: names: - "{{ ec2_key_name }}" register: aws_keypair failed_when: aws_keypair.keypairs | length == 0 - name: Gather info about the key pair - ec2_key_info: + amazon.aws.ec2_key_info: names: "{{ ec2_key_name }}" register: key_info @@ -196,7 +196,7 @@ - result is changed - name: assert that key pair was not created - ec2_key_info: + amazon.aws.ec2_key_info: names: - "{{ ec2_key_name_rsa }}" register: aws_keypair @@ -239,7 +239,7 @@ - result.key.tags['spaced key'] == 'Spaced value' - name: assert that key pair was created - ec2_key_info: + amazon.aws.ec2_key_info: names: - "{{ ec2_key_name_rsa }}" register: aws_keypair @@ -331,7 +331,7 @@ - result.key.tags['newKey'] == 'Another value' - name: Gather info about the updated tags - ec2_key_info: + amazon.aws.ec2_key_info: names: "{{ ec2_key_name }}" register: key_info @@ -493,7 +493,7 @@ - result is changed - name: assert using check_mode did not removed key pair - ec2_key_info: + amazon.aws.ec2_key_info: names: - "{{ ec2_key_name }}" register: keys @@ -513,7 +513,7 @@ - result.key == None - name: assert that key pair was removed - ec2_key_info: + amazon.aws.ec2_key_info: names: - "{{ ec2_key_name }}" register: keys @@ -541,7 +541,7 @@ - result.key.fingerprint == "{{fingerprint}}" - name: Gather key info with fingerprint - ec2_key_info: + amazon.aws.ec2_key_info: filters: fingerprint: "{{ fingerprint }}" register: key_info diff --git a/tests/integration/targets/ec2_metadata_facts/playbooks/setup.yml b/tests/integration/targets/ec2_metadata_facts/playbooks/setup.yml index b8d3b4e393c..de112a3d48f 100644 --- a/tests/integration/targets/ec2_metadata_facts/playbooks/setup.yml +++ b/tests/integration/targets/ec2_metadata_facts/playbooks/setup.yml @@ -81,7 +81,7 @@ register: public_route_table - name: create a security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-sg" description: Created by {{ resource_prefix }} rules: diff --git a/tests/integration/targets/ec2_metadata_facts/playbooks/teardown.yml b/tests/integration/targets/ec2_metadata_facts/playbooks/teardown.yml index 4fdbda3a8e4..1e6cf20a1db 100644 --- a/tests/integration/targets/ec2_metadata_facts/playbooks/teardown.yml +++ b/tests/integration/targets/ec2_metadata_facts/playbooks/teardown.yml @@ -54,7 +54,7 @@ until: remove is successful - name: remove the security group - ec2_security_group: + amazon.aws.ec2_security_group: group_id: "{{ vpc_sg_id }}" state: absent ignore_errors: true diff --git a/tests/integration/targets/ec2_security_group/tasks/data_validation.yml b/tests/integration/targets/ec2_security_group/tasks/data_validation.yml index 235b3fc0818..7cd9f3fb468 100644 --- a/tests/integration/targets/ec2_security_group/tasks/data_validation.yml +++ b/tests/integration/targets/ec2_security_group/tasks/data_validation.yml @@ -1,13 +1,13 @@ --- - block: - name: Create a group with only the default rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-input-tests" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" - name: Run through some common weird port specs - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-input-tests" description: "{{ec2_group_description}}" rules: @@ -26,7 +26,7 @@ cidr_ip: 10.2.3.0/24 always: - name: tidy up input testing group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-input-tests" vpc_id: "{{ vpc_result.vpc.id }}" state: absent diff --git a/tests/integration/targets/ec2_security_group/tasks/diff_mode.yml b/tests/integration/targets/ec2_security_group/tasks/diff_mode.yml index 38e53408b68..134cb823991 100644 --- a/tests/integration/targets/ec2_security_group/tasks/diff_mode.yml +++ b/tests/integration/targets/ec2_security_group/tasks/diff_mode.yml @@ -2,7 +2,7 @@ # ============================================================ - name: create a group with a rule (CHECK MODE + DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -23,7 +23,7 @@ - check_mode_result.changed - name: create a group with a rule (DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -45,7 +45,7 @@ - result.diff.0.after.ip_permissions_egress == check_mode_result.diff.0.after.ip_permissions_egress - name: add rules to make sorting occur (CHECK MODE + DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -74,7 +74,7 @@ - check_mode_result.changed - name: add rules in a different order to test sorting consistency (DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -104,7 +104,7 @@ - result.diff.0.after.ip_permissions_egress == check_mode_result.diff.0.after.ip_permissions_egress - name: purge rules (CHECK MODE + DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -123,7 +123,7 @@ - check_mode_result.changed - name: purge rules (DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -143,7 +143,7 @@ - result.diff.0.after.ip_permissions_egress == check_mode_result.diff.0.after.ip_permissions_egress - name: delete the security group (CHECK MODE + DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" state: absent register: check_mode_result @@ -155,7 +155,7 @@ - check_mode_result.changed - name: delete the security group (DIFF) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" state: absent register: result diff --git a/tests/integration/targets/ec2_security_group/tasks/egress_tests.yml b/tests/integration/targets/ec2_security_group/tasks/egress_tests.yml index d332217c771..cdc42fbb5b7 100644 --- a/tests/integration/targets/ec2_security_group/tasks/egress_tests.yml +++ b/tests/integration/targets/ec2_security_group/tasks/egress_tests.yml @@ -1,7 +1,7 @@ --- - block: - name: Create a group with only the default rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -17,7 +17,7 @@ - result.ip_permissions_egress[0].ip_ranges[0].cidr_ip == '0.0.0.0/0' - name: Create a group with only the default rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -34,7 +34,7 @@ - result.ip_permissions_egress[0].ip_ranges[0].cidr_ip == '0.0.0.0/0' - name: Pass empty egress rules without purging, should leave default rule in place - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -52,7 +52,7 @@ - result.ip_permissions_egress[0].ip_ranges[0].cidr_ip == '0.0.0.0/0' - name: Purge rules, including the default - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -69,7 +69,7 @@ - result.ip_permissions_egress|length == 0 - name: Add a custom egress rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -87,7 +87,7 @@ - result.ip_permissions_egress|length == 1 - name: Add a second custom egress rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" purge_rules_egress: false @@ -106,7 +106,7 @@ - result.ip_permissions_egress|length == 2 - name: Purge the second rule (CHECK MODE) (DIFF MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -128,7 +128,7 @@ - result.diff.0.after.ip_permissions_egress[0].ip_ranges[0].cidr_ip == '10.2.1.2/32' - name: Purge the second rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -147,7 +147,7 @@ - result.ip_permissions_egress[0].ip_ranges[0].cidr_ip == '10.2.1.2/32' - name: add a rule for all TCP ports - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" rules_egress: @@ -159,7 +159,7 @@ register: result - name: Re-add the default rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" description: "{{ec2_group_description}}" rules_egress: @@ -170,7 +170,7 @@ register: result always: - name: tidy up egress rule test security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-egress-tests" state: absent vpc_id: "{{ vpc_result.vpc.id }}" diff --git a/tests/integration/targets/ec2_security_group/tasks/group_info.yml b/tests/integration/targets/ec2_security_group/tasks/group_info.yml index 540b31dd1e5..42141c4b8b5 100644 --- a/tests/integration/targets/ec2_security_group/tasks/group_info.yml +++ b/tests/integration/targets/ec2_security_group/tasks/group_info.yml @@ -4,7 +4,7 @@ - block: # ======================== Setup ===================================== - name: Create a group for testing group info retrieval below - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-info-1" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ ec2_group_description }}" @@ -27,7 +27,7 @@ - "'ec2:DeleteTags' not in group_info_test_setup.resource_actions" - name: Create another group for testing group info retrieval below - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-info-2" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ ec2_group_description }}" @@ -40,7 +40,7 @@ # ========================= ec2_group_info tests ==================== - name: Retrieve security group info based on SG name - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: group-name: "{{ ec2_group_name }}-info-2" register: result_1 @@ -52,7 +52,7 @@ - (result_1.security_groups|first).group_name == '{{ ec2_group_name }}-info-2' - name: Retrieve security group info based on SG VPC - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: vpc-id: "{{ vpc_result.vpc.id }}" register: result_2 @@ -65,7 +65,7 @@ - (result_2.security_groups|length) > 2 - name: Retrieve security group info based on SG tags - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: tag:test: "{{ resource_prefix }}_ec2_group_info_module" register: result_3 @@ -77,7 +77,7 @@ - (result_3.security_groups|first).group_id == group_info_test_setup.group_id - name: Retrieve security group info based on SG ID - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: group-id: "{{ group_info_test_setup.group_id }}" register: result_4 @@ -92,13 +92,13 @@ always: # ========================= Cleanup ================================= - name: tidy up test security group 1 - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-info-1" state: absent ignore_errors: true - name: tidy up test security group 2 - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-info-2" state: absent ignore_errors: true diff --git a/tests/integration/targets/ec2_security_group/tasks/icmp_verbs.yml b/tests/integration/targets/ec2_security_group/tasks/icmp_verbs.yml index 692316a6ad9..d5e4b641ccd 100644 --- a/tests/integration/targets/ec2_security_group/tasks/icmp_verbs.yml +++ b/tests/integration/targets/ec2_security_group/tasks/icmp_verbs.yml @@ -2,7 +2,7 @@ - block: # ============================================================ - name: Create simple rule using icmp verbs - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-1" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -17,7 +17,7 @@ register: result - name: Retrieve security group info - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: group-name: "{{ ec2_group_name }}-icmp-1" register: result_1 @@ -30,7 +30,7 @@ - (result_1.security_groups|first).ip_permissions[0].ip_protocol == "icmp" - name: Create ipv6 rule using icmp verbs - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-2" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -43,7 +43,7 @@ register: result - name: Retrieve security group info - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: group-name: "{{ ec2_group_name }}-icmp-2" register: result_1 @@ -56,7 +56,7 @@ - (result_1.security_groups|first).ip_permissions[0].ip_protocol == "icmpv6" - name: Create rule using security group referencing - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-3" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -70,7 +70,7 @@ register: result - name: Retrieve security group info - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: group-name: "{{ ec2_group_name }}-icmp-3" register: result_1 @@ -81,7 +81,7 @@ - (result_1.security_groups | first).ip_permissions[0].user_id_group_pairs is defined - name: Create list rule using 0 as icmp_type - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-4" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -100,7 +100,7 @@ register: result - name: Retrieve security group info - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: group-name: "{{ ec2_group_name }}-icmp-4" register: result_1 @@ -113,7 +113,7 @@ # ============================================================ - name: Create a group with non-ICMP protocol - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-4" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -134,7 +134,7 @@ - result is failed - name: Create a group with conflicting parameters - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-4" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -157,7 +157,7 @@ - result is failed - name: Create a group with missing icmp parameters - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-4" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -178,7 +178,7 @@ always: - name: tidy up egress rule test security group rules - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-2" description: sg-group-referencing vpc_id: "{{ vpc_result.vpc.id }}" @@ -187,7 +187,7 @@ ignore_errors: true - name: tidy up egress rule test security group rules - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-{{ item }}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -201,14 +201,14 @@ - 4 - name: tidy up egress rule test security group rules - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-2" state: absent vpc_id: "{{ vpc_result.vpc.id }}" ignore_errors: true - name: tidy up egress rule test security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-icmp-{{ item }}" state: absent vpc_id: "{{ vpc_result.vpc.id }}" diff --git a/tests/integration/targets/ec2_security_group/tasks/ipv6_default_tests.yml b/tests/integration/targets/ec2_security_group/tasks/ipv6_default_tests.yml index c064b587758..a1a46119c29 100644 --- a/tests/integration/targets/ec2_security_group/tasks/ipv6_default_tests.yml +++ b/tests/integration/targets/ec2_security_group/tasks/ipv6_default_tests.yml @@ -1,7 +1,7 @@ --- # ============================================================ - name: test state=present for ipv6 (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -20,7 +20,7 @@ # ============================================================ - name: test state=present for ipv6 (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -39,7 +39,7 @@ # ============================================================ - name: test rules_egress state=present for ipv6 (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -63,7 +63,7 @@ # ============================================================ - name: test rules_egress state=present for ipv6 (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -85,6 +85,6 @@ - result.changed - result.group_id.startswith("sg-") - name: delete it - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" state: absent diff --git a/tests/integration/targets/ec2_security_group/tasks/main.yml b/tests/integration/targets/ec2_security_group/tasks/main.yml index f10ef235068..e551f19a65e 100644 --- a/tests/integration/targets/ec2_security_group/tasks/main.yml +++ b/tests/integration/targets/ec2_security_group/tasks/main.yml @@ -42,7 +42,7 @@ - ansible.builtin.include_tasks: ./multi_nested_target.yml - ansible.builtin.include_tasks: ./group_info.yml - name: test state=absent (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: absent @@ -56,7 +56,7 @@ # =========================================================== - name: test state=absent - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: absent @@ -64,7 +64,7 @@ # ============================================================ - name: test state=present (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -78,7 +78,7 @@ # ============================================================ - name: test state=present (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -92,7 +92,7 @@ # ============================================================ - name: test state=present different description (expected changed=false) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}CHANGED" state: present @@ -106,7 +106,7 @@ # ============================================================ - name: test state=present different description (expected changed=false) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}CHANGED" state: present @@ -121,7 +121,7 @@ # ============================================================ - name: test state=present (expected changed=false) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -142,7 +142,7 @@ block: # ============================================================ - name: test state=present (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -157,7 +157,7 @@ # ============================================================ - name: test state=present (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -172,7 +172,7 @@ # ============================================================ - name: test state=present for ipv6 (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -192,7 +192,7 @@ # ============================================================ - name: test state=present for ipv6 (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -212,7 +212,7 @@ # ============================================================ - name: test state=present for ipv6 (expected changed=false) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -232,7 +232,7 @@ # ============================================================ - name: test state=present for ipv6 (expected changed=false) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -251,7 +251,7 @@ # ============================================================ - name: test rules_egress state=present for ipv6 (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -279,7 +279,7 @@ # ============================================================ - name: test rules_egress state=present for ipv6 (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: present @@ -304,7 +304,7 @@ # ============================================================ - name: test state=absent (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: absent @@ -321,7 +321,7 @@ # ============================================================ - name: test state=absent (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-2" description: "{{ ec2_group_description }}-2" state: absent @@ -335,7 +335,7 @@ # ============================================================ - name: test state=present for ipv4 (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" rules: @@ -353,7 +353,7 @@ # ============================================================ - name: test state=present for ipv4 (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" rules: @@ -373,7 +373,7 @@ # ============================================================ - name: add same rule to the existing group (expected changed=false) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -393,7 +393,7 @@ # ============================================================ - name: add same rule to the existing group (expected changed=false) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -417,7 +417,7 @@ # ============================================================ - name: add a rule that auto creates another security group (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -437,7 +437,7 @@ # ============================================================ - name: add a rule that auto creates another security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -460,7 +460,7 @@ # ============================================================ - name: test ip rules convert port numbers from string to int (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -484,7 +484,7 @@ # ============================================================ - name: test ip rules convert port numbers from string to int (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -510,7 +510,7 @@ # ============================================================ - name: test group rules convert port numbers from string to int (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -534,7 +534,7 @@ # ============================================================ - name: test group rules convert port numbers from string to int (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -559,7 +559,7 @@ # ============================================================ - name: test adding a range of ports and ports given as strings (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -581,7 +581,7 @@ # ============================================================ - name: test adding a range of ports and ports given as strings (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -603,7 +603,7 @@ # ============================================================ - name: test adding a rule with a IPv4 CIDR with host bits set (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -624,7 +624,7 @@ # ============================================================ - name: test adding a rule with a IPv4 CIDR with host bits set (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -645,7 +645,7 @@ # ============================================================ - name: test adding the same rule with a IPv4 CIDR with host bits set (expected changed=false) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -661,7 +661,7 @@ # ============================================================ - name: test adding the same rule with a IPv4 CIDR with host bits set (expected changed=false and a warning) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -690,7 +690,7 @@ - name: test using the default VPC block: - name: test adding a rule with a IPv6 CIDR with host bits set (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -711,7 +711,7 @@ # ============================================================ - name: test adding a rule with a IPv6 CIDR with host bits set (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -733,7 +733,7 @@ # ============================================================ - name: test adding a rule again with a IPv6 CIDR with host bits set (expected changed=false and a warning) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" state: present @@ -757,7 +757,7 @@ # ============================================================ - name: test state=absent (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" state: absent check_mode: true @@ -770,7 +770,7 @@ # ============================================================ - name: test state=absent (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" state: absent register: result @@ -783,7 +783,7 @@ # ============================================================ - name: create security group in the VPC (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -803,7 +803,7 @@ # ============================================================ - name: create security group in the VPC - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -824,7 +824,7 @@ # ============================================================ - name: test adding tags (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -851,7 +851,7 @@ # ============================================================ - name: test adding tags (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -874,7 +874,7 @@ # ============================================================ - name: test that tags are present (expected changed=False) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -898,7 +898,7 @@ # ============================================================ - name: test that tags are present (expected changed=False) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -922,7 +922,7 @@ # ============================================================ - name: test purging tags (expected changed=True) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -944,7 +944,7 @@ # ============================================================ - name: test purging tags (expected changed=True) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -967,7 +967,7 @@ # ============================================================ - name: assert that tags are left as-is if not specified (expected changed=False) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -988,7 +988,7 @@ # ============================================================ - name: test purging all tags (expected changed=True) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1009,7 +1009,7 @@ # ============================================================ - name: test adding a rule and egress rule descriptions (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1039,7 +1039,7 @@ # ========================================================================================= - name: add rules without descriptions ready for adding descriptions to existing rules - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1061,7 +1061,7 @@ # ============================================================ - name: test adding a rule and egress rule descriptions (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1092,7 +1092,7 @@ # ============================================================ - name: test modifying rule and egress rule descriptions (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1122,7 +1122,7 @@ # ============================================================ - name: test modifying rule and egress rule descriptions (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1153,7 +1153,7 @@ # ============================================================ - name: test creating rule in default vpc with egress rule (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-default-vpc" description: "{{ec2_group_description}} default VPC" purge_rules_egress: true @@ -1180,7 +1180,7 @@ # ============================================================ - name: test that keeping the same rule descriptions (expected changed=false) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1209,7 +1209,7 @@ # ============================================================ - name: test that keeping the same rule descriptions (expected changed=false) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1239,7 +1239,7 @@ # ============================================================ - name: test removing rule descriptions (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1268,7 +1268,7 @@ # ============================================================ - name: test removing rule descriptions (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" description: "{{ec2_group_description}}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -1299,7 +1299,7 @@ # ============================================================ - name: test state=absent (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}" state: absent register: result @@ -1314,7 +1314,7 @@ # Describe state of remaining resources - name: Retrieve security group info based on SG VPC - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: vpc-id: "{{ vpc_result.vpc.id }}" register: remaining_groups @@ -1335,7 +1335,7 @@ # Delete all remaining SGs - name: Delete rules from remaining SGs - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ item.group_name }}" group_id: "{{ item.group_id }}" description: "{{ item.description }}" @@ -1345,7 +1345,7 @@ ignore_errors: true - name: Delete remaining SGs - ec2_security_group: + amazon.aws.ec2_security_group: state: absent group_id: "{{ item.group_id }}" loop: "{{ remaining_groups.security_groups }}" diff --git a/tests/integration/targets/ec2_security_group/tasks/multi_account.yml b/tests/integration/targets/ec2_security_group/tasks/multi_account.yml index 2653e6d37e8..5636195054a 100644 --- a/tests/integration/targets/ec2_security_group/tasks/multi_account.yml +++ b/tests/integration/targets/ec2_security_group/tasks/multi_account.yml @@ -26,7 +26,7 @@ peer_owner_id: "{{ caller_facts.account }}" peer_region: "{{ aws_region }}" - name: Create group in second VPC - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-external" description: "{{ ec2_group_description }}" vpc_id: "{{ vpc_result_2.vpc.id }}" @@ -39,7 +39,7 @@ rule_desc: http whoo register: external - name: Create group in internal VPC - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-internal" description: "{{ ec2_group_description }}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -50,7 +50,7 @@ ports: - 80 - name: Re-make same rule, expecting changed=false in internal VPC - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-internal" description: "{{ ec2_group_description }}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -65,7 +65,7 @@ that: - out is not changed - name: Try again with a bad group_id group in internal VPC - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-internal" description: "{{ ec2_group_description }}" vpc_id: "{{ vpc_result.vpc.id }}" @@ -101,14 +101,14 @@ peer_region: "{{ aws_region }}" ignore_errors: true - name: Clean up group in second VPC - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-external" description: "{{ ec2_group_description }}" state: absent vpc_id: "{{ vpc_result_2.vpc.id }}" ignore_errors: true - name: Clean up group in second VPC - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}-internal" description: "{{ ec2_group_description }}" state: absent diff --git a/tests/integration/targets/ec2_security_group/tasks/multi_nested_target.yml b/tests/integration/targets/ec2_security_group/tasks/multi_nested_target.yml index 8db6afb1c03..dcb7ac7bb86 100644 --- a/tests/integration/targets/ec2_security_group/tasks/multi_nested_target.yml +++ b/tests/integration/targets/ec2_security_group/tasks/multi_nested_target.yml @@ -2,7 +2,7 @@ # ============================================================ - name: test state=present for multiple ipv6 and ipv4 targets (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -28,7 +28,7 @@ - result.changed - name: test state=present for multiple ipv6 and ipv4 targets (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -56,7 +56,7 @@ - result.ip_permissions[0].ipv6_ranges | length == 2 or result.ip_permissions[1].ipv6_ranges | length == 2 - name: test state=present for multiple ipv6 and ipv4 targets (expected changed=false) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -82,7 +82,7 @@ - not result.changed - name: test state=present for multiple ipv6 and ipv4 targets (expected changed=false) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -107,7 +107,7 @@ - not result.changed - name: test state=present purging a nested ipv4 target (expected changed=true) (CHECK MODE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -132,7 +132,7 @@ - result.changed - name: test state=present purging a nested ipv4 target (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -158,7 +158,7 @@ - result.ip_permissions[0].ipv6_ranges | length == 2 or result.ip_permissions[1].ipv6_ranges | length == 2 - name: test state=present with both associated ipv6 targets nested (expected changed=false) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -181,7 +181,7 @@ - not result.changed - name: test state=present add another nested ipv6 target (expected changed=true) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" description: "{{ ec2_group_description }}" state: present @@ -208,6 +208,6 @@ - result.ip_permissions[0].ipv6_ranges | length == 3 or result.ip_permissions[1].ipv6_ranges | length == 3 - name: delete it - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ ec2_group_name }}" state: absent diff --git a/tests/integration/targets/ec2_security_group/tasks/numeric_protos.yml b/tests/integration/targets/ec2_security_group/tasks/numeric_protos.yml index 42e81f7e3c2..dc1762e531d 100644 --- a/tests/integration/targets/ec2_security_group/tasks/numeric_protos.yml +++ b/tests/integration/targets/ec2_security_group/tasks/numeric_protos.yml @@ -5,7 +5,7 @@ group_tmp_name: "{{ec2_group_name}}-numbered-protos" - name: Create a group with numbered protocol (GRE) - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ group_tmp_name }}" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ ec2_group_description }}" @@ -21,7 +21,7 @@ register: result - name: Create a group with a quoted proto - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ group_tmp_name }}" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ ec2_group_description }}" @@ -39,14 +39,14 @@ that: - result is not changed - name: Add a tag with a numeric value - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ group_tmp_name }}" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ ec2_group_description }}" tags: foo: 1 - name: Read a tag with a numeric value - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ group_tmp_name }}" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ ec2_group_description }}" @@ -59,7 +59,7 @@ always: - name: tidy up egress rule test security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{group_tmp_name}}" state: absent vpc_id: "{{ vpc_result.vpc.id }}" diff --git a/tests/integration/targets/ec2_security_group/tasks/rule_group_create.yml b/tests/integration/targets/ec2_security_group/tasks/rule_group_create.yml index 8db5661b442..c8357ddc121 100644 --- a/tests/integration/targets/ec2_security_group/tasks/rule_group_create.yml +++ b/tests/integration/targets/ec2_security_group/tasks/rule_group_create.yml @@ -1,7 +1,7 @@ --- - block: - name: Create a group with self-referring rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-1" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -14,14 +14,14 @@ register: result - name: Create a second group rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-2" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" state: present - name: Create a series of rules with a recently created group as target - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-1" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -44,7 +44,7 @@ - result.warning is not defined - name: Create a group with only the default rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-1" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -63,7 +63,7 @@ - result is failed - name: Create a group with a target of a separate group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-1" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -82,7 +82,7 @@ - result.warning is not defined - name: Create a 4th group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-4" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -94,7 +94,7 @@ cidr_ip: "0.0.0.0/0" - name: use recently created group in a rule - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-5" vpc_id: "{{ vpc_result.vpc.id }}" description: "{{ec2_group_description}}" @@ -111,7 +111,7 @@ always: - name: tidy up egress rule test security group rules - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-{{ item }}" description: "{{ec2_group_description}}" rules: [] @@ -119,7 +119,7 @@ ignore_errors: true with_items: [5, 4, 3, 2, 1] - name: tidy up egress rule test security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ec2_group_name}}-auto-create-{{ item }}" state: absent vpc_id: "{{ vpc_result.vpc.id }}" diff --git a/tests/integration/targets/ec2_snapshot/tasks/main.yml b/tests/integration/targets/ec2_snapshot/tasks/main.yml index 77e5ffc3ef4..2fe841c32a6 100644 --- a/tests/integration/targets/ec2_snapshot/tasks/main.yml +++ b/tests/integration/targets/ec2_snapshot/tasks/main.yml @@ -1,12 +1,12 @@ --- # Tests for EC2 Snapshot # -# Tests ec2_snapshot: +# Tests amazon.aws.ec2_snapshot: # - Snapshot creation # - Create with last_snapshot_min_age # - Snapshot deletion # -# Tests ec2_snapshot_info: +# Tests amazon.aws.ec2_snapshot_info: # - Listing snapshots for filter: tag # - name: Integration testing for ec2_snapshot diff --git a/tests/integration/targets/ec2_spot_instance/tasks/main.yaml b/tests/integration/targets/ec2_spot_instance/tasks/main.yaml index e47ab14ce45..8d1cde8150a 100644 --- a/tests/integration/targets/ec2_spot_instance/tasks/main.yaml +++ b/tests/integration/targets/ec2_spot_instance/tasks/main.yaml @@ -44,7 +44,7 @@ register: vpc_subnet_result - name: create a security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-sg" description: Created by {{ resource_prefix }} rules: [] @@ -67,7 +67,7 @@ - name: Run tests for termianting associated instances ansible.builtin.import_tasks: terminate_associated_instances.yml - name: Create simple spot instance request - ec2_spot_instance: + amazon.aws.ec2_spot_instance: launch_specification: image_id: "{{ ec2_ami_id }}" key_name: "{{ resource_prefix }}-keypair" @@ -86,7 +86,7 @@ - create_result.spot_request.launch_specification.subnet_id == vpc_subnet_result.subnet.id - name: Get info about the spot instance request created - ec2_spot_instance_info: + amazon.aws.ec2_spot_instance_info: spot_instance_request_ids: - "{{ create_result.spot_request.spot_instance_request_id }}" register: spot_instance_info_result @@ -97,7 +97,7 @@ - spot_instance_info_result.spot_request[0].state in ['open', 'active'] - name: Create spot request with more complex options - ec2_spot_instance: + amazon.aws.ec2_spot_instance: launch_specification: image_id: "{{ ec2_ami_id }}" key_name: "{{ resource_prefix }}-keypair" @@ -154,7 +154,7 @@ spot_request_tags: "{{ complex_create_result.spot_request.tags }}" - name: Get info about the complex spot instance request created - ec2_spot_instance_info: + amazon.aws.ec2_spot_instance_info: spot_instance_request_ids: - "{{ complex_create_result.spot_request.spot_instance_request_id }}" register: complex_info_result @@ -172,7 +172,7 @@ info_launch_spec: "{{ complex_info_result.spot_request[0].launch_specification }}" - name: Get info about the created spot instance requests and filter result based on provided filters - ec2_spot_instance_info: + amazon.aws.ec2_spot_instance_info: spot_instance_request_ids: - "{{ create_result.spot_request.spot_instance_request_id }}" - "{{ complex_create_result.spot_request.spot_instance_request_id }}" @@ -188,7 +188,7 @@ # Assert check mode - name: Create spot instance request (check_mode) - ec2_spot_instance: + amazon.aws.ec2_spot_instance: launch_specification: image_id: "{{ ec2_ami_id }}" key_name: "{{ resource_prefix }}-keypair" @@ -204,7 +204,7 @@ - check_create_result is changed - name: Remove spot instance request (check_mode) - ec2_spot_instance: + amazon.aws.ec2_spot_instance: spot_instance_request_ids: "{{ create_result.spot_request.spot_instance_request_id }}" state: absent check_mode: true @@ -215,7 +215,7 @@ - check_cancel_result is changed - name: Remove spot instance requests - ec2_spot_instance: + amazon.aws.ec2_spot_instance: spot_instance_request_ids: - "{{ create_result.spot_request.spot_instance_request_id }}" - "{{ complex_create_result.spot_request.spot_instance_request_id }}" @@ -232,7 +232,7 @@ seconds: 3 - name: Check no change if request is already cancelled (idempotency) - ec2_spot_instance: + amazon.aws.ec2_spot_instance: spot_instance_request_ids: "{{ create_result.spot_request.spot_instance_request_id }}" state: absent register: cancel_request_again @@ -243,7 +243,7 @@ - '"Spot request not found or already cancelled" in cancel_request_again.msg' - name: Gracefully try to remove non-existent request (NotFound) - ec2_spot_instance: + amazon.aws.ec2_spot_instance: spot_instance_request_ids: - sir-12345678 state: absent @@ -263,13 +263,13 @@ vpc-id: "{{ vpc_result.vpc.id }}" - name: get all spot requests created during test - ec2_spot_instance_info: + amazon.aws.ec2_spot_instance_info: filters: tag:ansible-test: "{{ resource_prefix }}" register: spot_request_list - name: remove spot instance requests - ec2_spot_instance: + amazon.aws.ec2_spot_instance: spot_instance_request_ids: - "{{ item.spot_instance_request_id }}" state: absent @@ -278,7 +278,7 @@ with_items: "{{ spot_request_list.spot_request }}" - name: remove the security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-sg" description: "{{ resource_prefix }}" rules: [] diff --git a/tests/integration/targets/ec2_vpc_endpoint/tasks/main.yml b/tests/integration/targets/ec2_vpc_endpoint/tasks/main.yml index 75f4c506869..d16212efb37 100644 --- a/tests/integration/targets/ec2_vpc_endpoint/tasks/main.yml +++ b/tests/integration/targets/ec2_vpc_endpoint/tasks/main.yml @@ -400,7 +400,7 @@ # # Endpoint modifications are not yet supported by the module # # A Change the route table for the endpoint # - name: Change the route table for the endpoint (check_mode) - # ec2_vpc_endpoint: + # amazon.aws.ec2_vpc_endpoint: # state: present # vpc_id: '{{ vpc_id }}' # vpc_endpoint_id: "{{ rtb_endpoint_id }}" @@ -416,7 +416,7 @@ # - check_two_rtbs_endpoint.changed # # - name: Change the route table for the endpoint - # ec2_vpc_endpoint: + # amazon.aws.ec2_vpc_endpoint: # state: present # vpc_id: '{{ vpc_id }}' # vpc_endpoint_id: "{{ rtb_endpoint_id }}" @@ -433,7 +433,7 @@ # - two_rtbs_endpoint.result.route_table_ids[0] == '{{ rtb_igw_id }}' # # - name: Change the route table for the endpoint - idempotency (check_mode) - # ec2_vpc_endpoint: + # amazon.aws.ec2_vpc_endpoint: # state: present # vpc_id: '{{ vpc_id }}' # vpc_endpoint_id: "{{ rtb_endpoint_id }}" @@ -449,7 +449,7 @@ # - not check_two_rtbs_endpoint.changed # # - name: Change the route table for the endpoint - idempotency - # ec2_vpc_endpoint: + # amazon.aws.ec2_vpc_endpoint: # state: present # vpc_id: '{{ vpc_id }}' # vpc_endpoint_id: "{{ rtb_endpoint_id }}" @@ -721,7 +721,7 @@ register: interface_endpoint_create_subnet_check - name: Create a security group - ec2_security_group: + amazon.aws.ec2_security_group: name: securitygroup-prodext description: security group for Ansible interface endpoint state: present diff --git a/tests/integration/targets/ec2_vpc_endpoint_service_info/tasks/main.yml b/tests/integration/targets/ec2_vpc_endpoint_service_info/tasks/main.yml index ee76ea391f2..244a5939eba 100644 --- a/tests/integration/targets/ec2_vpc_endpoint_service_info/tasks/main.yml +++ b/tests/integration/targets/ec2_vpc_endpoint_service_info/tasks/main.yml @@ -11,7 +11,7 @@ - community.aws block: - name: List all available services (Check Mode) - ec2_vpc_endpoint_service_info: + amazon.aws.ec2_vpc_endpoint_service_info: check_mode: true register: services_check @@ -38,7 +38,7 @@ - '"vpc_endpoint_policy_supported" in first_service' - name: List all available services - ec2_vpc_endpoint_service_info: + amazon.aws.ec2_vpc_endpoint_service_info: register: services_info - name: Verify services @@ -64,7 +64,7 @@ - '"vpc_endpoint_policy_supported" in first_service' - name: Limit services by name - ec2_vpc_endpoint_service_info: + amazon.aws.ec2_vpc_endpoint_service_info: service_names: "{{ search_service_names }}" register: services_info @@ -105,7 +105,7 @@ example_service: "{{ services_info.service_details[0] }}" - name: Limit services by filter - ec2_vpc_endpoint_service_info: + amazon.aws.ec2_vpc_endpoint_service_info: filters: service-name: "{{ example_service.service_name }}" register: filtered_service diff --git a/tests/integration/targets/elb_classic_lb/tasks/basic_internal.yml b/tests/integration/targets/elb_classic_lb/tasks/basic_internal.yml index e2754792c93..5a6f9d6c300 100644 --- a/tests/integration/targets/elb_classic_lb/tasks/basic_internal.yml +++ b/tests/integration/targets/elb_classic_lb/tasks/basic_internal.yml @@ -2,7 +2,7 @@ - block: # For creation test some basic behaviour - module_defaults: - elb_classic_lb: + amazon.aws.elb_classic_lb: # zones: ['{{ availability_zone_a }}', '{{ availability_zone_b }}'] listeners: "{{ default_listeners }}" wait: true diff --git a/tests/integration/targets/elb_classic_lb/tasks/basic_public.yml b/tests/integration/targets/elb_classic_lb/tasks/basic_public.yml index a96b7aa7610..c427a50626d 100644 --- a/tests/integration/targets/elb_classic_lb/tasks/basic_public.yml +++ b/tests/integration/targets/elb_classic_lb/tasks/basic_public.yml @@ -2,7 +2,7 @@ - block: # For creation test some basic behaviour - module_defaults: - elb_classic_lb: + amazon.aws.elb_classic_lb: zones: ["{{ availability_zone_a }}", "{{ availability_zone_b }}"] listeners: "{{ default_listeners }}" wait: true diff --git a/tests/integration/targets/elb_classic_lb/tasks/cleanup_vpc.yml b/tests/integration/targets/elb_classic_lb/tasks/cleanup_vpc.yml index 738cb91f6d4..675fc576705 100644 --- a/tests/integration/targets/elb_classic_lb/tasks/cleanup_vpc.yml +++ b/tests/integration/targets/elb_classic_lb/tasks/cleanup_vpc.yml @@ -1,6 +1,6 @@ --- - name: delete security groups - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ item }}" state: absent ignore_errors: true diff --git a/tests/integration/targets/elb_classic_lb/tasks/schema_change.yml b/tests/integration/targets/elb_classic_lb/tasks/schema_change.yml index 80012cc3403..5528a043f4d 100644 --- a/tests/integration/targets/elb_classic_lb/tasks/schema_change.yml +++ b/tests/integration/targets/elb_classic_lb/tasks/schema_change.yml @@ -2,7 +2,7 @@ - block: # For creation test some basic behaviour - module_defaults: - elb_classic_lb: + amazon.aws.elb_classic_lb: zones: ["{{ availability_zone_a }}", "{{ availability_zone_b }}"] listeners: "{{ default_listeners }}" wait: true @@ -22,7 +22,7 @@ - result.elb.scheme == 'internet-facing' - module_defaults: - elb_classic_lb: + amazon.aws.elb_classic_lb: # zones: ['{{ availability_zone_a }}', '{{ availability_zone_b }}'] listeners: "{{ default_listeners }}" wait: true @@ -99,7 +99,7 @@ # For creation test some basic behaviour - module_defaults: - elb_classic_lb: + amazon.aws.elb_classic_lb: zones: ["{{ availability_zone_a }}", "{{ availability_zone_b }}"] listeners: "{{ default_listeners }}" health_check: "{{ default_health_check }}" @@ -178,7 +178,7 @@ always: # ============================================================ - name: remove the test load balancer - elb_classic_lb: + amazon.aws.elb_classic_lb: name: "{{ elb_name }}" state: absent wait: true diff --git a/tests/integration/targets/elb_classic_lb/tasks/setup_vpc.yml b/tests/integration/targets/elb_classic_lb/tasks/setup_vpc.yml index 397384f981f..03731066b83 100644 --- a/tests/integration/targets/elb_classic_lb/tasks/setup_vpc.yml +++ b/tests/integration/targets/elb_classic_lb/tasks/setup_vpc.yml @@ -54,7 +54,7 @@ register: setup_subnet_4 - name: create a security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-a" description: created by Ansible integration tests state: present @@ -67,7 +67,7 @@ register: setup_sg_1 - name: create a security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-b" description: created by Ansible integration tests state: present @@ -80,7 +80,7 @@ register: setup_sg_2 - name: create a security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}-c" description: created by Ansible integration tests state: present diff --git a/tests/integration/targets/iam_access_key/tasks/main.yml b/tests/integration/targets/iam_access_key/tasks/main.yml index 23ee351ed17..5374af58e10 100644 --- a/tests/integration/targets/iam_access_key/tasks/main.yml +++ b/tests/integration/targets/iam_access_key/tasks/main.yml @@ -28,7 +28,7 @@ # ================================================================================== - name: Fetch IAM key info (no keys) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -40,7 +40,7 @@ # ================================================================================== - name: Create a key (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present register: create_key_1 @@ -51,7 +51,7 @@ - create_key_1 is changed - name: Create a key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present no_log: true @@ -71,7 +71,7 @@ - create_key_1.access_key.status == 'Active' - name: Fetch IAM key info (1 key) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -90,7 +90,7 @@ vars: access_key_1: "{{ access_key_info.access_keys[0] }}" - name: Create a second key (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present register: create_key_2 @@ -101,7 +101,7 @@ - create_key_2 is changed - name: Create a second key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present no_log: true @@ -121,7 +121,7 @@ - create_key_2.access_key.status == 'Active' - name: Fetch IAM key info (2 keys) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -149,7 +149,7 @@ access_key_1: "{{ access_key_info.access_keys[0] }}" access_key_2: "{{ access_key_info.access_keys[1] }}" - name: Create a third key without rotation - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present no_log: true @@ -161,7 +161,7 @@ - create_key_3 is failed - name: Fetch IAM key info (2 keys - not changed) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -189,7 +189,7 @@ access_key_1: "{{ access_key_info.access_keys[0] }}" access_key_2: "{{ access_key_info.access_keys[1] }}" - name: Create a third key - rotation enabled (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present rotate_keys: true @@ -203,7 +203,7 @@ - create_key_3.deleted_access_key_id == create_key_1.access_key.access_key_id - name: Create a second key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present rotate_keys: true @@ -225,7 +225,7 @@ - create_key_3.access_key.status == 'Active' - name: Fetch IAM key info (2 keys - oldest rotated) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -253,7 +253,7 @@ access_key_1: "{{ access_key_info.access_keys[0] }}" access_key_2: "{{ access_key_info.access_keys[1] }}" - name: Disable third key (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: false @@ -265,7 +265,7 @@ - disable_key is changed - name: Disable third key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: false @@ -285,7 +285,7 @@ - disable_key.access_key.status == 'Inactive' - name: Disable third key - idempotency (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: false @@ -297,7 +297,7 @@ - disable_key is not changed - name: Disable third key - idempotency - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: false @@ -317,7 +317,7 @@ - disable_key.access_key.status == 'Inactive' - name: Fetch IAM key info (2 keys - 1 disabled) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -345,7 +345,7 @@ access_key_1: "{{ access_key_info.access_keys[0] }}" access_key_2: "{{ access_key_info.access_keys[1] }}" - name: Touch third key - no change (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" register: touch_key @@ -356,7 +356,7 @@ - touch_key is not changed - name: Touch third key - no change - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" register: touch_key @@ -377,7 +377,7 @@ # ================================================================================== - name: Enable third key (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: true @@ -389,7 +389,7 @@ - enable_key is changed - name: Enable third key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: true @@ -409,7 +409,7 @@ - enable_key.access_key.status == 'Active' - name: Enable third key - idempotency (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: true @@ -421,7 +421,7 @@ - enable_key is not changed - name: Enable third key - idempotency - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: true @@ -443,7 +443,7 @@ # ================================================================================== - name: Touch third key again - no change (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" register: touch_key @@ -454,7 +454,7 @@ - touch_key is not changed - name: Touch third key again - no change - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" register: touch_key @@ -475,7 +475,7 @@ # ================================================================================== - name: Re-Disable third key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" enabled: false @@ -526,7 +526,7 @@ # ================================================================================== - name: Delete active key (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_2.access_key.access_key_id }}" state: absent @@ -538,7 +538,7 @@ - delete_active_key is changed - name: Delete active key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_2.access_key.access_key_id }}" state: absent @@ -549,7 +549,7 @@ - delete_active_key is changed - name: Delete active key - idempotency (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_2.access_key.access_key_id }}" state: absent @@ -561,7 +561,7 @@ - delete_active_key is not changed - name: Delete active key - idempotency - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_2.access_key.access_key_id }}" state: absent @@ -574,7 +574,7 @@ # ================================================================================== - name: Delete inactive key (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" state: absent @@ -586,7 +586,7 @@ - delete_inactive_key is changed - name: Delete inactive key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" state: absent @@ -597,7 +597,7 @@ - delete_inactive_key is changed - name: Delete inactive key - idempotency (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" state: absent @@ -609,7 +609,7 @@ - delete_inactive_key is not changed - name: Delete inactive key - idempotency - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_3.access_key.access_key_id }}" state: absent @@ -622,7 +622,7 @@ # ================================================================================== - name: Fetch IAM key info (no keys) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -634,7 +634,7 @@ # ================================================================================== - name: Create an inactive key (check_mode) - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present enabled: false @@ -646,7 +646,7 @@ - create_key_4 is changed - name: Create a key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" state: present enabled: false @@ -667,7 +667,7 @@ - create_key_4.access_key.status == 'Inactive' - name: Fetch IAM key info (1 inactive key) - iam_access_key_info: + amazon.aws.iam_access_key_info: user_name: "{{ test_user }}" register: access_key_info - ansible.builtin.assert: @@ -686,7 +686,7 @@ vars: access_key_1: "{{ access_key_info.access_keys[0] }}" - name: Disable new key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_4.access_key.access_key_id }}" enabled: false @@ -701,7 +701,7 @@ # Cleanup - name: Delete new key - iam_access_key: + amazon.aws.iam_access_key: user_name: "{{ test_user }}" id: "{{ create_key_4.access_key.access_key_id }}" state: absent diff --git a/tests/integration/targets/iam_instance_profile/tasks/main.yml b/tests/integration/targets/iam_instance_profile/tasks/main.yml index 9a3f1f546ce..7aebb3a2aca 100644 --- a/tests/integration/targets/iam_instance_profile/tasks/main.yml +++ b/tests/integration/targets/iam_instance_profile/tasks/main.yml @@ -36,7 +36,7 @@ # =================================================================== - name: Create minimal Instance Profile (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" check_mode: true register: profile_result @@ -46,7 +46,7 @@ - profile_result is changed - name: Create minimal Instance Profile - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" register: profile_result @@ -55,7 +55,7 @@ - profile_result is changed - name: Create minimal Instance Profile - Idempotent (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" check_mode: true register: profile_result @@ -65,7 +65,7 @@ - profile_result is not changed - name: Create minimal Instance Profile - Idempotent - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" register: profile_result @@ -77,7 +77,7 @@ - ansible.builtin.include_tasks: tags.yml - name: Add role to Instance Profile (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}" check_mode: true @@ -88,7 +88,7 @@ - profile_result is changed - name: Add role to Instance Profile - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}" register: profile_result @@ -98,7 +98,7 @@ - profile_result is changed - name: Add role to Instance Profile - Idempotent (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}" check_mode: true @@ -109,7 +109,7 @@ - profile_result is not changed - name: Add role to Instance Profile - Idempotent - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}" register: profile_result @@ -121,7 +121,7 @@ # ===== - name: Replace role on Instance Profile (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}-2" check_mode: true @@ -132,7 +132,7 @@ - profile_result is changed - name: Replace role on Instance Profile - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}-2" register: profile_result @@ -142,7 +142,7 @@ - profile_result is changed - name: Replace role on Instance Profile - Idempotent (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}-2" check_mode: true @@ -153,7 +153,7 @@ - profile_result is not changed - name: Replace role on Instance Profile - Idempotent - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "{{ test_role }}-2" register: profile_result @@ -165,7 +165,7 @@ # ===== - name: Remove role from Instance Profile (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "" check_mode: true @@ -176,7 +176,7 @@ - profile_result is changed - name: Remove role from Instance Profile - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "" register: profile_result @@ -186,7 +186,7 @@ - profile_result is changed - name: Remove role from Instance Profile - Idempotent (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "" check_mode: true @@ -197,7 +197,7 @@ - profile_result is not changed - name: Remove role from Instance Profile - Idempotent - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile }}" role: "" register: profile_result @@ -209,7 +209,7 @@ # =================================================================== - name: Create complex Instance Profile (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile_complex }}" role: "{{ test_role }}-2" path: "{{ test_path }}" @@ -222,7 +222,7 @@ - profile_result is changed - name: Create complex Instance Profile - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile_complex }}" role: "{{ test_role }}-2" path: "{{ test_path }}" @@ -234,7 +234,7 @@ - profile_result is changed - name: Create complex Instance Profile - Idempotent (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile_complex }}" role: "{{ test_role }}-2" path: "{{ test_path }}" @@ -247,7 +247,7 @@ - profile_result is not changed - name: Create complex Instance Profile - Idempotent - iam_instance_profile: + amazon.aws.iam_instance_profile: name: "{{ test_profile_complex }}" role: "{{ test_role }}-2" path: "{{ test_path }}" @@ -261,7 +261,7 @@ # =================================================================== - name: List all Instance Profiles (no filter) - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: profile_info - ansible.builtin.assert: @@ -294,7 +294,7 @@ complex_profile: '{{ profile_info.iam_instance_profiles | selectattr("instance_profile_name", "match", test_profile_complex) | first}}' - name: List all Instance Profiles (filter by path) - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: path: "{{ test_path }}" register: profile_info @@ -327,7 +327,7 @@ complex_profile: '{{ profile_info.iam_instance_profiles | selectattr("instance_profile_name", "match", test_profile_complex) | first}}' - name: List all Instance Profiles (filter by name - complex) - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: name: "{{ test_profile_complex }}" register: profile_info @@ -362,7 +362,7 @@ complex_profile: '{{ profile_info.iam_instance_profiles | selectattr("instance_profile_name", "match", test_profile_complex) | first}}' - name: List an Instance Profile (filter by name) - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: name: "{{ test_profile }}" register: profile_info @@ -386,7 +386,7 @@ # =================================================================== - name: Delete minimal Instance Profile (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile }}" check_mode: true @@ -397,7 +397,7 @@ - profile_result is changed - name: Delete minimal Instance Profile - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile }}" register: profile_result @@ -407,7 +407,7 @@ - profile_result is changed - name: Delete minimal Instance Profile - Idempotent (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile }}" check_mode: true @@ -418,7 +418,7 @@ - profile_result is not changed - name: Delete minimal Instance Profile - Idempotent - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile }}" register: profile_result @@ -430,7 +430,7 @@ # =================================================================== - name: Delete complex Instance Profile (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile_complex }}" check_mode: true @@ -441,7 +441,7 @@ - profile_result is changed - name: Delete complex Instance Profile - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile_complex }}" register: profile_result @@ -451,7 +451,7 @@ - profile_result is changed - name: Delete complex Instance Profile - Idempotent (CHECK) - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile_complex }}" check_mode: true @@ -462,7 +462,7 @@ - profile_result is not changed - name: Delete complex Instance Profile - Idempotent - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ test_profile_complex }}" register: profile_result @@ -476,11 +476,11 @@ # Cleanup # - name: "iam_instance_profile_info after Role deletion" - # iam_instance_profile_info: + # amazon.aws.iam_instance_profile_info: # ignore_errors: true - name: Delete Instance Profiles - iam_instance_profile: + amazon.aws.iam_instance_profile: state: absent name: "{{ item }}" ignore_errors: true @@ -502,6 +502,6 @@ - "{{ test_role }}-2" # - name: "iam_role_info after Role deletion" -# iam_role_info: +# amazon.aws.iam_role_info: # path: "{{ test_path }}" # ignore_errors: true diff --git a/tests/integration/targets/iam_instance_profile/tasks/tags.yml b/tests/integration/targets/iam_instance_profile/tasks/tags.yml index 0cdb44e8967..15aa70382aa 100644 --- a/tests/integration/targets/iam_instance_profile/tasks/tags.yml +++ b/tests/integration/targets/iam_instance_profile/tasks/tags.yml @@ -35,7 +35,7 @@ # - name: (check) add tags - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ first_tags }}" state: present register: tag_profile @@ -47,13 +47,13 @@ - tag_profile is changed - name: add tags - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ first_tags }}" state: present register: tag_profile - name: get instance profile facts - iam_instance_profile_info: {} + amazon.aws.iam_instance_profile_info: {} register: tag_profile_info - name: verify the tags were added @@ -64,7 +64,7 @@ - tag_profile_info.iam_instance_profiles[0].tags == first_tags - name: (check) add tags - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ first_tags }}" state: present register: tag_profile @@ -76,12 +76,12 @@ - tag_profile is not changed - name: add tags - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ first_tags }}" state: present register: tag_profile - name: get instance profile facts - iam_instance_profile_info: {} + amazon.aws.iam_instance_profile_info: {} register: tag_profile_info - name: verify no change @@ -94,7 +94,7 @@ # ============================================================ - name: (check) modify tags with purge - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ second_tags }}" state: present register: tag_profile @@ -106,12 +106,12 @@ - tag_profile is changed - name: modify tags with purge - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ second_tags }}" state: present register: tag_profile - name: get instance profile facts - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: tag_profile_info - name: verify the tags were added @@ -122,7 +122,7 @@ - tag_profile_info.iam_instance_profiles[0].tags == second_tags - name: (check) modify tags with purge - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ second_tags }}" state: present register: tag_profile @@ -134,12 +134,12 @@ - tag_profile is not changed - name: modify tags with purge - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ second_tags }}" state: present register: tag_profile - name: get instance profile facts - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: tag_profile_info - name: verify no change @@ -152,7 +152,7 @@ # ============================================================ - name: (check) modify tags without purge - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ third_tags }}" state: present purge_tags: false @@ -165,13 +165,13 @@ - tag_profile is changed - name: modify tags without purge - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ third_tags }}" state: present purge_tags: false register: tag_profile - name: get instance profile facts - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: tag_profile_info - name: verify the tags were added @@ -182,7 +182,7 @@ - tag_profile_info.iam_instance_profiles[0].tags == final_tags - name: (check) modify tags without purge - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ third_tags }}" state: present purge_tags: false @@ -195,13 +195,13 @@ - tag_profile is not changed - name: modify tags without purge - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: "{{ third_tags }}" state: present purge_tags: false register: tag_profile - name: get instance profile facts - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: tag_profile_info - name: verify no change @@ -214,7 +214,7 @@ # ============================================================ - name: (check) No change to tags without setting tags - iam_instance_profile: + amazon.aws.iam_instance_profile: state: present register: tag_profile check_mode: true @@ -225,11 +225,11 @@ - tag_profile is not changed - name: No change to tags without setting tags - iam_instance_profile: + amazon.aws.iam_instance_profile: state: present register: tag_profile - name: get instance profile facts - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: tag_profile_info - name: verify the tags were added @@ -242,7 +242,7 @@ # ============================================================ - name: (check) remove all tags - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: {} state: present register: tag_profile @@ -254,12 +254,12 @@ - tag_profile is changed - name: remove all tags - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: {} state: present register: tag_profile - name: get instance profile facts - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: tag_profile_info - name: verify the tags were added @@ -270,7 +270,7 @@ - tag_profile_info.iam_instance_profiles[0].tags == {} - name: (check) remove all tags - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: {} state: present register: tag_profile @@ -282,12 +282,12 @@ - tag_profile is not changed - name: remove all tags - IDEMPOTENCY - iam_instance_profile: + amazon.aws.iam_instance_profile: tags: {} state: present register: tag_profile - name: get instance profile - iam_instance_profile_info: + amazon.aws.iam_instance_profile_info: register: tag_profile_info - name: verify no change diff --git a/tests/integration/targets/iam_role/tasks/main.yml b/tests/integration/targets/iam_role/tasks/main.yml index 0aac9ef48a0..b7a62db9f2a 100644 --- a/tests/integration/targets/iam_role/tasks/main.yml +++ b/tests/integration/targets/iam_role/tasks/main.yml @@ -25,7 +25,7 @@ secret_key: "{{ aws_secret_key }}" session_token: "{{ security_token | default(omit) }}" region: "{{ aws_region }}" - iam_role: + amazon.aws.iam_role: assume_role_policy_document: '{{ lookup("file", "deny-assume.json") }}' collections: - community.general diff --git a/tests/integration/targets/iam_role/tasks/parameter_checks.yml b/tests/integration/targets/iam_role/tasks/parameter_checks.yml index 692650b5284..2cf46eebfdb 100644 --- a/tests/integration/targets/iam_role/tasks/parameter_checks.yml +++ b/tests/integration/targets/iam_role/tasks/parameter_checks.yml @@ -27,7 +27,7 @@ - '"ARN" in iam_role.msg' - name: Friendly message when "present" without assume_role_policy_document - module_defaults: { iam_role: {}} + module_defaults: { amazon.aws.iam_role: {}} community.aws.iam_role: name: "{{ test_role }}" register: iam_role diff --git a/tests/integration/targets/inventory_aws_ec2/playbooks/test_inventory_ssm.yml b/tests/integration/targets/inventory_aws_ec2/playbooks/test_inventory_ssm.yml index 454c2e5eae1..c8e820aad79 100644 --- a/tests/integration/targets/inventory_aws_ec2/playbooks/test_inventory_ssm.yml +++ b/tests/integration/targets/inventory_aws_ec2/playbooks/test_inventory_ssm.yml @@ -73,7 +73,7 @@ instances_ids: "{{ [instance_output.instance_ids[0]] }}" - name: Get ssm inventory information - ssm_inventory_info: + community.aws.ssm_inventory_info: instance_id: "{{ instance_output.instance_ids[0] }}" register: result until: result.ssm_inventory != {} diff --git a/tests/integration/targets/inventory_aws_ec2/tasks/setup.yml b/tests/integration/targets/inventory_aws_ec2/tasks/setup.yml index edff15ceecd..e970e48c8ac 100644 --- a/tests/integration/targets/inventory_aws_ec2/tasks/setup.yml +++ b/tests/integration/targets/inventory_aws_ec2/tasks/setup.yml @@ -44,7 +44,7 @@ subnet_id: "{{ setup_subnet.subnet.id }}" - name: create a security group to use for creating an ec2 instance - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}_setup" description: created by Ansible integration tests state: present diff --git a/tests/integration/targets/inventory_aws_ec2/tasks/tear_down.yml b/tests/integration/targets/inventory_aws_ec2/tasks/tear_down.yml index c2d5eaf1981..aae674e2c4d 100644 --- a/tests/integration/targets/inventory_aws_ec2/tasks/tear_down.yml +++ b/tests/integration/targets/inventory_aws_ec2/tasks/tear_down.yml @@ -29,7 +29,7 @@ state: absent - name: remove setup security group - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ resource_prefix }}_setup" description: created by Ansible integration tests state: absent diff --git a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_grants.yml b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_grants.yml index c9cba288db8..44f30bd9a46 100644 --- a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_grants.yml +++ b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_grants.yml @@ -16,7 +16,7 @@ "Deny"} }' register: iam_role_result - name: create a key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -49,7 +49,7 @@ # ------------------------------------------------------------------------------------------ - name: Add grant - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_grants: true @@ -75,7 +75,7 @@ - ansible.builtin.wait_for: timeout: 20 - name: Add grant - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_grants: true @@ -117,7 +117,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Add grant (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_grants: true @@ -139,7 +139,7 @@ - not key.changed - name: Add grant (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_grants: true @@ -177,7 +177,7 @@ - key.description == '' - name: Add a second grant - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present grants: @@ -218,7 +218,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Add a second grant again - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present grants: @@ -256,7 +256,7 @@ - key.description == '' - name: Update the grants with purge_grants set - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_grants: true @@ -295,7 +295,7 @@ - key.description == '' - name: Update third grant to change encryption context equals to subset - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present grants: @@ -338,7 +338,7 @@ # ============================================================ # CLEAN-UP - name: finish off by deleting keys - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ kms_key_alias }}" pending_window: 7 diff --git a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_modify.yml b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_modify.yml index 665f834d781..637a8b77a10 100644 --- a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_modify.yml +++ b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_modify.yml @@ -16,7 +16,7 @@ "Deny"} }' register: iam_role_result - name: create a key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -53,7 +53,7 @@ kms_key_id: "{{ key.key_id }}" kms_key_arn: "{{ key.key_arn }}" - name: find facts about the key (by ID) - kms_key_info: + amazon.aws.kms_key_info: key_id: "{{ kms_key_id }}" register: new_key - name: check that a key was found @@ -78,7 +78,7 @@ - new_key.kms_keys[0].description == '' - name: Update policy - check mode - kms_key: + amazon.aws.kms_key: key_id: "{{ kms_key_id }}" policy: "{{ lookup('template', 'console-policy.j2') }}" register: key @@ -88,7 +88,7 @@ - key is changed - name: Update policy - kms_key: + amazon.aws.kms_key: key_id: "{{ kms_key_id }}" policy: "{{ lookup('template', 'console-policy.j2') }}" register: key @@ -118,7 +118,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Update policy (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: alias/{{ kms_key_alias }} policy: "{{ lookup('template', 'console-policy.j2') }}" register: key @@ -128,7 +128,7 @@ - not key.changed - name: Update policy (idempotence) - kms_key: + amazon.aws.kms_key: alias: alias/{{ kms_key_alias }} policy: "{{ lookup('template', 'console-policy.j2') }}" register: key @@ -156,7 +156,7 @@ # ------------------------------------------------------------------------------------------ - name: Update description - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present description: test key for testing @@ -167,7 +167,7 @@ - key.changed - name: Update description - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present description: test key for testing @@ -197,7 +197,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Update description (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present description: test key for testing @@ -208,7 +208,7 @@ - not key.changed - name: Update description (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present description: test key for testing @@ -237,7 +237,7 @@ # ------------------------------------------------------------------------------------------ - name: update policy to remove access to key rotation status - kms_key: + amazon.aws.kms_key: alias: alias/{{ kms_key_alias }} policy: "{{ lookup('template', 'console-policy-no-key-rotation.j2') }}" register: key @@ -266,7 +266,7 @@ # ============================================================ # CLEAN-UP - name: finish off by deleting keys - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ kms_key_alias }}" pending_window: 7 diff --git a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_multi_region.yml b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_multi_region.yml index 814d35389ee..cddabfe481c 100644 --- a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_multi_region.yml +++ b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_multi_region.yml @@ -9,10 +9,10 @@ amazon.aws.aws_caller_info: register: aws_caller_info - name: See whether key exists and its current state - kms_key_info: + amazon.aws.kms_key_info: alias: "{{ kms_key_alias }}" - name: create a multi region key - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}-check" tags: Hello: World @@ -22,7 +22,7 @@ register: key_check check_mode: true - name: find facts about the check mode key - kms_key_info: + amazon.aws.kms_key_info: alias: "{{ kms_key_alias }}-check" register: check_key - name: ensure that check mode worked as expected @@ -32,7 +32,7 @@ - key_check is changed - name: create a multi region key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -69,7 +69,7 @@ timeout: 45 - name: create a key (expect failure) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -90,7 +90,7 @@ # ============================================================ # CLEAN-UP - name: finish off by deleting keys - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ item }}" pending_window: 7 diff --git a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_states.yml b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_states.yml index 21c2f3db8bf..488f3ea8b08 100644 --- a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_states.yml +++ b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_states.yml @@ -9,10 +9,10 @@ amazon.aws.aws_caller_info: register: aws_caller_info - name: See whether key exists and its current state - kms_key_info: + amazon.aws.kms_key_info: alias: "{{ kms_key_alias }}" - name: create a key - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}-check" tags: Hello: World @@ -21,7 +21,7 @@ register: key_check check_mode: true - name: find facts about the check mode key - kms_key_info: + amazon.aws.kms_key_info: alias: "{{ kms_key_alias }}-check" register: check_key - name: ensure that check mode worked as expected @@ -31,7 +31,7 @@ - key_check is changed - name: create a key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -66,7 +66,7 @@ ansible.builtin.wait_for: timeout: 45 - name: create a key (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -79,7 +79,7 @@ - key is not changed - name: create a key (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -116,7 +116,7 @@ kms_key_id: "{{ key.key_id }}" kms_key_arn: "{{ key.key_arn }}" - name: Enable key rotation - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -130,7 +130,7 @@ - key.changed - name: Enable key rotation - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -164,7 +164,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Enable key rotation (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -178,7 +178,7 @@ - not key.changed - name: Enable key rotation (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -210,7 +210,7 @@ # ------------------------------------------------------------------------------------------ - name: Disable key - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present enabled: false @@ -221,7 +221,7 @@ - key.changed - name: Disable key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present enabled: false @@ -252,7 +252,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Disable key (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present enabled: false @@ -263,7 +263,7 @@ - not key.changed - name: Disable key (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present enabled: false @@ -292,7 +292,7 @@ # ------------------------------------------------------------------------------------------ - name: Delete key - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: absent register: key @@ -302,7 +302,7 @@ - key is changed - name: Delete key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: absent register: key @@ -338,7 +338,7 @@ - (( deletion_time | to_datetime ) - ( now_time | to_datetime )).days >= 29 - name: Delete key (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: absent register: key @@ -348,7 +348,7 @@ - not key.changed - name: Delete key (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: absent register: key @@ -382,7 +382,7 @@ # ------------------------------------------------------------------------------------------ - name: Cancel key deletion - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present register: key @@ -392,7 +392,7 @@ - key.changed - name: Cancel key deletion - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present register: key @@ -422,7 +422,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Cancel key deletion (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present register: key @@ -432,7 +432,7 @@ - not key.changed - name: Cancel key deletion (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present register: key @@ -461,7 +461,7 @@ # ------------------------------------------------------------------------------------------ - name: delete the key with a specific deletion window - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: absent pending_window: 7 @@ -484,7 +484,7 @@ # ============================================================ # test different key usage and specs - name: create kms key with different specs - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}-diff-spec-usage" purge_grants: true key_spec: ECC_NIST_P256 @@ -509,7 +509,7 @@ # ============================================================ # CLEAN-UP - name: finish off by deleting keys - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ item }}" pending_window: 7 diff --git a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_tagging.yml b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_tagging.yml index bca05069d45..310c279e1c8 100644 --- a/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_tagging.yml +++ b/tests/integration/targets/kms_key/roles/aws_kms/tasks/test_tagging.yml @@ -9,7 +9,7 @@ amazon.aws.aws_caller_info: register: aws_caller_info - name: create a key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" tags: Hello: World @@ -42,7 +42,7 @@ # ------------------------------------------------------------------------------------------ - name: Tag encryption key - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present tags: @@ -78,7 +78,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Modify tags - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_tags: true @@ -92,7 +92,7 @@ - key.changed - name: Modify tags - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_tags: true @@ -130,7 +130,7 @@ ansible.builtin.wait_for: timeout: 45 - name: Modify tags (idempotence) - check mode - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_tags: true @@ -144,7 +144,7 @@ - not key.changed - name: Modify tags (idempotence) - kms_key: + amazon.aws.kms_key: alias: "{{ kms_key_alias }}" state: present purge_tags: true @@ -181,7 +181,7 @@ # ============================================================ # CLEAN-UP - name: finish off by deleting keys - kms_key: + amazon.aws.kms_key: state: absent alias: "{{ kms_key_alias }}" pending_window: 7 diff --git a/tests/integration/targets/lambda/tasks/main.yml b/tests/integration/targets/lambda/tasks/main.yml index 246029b17ec..07ba1474517 100644 --- a/tests/integration/targets/lambda/tasks/main.yml +++ b/tests/integration/targets/lambda/tasks/main.yml @@ -77,7 +77,7 @@ - '"role" in result.msg' - name: test execute lambda with no function arn or name - lambda_execute: + amazon.aws.lambda_execute: register: result ignore_errors: true - name: assert failure when called with no parameters @@ -185,7 +185,7 @@ - ansible.builtin.include_tasks: tagging.yml - name: test lambda works (check mode) - lambda_execute: + amazon.aws.lambda_execute: name: "{{lambda_function_name}}" payload: name: Mr Ansible Tests @@ -198,7 +198,7 @@ - "'result' not in result" - name: test lambda works - lambda_execute: + amazon.aws.lambda_execute: name: "{{lambda_function_name}}" payload: name: Mr Ansible Tests @@ -210,7 +210,7 @@ - result.result.output.message == "hello Mr Ansible Tests" - name: test execute lambda with function arn - lambda_execute: + amazon.aws.lambda_execute: function_arn: "{{ lambda_function_arn }}" payload: name: Mr Ansible Tests @@ -471,7 +471,7 @@ # # # More Lambda update tests # - name: test state=present with all nullable variables explicitly set to null - # lambda: + # amazon.aws.lambda: # name: '{{lambda_function_name}}' # runtime: '{{ lambda_python_runtime }}' # role: '{{ lambda_role_name }}' @@ -524,7 +524,7 @@ - result.configuration.environment.variables.extra_message == "I think you are great!!" - name: test lambda works - lambda_execute: + amazon.aws.lambda_execute: name: "{{lambda_function_name}}" payload: name: Mr Ansible Tests @@ -685,7 +685,7 @@ dest: "{{ remote_tmp_dir }}/lambda_layer.zip" - name: Create lambda layer - lambda_layer: + amazon.aws.lambda_layer: name: "{{ lambda_python_layers_names[0] }}" description: "{{ lambda_python_layers_names[0] }} lambda layer" content: @@ -693,7 +693,7 @@ register: first_layer - name: Create another lambda layer - lambda_layer: + amazon.aws.lambda_layer: name: "{{ lambda_python_layers_names[1] }}" description: "{{ lambda_python_layers_names[1] }} lambda layer" content: @@ -775,7 +775,7 @@ always: - name: Delete lambda layers - lambda_layer: + amazon.aws.lambda_layer: name: "{{ item }}" version: -1 state: absent diff --git a/tests/integration/targets/lambda_layer/tasks/main.yml b/tests/integration/targets/lambda_layer/tasks/main.yml index 7100d44c0c6..2db4237cfc4 100644 --- a/tests/integration/targets/lambda_layer/tasks/main.yml +++ b/tests/integration/targets/lambda_layer/tasks/main.yml @@ -41,7 +41,7 @@ state: present - name: add object into bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ s3_bucket_name }}" mode: put object: "{{ s3_bucket_object }}" @@ -49,7 +49,7 @@ src: "{{ zip_file_path }}" - name: Create lambda layer (check_mode=true) - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" description: "{{ resource_prefix }} lambda layer first version" content: @@ -61,7 +61,7 @@ check_mode: true - name: Retrieve all layers versions - lambda_layer_info: + amazon.aws.lambda_layer_info: name: "{{ layer_name }}" register: layers @@ -73,7 +73,7 @@ - layers.layers_versions | length == 0 - name: Create lambda layer (first version) - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" description: "{{ resource_prefix }} lambda layer first version" content: @@ -84,7 +84,7 @@ register: first_version - name: Create another lambda layer version - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" description: "{{ resource_prefix }} lambda layer second version" content: @@ -96,7 +96,7 @@ register: last_version - name: Retrieve all layers with latest version - lambda_layer_info: + amazon.aws.lambda_layer_info: register: layers - name: Ensure layer created above was found @@ -113,7 +113,7 @@ layers_version_arns: '{{ layers.layers_versions | map(attribute="layer_version_arn") | list }}' - name: Retrieve all layers versions - lambda_layer_info: + amazon.aws.lambda_layer_info: name: "{{ layer_name }}" register: layers @@ -130,7 +130,7 @@ layers_version_arns: '{{ layers.layers_versions | map(attribute="layer_version_arn") | list }}' - name: Delete latest layer version - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" version: "{{ last_version.layer_versions.0.version }}" state: absent @@ -138,7 +138,7 @@ register: delete_check_mode - name: Retrieve all layers versions - lambda_layer_info: + amazon.aws.lambda_layer_info: name: "{{ layer_name }}" register: layers @@ -154,14 +154,14 @@ layers_version_arns: '{{ layers.layers_versions | map(attribute="layer_version_arn") | list }}' - name: Delete latest layer version - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" version: "{{ last_version.layer_versions.0.version }}" state: absent register: delete_layer - name: Retrieve all layers versions - lambda_layer_info: + amazon.aws.lambda_layer_info: name: "{{ layer_name }}" register: layers @@ -177,7 +177,7 @@ layers_version_arns: '{{ layers.layers_versions | map(attribute="layer_version_arn") | list }}' - name: Delete again the latest layer version (idempotency) - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" version: "{{ last_version.layer_versions.0.version }}" state: absent @@ -189,7 +189,7 @@ - delete_idempotent is not changed - name: Create multiple lambda layer versions - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" description: "{{ resource_prefix }} lambda layer version compatible with python3.{{ item }}" content: @@ -201,14 +201,14 @@ with_items: ["9", "10"] - name: Delete all layer versions - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" version: -1 state: absent register: delete_layer - name: Retrieve all layers versions - lambda_layer_info: + amazon.aws.lambda_layer_info: name: "{{ layer_name }}" register: layers @@ -221,7 +221,7 @@ always: - name: Delete lambda layer if not deleted during testing - lambda_layer: + amazon.aws.lambda_layer: name: "{{ layer_name }}" version: -1 state: absent @@ -234,7 +234,7 @@ ignore_errors: true - name: Remove object from bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ s3_bucket_name }}" mode: delobj object: "{{ s3_bucket_object }}" diff --git a/tests/integration/targets/lambda_policy/tasks/main.yml b/tests/integration/targets/lambda_policy/tasks/main.yml index 33ada25b04d..c3c73aaf27c 100644 --- a/tests/integration/targets/lambda_policy/tasks/main.yml +++ b/tests/integration/targets/lambda_policy/tasks/main.yml @@ -79,7 +79,7 @@ src: endpoint-test-swagger-api.yml.j2 dest: "{{output_dir}}/endpoint-test-swagger-api.yml.j2" - name: deploy new API - api_gateway: + community.aws.api_gateway: api_file: "{{output_dir}}/endpoint-test-swagger-api.yml.j2" stage: lambdabased register: create_result @@ -124,7 +124,7 @@ that: - uri_result - name: deploy new API - api_gateway: + community.aws.api_gateway: api_file: "{{output_dir}}/endpoint-test-swagger-api.yml.j2" stage: lambdabased register: create_result @@ -137,7 +137,7 @@ register: result ignore_errors: true - name: destroy API for test cleanup if created - api_gateway: + community.aws.api_gateway: state: absent api_id: "{{api_id}}" register: destroy_result diff --git a/tests/integration/targets/lookup_secretsmanager_secret/tasks/main.yaml b/tests/integration/targets/lookup_secretsmanager_secret/tasks/main.yaml index 5c268707979..c1b8b964ef9 100644 --- a/tests/integration/targets/lookup_secretsmanager_secret/tasks/main.yaml +++ b/tests/integration/targets/lookup_secretsmanager_secret/tasks/main.yaml @@ -57,7 +57,7 @@ - get_missing_secret is failed - name: create secret "{{ secret_name }}" - secretsmanager_secret: + community.aws.secretsmanager_secret: name: "{{ secret_name }}" secret: "{{ secret_value }}" tags: @@ -74,7 +74,7 @@ - look_secret == secret_value - name: delete secret - secretsmanager_secret: + community.aws.secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 7 @@ -113,7 +113,7 @@ always: # delete secret created - name: delete secret - secretsmanager_secret: + community.aws.secretsmanager_secret: name: "{{ secret_name }}" state: absent recovery_window: 0 diff --git a/tests/integration/targets/lookup_ssm_parameter/tasks/main.yml b/tests/integration/targets/lookup_ssm_parameter/tasks/main.yml index 806bf8fd958..b96307d877b 100644 --- a/tests/integration/targets/lookup_ssm_parameter/tasks/main.yml +++ b/tests/integration/targets/lookup_ssm_parameter/tasks/main.yml @@ -66,7 +66,7 @@ - lookup_value | list | length == 0 - name: Create key/value pair in aws parameter store - ssm_parameter: + community.aws.ssm_parameter: name: "{{ simple_name }}" description: "{{ simple_description }}" value: "{{ simple_value }}" @@ -79,7 +79,7 @@ - lookup_value == simple_value - name: Create key/value pair in aws parameter store - ssm_parameter: + community.aws.ssm_parameter: name: "{{ simple_name }}" description: "{{ simple_description }}" value: "{{ simple_value }}" @@ -92,7 +92,7 @@ - lookup_value == simple_value - name: Update key/value pair in aws parameter store - ssm_parameter: + community.aws.ssm_parameter: name: "{{ simple_name }}" description: "{{ simple_description }}" value: "{{ updated_value }}" @@ -114,19 +114,19 @@ # ============================================================ - name: Create nested key/value pair in aws parameter store (1) - ssm_parameter: + community.aws.ssm_parameter: name: "{{ path_name_a }}" description: "{{ path_description }}" value: "{{ path_value_a }}" - name: Create nested key/value pair in aws parameter store (2) - ssm_parameter: + community.aws.ssm_parameter: name: "{{ path_name_b }}" description: "{{ path_description }}" value: "{{ path_value_b }}" - name: Create nested key/value pair in aws parameter store (3) - ssm_parameter: + community.aws.ssm_parameter: name: "{{ path_name_c }}" description: "{{ path_description }}" value: "{{ path_value_c }}" @@ -264,7 +264,7 @@ always: # ============================================================ - name: Delete remaining key/value pairs in aws parameter store - ssm_parameter: + community.aws.ssm_parameter: name: "{{item}}" state: absent ignore_errors: true diff --git a/tests/integration/targets/rds_cluster_create/tasks/main.yaml b/tests/integration/targets/rds_cluster_create/tasks/main.yaml index 4c4b31d0cd8..0cfc4259cf8 100644 --- a/tests/integration/targets/rds_cluster_create/tasks/main.yaml +++ b/tests/integration/targets/rds_cluster_create/tasks/main.yaml @@ -7,7 +7,7 @@ session_token: "{{ security_token | default(omit) }}" block: - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: "{{ engine}}" @@ -22,7 +22,7 @@ ignore_errors: true - name: Get info of all existing clusters - rds_cluster_info: + amazon.aws.rds_cluster_info: register: _result_cluster_info - ansible.builtin.assert: @@ -30,7 +30,7 @@ - _result_cluster_info is successful - name: Create minimal aurora cluster in default VPC and default subnet group (CHECK MODE) - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -44,7 +44,7 @@ - _result_create_db_cluster.changed - name: Create minimal aurora cluster in default VPC and default subnet group - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -83,7 +83,7 @@ - _result_create_db_cluster.tags["Name"] == "{{ tags_create["Name"]}}" - "'vpc_security_groups' in _result_create_db_cluster" - name: Get info of the existing cluster - rds_cluster_info: + amazon.aws.rds_cluster_info: cluster_id: "{{ cluster_id }}" register: result_cluster_info @@ -92,7 +92,7 @@ - result_cluster_info is successful - name: Create minimal aurora cluster in default VPC and default subnet group - idempotence (CHECK MODE) - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -106,7 +106,7 @@ - not _result_create_db_cluster.changed - name: Create minimal aurora cluster in default VPC and default subnet group - idempotence - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -120,7 +120,7 @@ always: - name: Delete DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ cluster_id }}" skip_final_snapshot: true diff --git a/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml b/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml index 23c9949bb37..bd8e2395df2 100644 --- a/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml +++ b/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml @@ -7,7 +7,7 @@ session_token: "{{ security_token | default(omit) }}" block: - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: "{{ engine}}" @@ -44,7 +44,7 @@ loop: "{{ subnets }}" - name: Create security groups - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ item }}" description: Created by rds_cluster integration tests state: present @@ -52,7 +52,7 @@ loop: "{{ security_groups }}" - name: Create an RDS cluster in the VPC with two security groups - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" engine: "{{ engine }}" username: "{{ username }}" @@ -92,7 +92,7 @@ - _result_create_db_cluster.vpc_security_groups | selectattr('status', 'in', ['active', 'adding']) | list | length == 2 - name: Add a new security group without purge (check_mode) - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present vpc_security_group_ids: @@ -107,7 +107,7 @@ - _result_create_db_cluster.changed - name: Add a new security group without purge - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present vpc_security_group_ids: @@ -146,7 +146,7 @@ - _result_create_db_cluster.vpc_security_groups | selectattr('status', 'in', ['active', 'adding']) | list | length == 3 - name: Add a new security group without purge (test idempotence) - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present vpc_security_group_ids: @@ -160,7 +160,7 @@ - not _result_create_db_cluster.changed - name: Add a security group with purge - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present vpc_security_group_ids: @@ -176,14 +176,14 @@ always: - name: Delete DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ cluster_id }}" skip_final_snapshot: true ignore_errors: true - name: Remove security groups - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ item }}" description: created by rds_cluster integration tests state: absent diff --git a/tests/integration/targets/rds_cluster_modify/tasks/main.yaml b/tests/integration/targets/rds_cluster_modify/tasks/main.yaml index 4850fdac9e4..37af5da3803 100644 --- a/tests/integration/targets/rds_cluster_modify/tasks/main.yaml +++ b/tests/integration/targets/rds_cluster_modify/tasks/main.yaml @@ -12,7 +12,7 @@ # import_tasks: remove_from_global_db.yaml - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: "{{ engine}}" @@ -30,7 +30,7 @@ # avoid the following error when we try to adjust the port: # You currently can't modify EndpointPort with Aurora Serverless. - name: Create an Aurora-MySQL DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present engine: aurora-mysql @@ -67,7 +67,7 @@ - "'vpc_security_groups' in _result_create_source_db_cluster" - name: Modify DB cluster password - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present password: "{{ new_password }}" @@ -102,7 +102,7 @@ - "'vpc_security_groups' in _result_modify_password" - name: Modify DB cluster port - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present port: "{{ new_port }}" @@ -135,7 +135,7 @@ - "'vpc_security_groups' in _result_modify_port" - name: Modify DB cluster identifier - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present purge_tags: false @@ -192,7 +192,7 @@ when: _result_check_db_parameter_group.rc != 0 - name: Modify DB cluster parameter group - rds_cluster: + amazon.aws.rds_cluster: id: "{{ new_cluster_id }}" state: present db_cluster_parameter_group_name: "{{ new_db_parameter_group_name }}" @@ -226,7 +226,7 @@ - "'vpc_security_groups' in _result_modify_db_parameter_group_name" - name: Delete DB cluster without creating a final snapshot (CHECK MODE) - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ new_cluster_id }}" skip_final_snapshot: true @@ -238,7 +238,7 @@ - _result_delete_cluster.changed - name: Delete DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ new_cluster_id }}" skip_final_snapshot: true @@ -249,7 +249,7 @@ - _result_delete_cluster.changed - name: Delete DB cluster without creating a final snapshot (idempotence) - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ new_cluster_id }}" skip_final_snapshot: true @@ -261,7 +261,7 @@ always: - name: Delete DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ cluster_id }}" skip_final_snapshot: true diff --git a/tests/integration/targets/rds_cluster_multi_az/tasks/main.yml b/tests/integration/targets/rds_cluster_multi_az/tasks/main.yml index 8e676a590c5..6caf33e2fc0 100644 --- a/tests/integration/targets/rds_cluster_multi_az/tasks/main.yml +++ b/tests/integration/targets/rds_cluster_multi_az/tasks/main.yml @@ -10,7 +10,7 @@ block: - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: mysql @@ -25,7 +25,7 @@ ignore_errors: true - name: Create a source DB cluster (CHECK_MODE) - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present engine: mysql @@ -45,7 +45,7 @@ - _result_create_source_db_cluster.changed - name: Create a source DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present engine: mysql @@ -65,7 +65,7 @@ always: - name: Delete DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ item }}" skip_final_snapshot: true diff --git a/tests/integration/targets/rds_cluster_promote/tasks/main.yaml b/tests/integration/targets/rds_cluster_promote/tasks/main.yaml index 1e08e021563..9ea5358baf0 100644 --- a/tests/integration/targets/rds_cluster_promote/tasks/main.yaml +++ b/tests/integration/targets/rds_cluster_promote/tasks/main.yaml @@ -7,7 +7,7 @@ session_token: "{{ security_token | default(omit) }}" block: - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: "{{ engine}}" @@ -27,7 +27,7 @@ region_dest: "{{ aws_region }}" - name: Create a source DB cluster - rds_cluster: + amazon.aws.rds_cluster: cluster_id: "{{ cluster_id }}" state: present engine: "{{ engine}}" @@ -69,7 +69,7 @@ - "'vpc_security_groups' in _result_create_src_db_cluster" - name: Get info on DB cluster - rds_cluster_info: + amazon.aws.rds_cluster_info: db_cluster_identifier: "{{ cluster_id }}" register: _result_cluster_info @@ -82,7 +82,7 @@ src_db_cluster_arn: "{{ _result_cluster_info.clusters[0].db_cluster_arn}}" - name: Create a DB cluster read replica in a different region - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}-replica" state: present replication_source_identifier: "{{ src_db_cluster_arn }}" @@ -124,7 +124,7 @@ - "'vpc_security_groups' in _result_create_replica_db_cluster" - name: Test idempotence with a DB cluster read replica - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}-replica" state: present replication_source_identifier: "{{ src_db_cluster_arn }}" @@ -140,7 +140,7 @@ - not _result_create_replica_db_cluster.changed - name: Get info of existing DB cluster - rds_cluster_info: + amazon.aws.rds_cluster_info: db_cluster_identifier: "{{ cluster_id }}-replica" region: "{{ region_dest }}" register: _result_cluster_info @@ -151,7 +151,7 @@ # - _result_cluster_info.clusters | length == 0 - name: Promote the DB cluster read replica - rds_cluster: + amazon.aws.rds_cluster: cluster_id: "{{ cluster_id }}-replica" state: present promote: true @@ -163,7 +163,7 @@ - _result_promote_replica_db_cluster.changed - name: Promote the DB cluster read replica (idempotence) - rds_cluster: + amazon.aws.rds_cluster: cluster_id: "{{ cluster_id }}-replica" state: present promote: true @@ -176,7 +176,7 @@ always: - name: Remove the DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent skip_final_snapshot: true @@ -184,7 +184,7 @@ ignore_errors: true - name: Remove the DB cluster read replica - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}-replica" state: absent skip_final_snapshot: true diff --git a/tests/integration/targets/rds_cluster_restore/tasks/main.yaml b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml index cc6cb325910..d6ac528b0f8 100644 --- a/tests/integration/targets/rds_cluster_restore/tasks/main.yaml +++ b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml @@ -7,7 +7,7 @@ session_token: "{{ security_token | default(omit) }}" block: - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: "{{ engine}}" @@ -22,7 +22,7 @@ ignore_errors: true - name: Create a source DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present engine: "{{ engine}}" @@ -61,7 +61,7 @@ - "'vpc_security_groups' in _result_create_source_db_cluster" - name: Create a point in time DB cluster - rds_cluster: + amazon.aws.rds_cluster: state: present id: "{{ cluster_id }}-point-in-time" source_db_cluster_identifier: "{{ cluster_id }}" @@ -105,7 +105,7 @@ - "'vpc_security_groups' in _result_restored_db_cluster" - name: Create a point in time DB cluster (idempotence) - rds_cluster: + amazon.aws.rds_cluster: state: present id: "{{ cluster_id }}-point-in-time" source_db_cluster_identifier: "{{ cluster_id }}" @@ -124,7 +124,7 @@ - not _result_restored_db_cluster.changed - name: Take a snapshot of the DB cluster - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ cluster_id }}-snapshot" @@ -136,7 +136,7 @@ - _result_cluster_snapshot.changed - name: Restore DB cluster from source (snapshot) - rds_cluster: + amazon.aws.rds_cluster: creation_source: snapshot engine: "{{ engine }}" cluster_id: "{{ cluster_id }}-restored-snapshot" @@ -174,14 +174,14 @@ # Requires rds_export_task module always: - name: Delete the snapshot - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: db_cluster_snapshot_identifier: "{{ cluster_id }}-snapshot" state: absent register: _result_delete_snapshot ignore_errors: true - name: Delete DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ item }}" skip_final_snapshot: true diff --git a/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml b/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml index 51d8618bb5d..730d12e9184 100644 --- a/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml +++ b/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml @@ -9,7 +9,7 @@ - amazon.aws block: - name: Create a source DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present engine: "{{ engine}}" @@ -56,7 +56,7 @@ - _result_cluster_snapshot_info.cluster_snapshots | length == 0 - name: Take a snapshot of the existing DB cluster (CHECK_MODE) - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ snapshot_id }}" @@ -68,7 +68,7 @@ - _result_cluster_snapshot.changed - name: Take a snapshot of the existing DB cluster - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ snapshot_id }}" @@ -114,7 +114,7 @@ - _result_cluster_snapshot_info.cluster_snapshots[0].db_cluster_snapshot_identifier == snapshot_id - name: Get info of the existing DB cluster - rds_cluster_info: + amazon.aws.rds_cluster_info: cluster_id: "{{ cluster_id }}" register: result_cluster_info @@ -123,7 +123,7 @@ - result_cluster_info is successful - name: Create another source DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}-b" state: present engine: "{{ engine}}" @@ -160,7 +160,7 @@ - "'vpc_security_groups' in _result_create_source_db_cluster" - name: Take another snapshot of the existing DB cluster - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}-b" db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" @@ -205,7 +205,7 @@ - _result_cluster_snapshot_info.cluster_snapshots | length == 1 - name: Delete existing DB cluster snapshot (CHECK_MODE) - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: absent db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" register: _result_delete_snapshot @@ -216,7 +216,7 @@ - _result_delete_snapshot.changed - name: Delete the existing DB cluster snapshot - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: absent db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" register: _result_delete_snapshot @@ -226,7 +226,7 @@ - _result_delete_snapshot.changed - name: Get info of the existing DB cluster - rds_cluster_info: + amazon.aws.rds_cluster_info: cluster_id: "{{ cluster_id }}" register: _result_cluster_info @@ -235,7 +235,7 @@ - result_cluster_info is successful - name: Take another snapshot of the existing DB cluster and assign tags - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" @@ -276,7 +276,7 @@ - "'vpc_id' in _result_cluster_snapshot" - name: Attempt to take another snapshot of the existing DB cluster and assign tags (idempotence) - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" @@ -291,7 +291,7 @@ - not _result_cluster_snapshot.changed - name: Take another snapshot of the existing DB cluster and update tags - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" @@ -331,7 +331,7 @@ - "'vpc_id' in _result_cluster_snapshot" - name: Take another snapshot of the existing DB cluster and update tags without purge - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" @@ -372,7 +372,7 @@ - "'vpc_id' in _result_cluster_snapshot" - name: Take another snapshot of the existing DB cluster and do not specify any tag to ensure previous tags are not removed - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: present db_cluster_identifier: "{{ cluster_id }}" db_cluster_snapshot_identifier: "{{ snapshot_id }}-b" @@ -390,7 +390,7 @@ _snapshot_arn: "{{ _result_cluster_snapshot.db_cluster_snapshot_arn }}" - name: Copy a DB cluster snapshot (check mode) - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -403,7 +403,7 @@ - _result_cluster_copy_snapshot.changed - name: Copy a DB cluster snapshot - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -423,7 +423,7 @@ - _result_cluster_copy_snapshot.tags["tag_three"] == "{{ snapshot_id }}-b Three" - name: Copy a DB cluster snapshot (idempotence - check mode) - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -436,7 +436,7 @@ - not _result_cluster_copy_snapshot.changed - name: Copy a DB cluster snapshot (idempotence) - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -457,7 +457,7 @@ always: - name: Delete the existing DB cluster snapshots - rds_cluster_snapshot: + amazon.aws.rds_cluster_snapshot: state: absent db_cluster_snapshot_identifier: "{{ item }}" register: _result_delete_snapshot @@ -468,7 +468,7 @@ - "{{ snapshot_id }}-copy" - name: Delete the existing DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ item }}" skip_final_snapshot: true diff --git a/tests/integration/targets/rds_cluster_states/tasks/main.yml b/tests/integration/targets/rds_cluster_states/tasks/main.yml index f4ba42a9366..88d63183831 100644 --- a/tests/integration/targets/rds_cluster_states/tasks/main.yml +++ b/tests/integration/targets/rds_cluster_states/tasks/main.yml @@ -9,7 +9,7 @@ # ------------------------------------------------------------------------------------------ # Create DB cluster - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: "{{ engine}}" @@ -24,7 +24,7 @@ ignore_errors: true - name: Create an Aurora-PostgreSQL DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: present engine: aurora-postgresql @@ -157,7 +157,7 @@ # ------------------------------------------------------------------------------------------ # Give errors for MySql DB cluster - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ mysql_cluster_id }}" state: absent engine: "{{ mysql_engine }}" @@ -172,7 +172,7 @@ ignore_errors: true - name: Create an MySql DB cluster - rds_cluster: + amazon.aws.rds_cluster: id: "{{ mysql_cluster_id }}" state: present engine: "{{ mysql_engine }}" @@ -226,14 +226,14 @@ # ------------------------------------------------------------------------------------------ # Cleanup starts here - name: Delete MySql db cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ mysql_cluster_id }}" skip_final_snapshot: true ignore_errors: true - name: Delete Aurora-PostgreSql db cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ cluster_id }}" skip_final_snapshot: true diff --git a/tests/integration/targets/rds_cluster_tag/tasks/main.yaml b/tests/integration/targets/rds_cluster_tag/tasks/main.yaml index 1080a96c2c7..19d19f3a23a 100644 --- a/tests/integration/targets/rds_cluster_tag/tasks/main.yaml +++ b/tests/integration/targets/rds_cluster_tag/tasks/main.yaml @@ -7,7 +7,7 @@ session_token: "{{ security_token | default(omit) }}" block: - name: Ensure the resource doesn't exist - rds_cluster: + amazon.aws.rds_cluster: id: "{{ cluster_id }}" state: absent engine: "{{ engine}}" @@ -22,7 +22,7 @@ ignore_errors: true - name: Create a DB cluster - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -62,7 +62,7 @@ - "'vpc_security_groups' in _result_create_db_cluster" - name: Test tags are not purged if purge_tags is False - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ new_password }}" @@ -103,7 +103,7 @@ - "'vpc_security_groups' in _result_tag_db_cluster" - name: Add a tag and remove a tag (purge_tags is True) - rds_cluster: + amazon.aws.rds_cluster: cluster_id: "{{ cluster_id }}" state: present tags: "{{ tags_patch }}" @@ -140,7 +140,7 @@ - "'vpc_security_groups' in _result_tag_db_cluster" - name: Purge a tag from the cluster (CHECK MODE) - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -155,7 +155,7 @@ - _result_tag_db_cluster.changed - name: Purge a tag from the cluster - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -195,7 +195,7 @@ - "'vpc_security_groups' in _result_tag_db_cluster" - name: Add a tag to the cluster (CHECK MODE) - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -211,7 +211,7 @@ - _result_tag_db_cluster.changed - name: Add a tag to the cluster - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -250,7 +250,7 @@ - _result_tag_db_cluster.tags["Name"] == "{{ tags_create["Name"]}}" - "'vpc_security_groups' in _result_tag_db_cluster" - name: Remove all tags - rds_cluster: + amazon.aws.rds_cluster: engine: "{{ engine }}" username: "{{ username }}" password: "{{ password }}" @@ -288,7 +288,7 @@ - "'vpc_security_groups' in _result_tag_db_cluster" always: - name: Delete DB cluster without creating a final snapshot - rds_cluster: + amazon.aws.rds_cluster: state: absent cluster_id: "{{ cluster_id }}" skip_final_snapshot: true diff --git a/tests/integration/targets/rds_instance_aurora/tasks/main.yml b/tests/integration/targets/rds_instance_aurora/tasks/main.yml index 19481cfdc68..1398ed6990b 100644 --- a/tests/integration/targets/rds_instance_aurora/tasks/main.yml +++ b/tests/integration/targets/rds_instance_aurora/tasks/main.yml @@ -17,7 +17,7 @@ register: result - name: Create minimal aurora cluster in default VPC and default subnet group - rds_cluster: + amazon.aws.rds_cluster: state: present engine: aurora-postgresql engine_mode: provisioned @@ -111,7 +111,7 @@ ignore_errors: true - name: Delete the cluster - rds_cluster: + amazon.aws.rds_cluster: cluster_id: "{{ cluster_id }}" state: absent skip_final_snapshot: true diff --git a/tests/integration/targets/rds_instance_sgroups/tasks/main.yml b/tests/integration/targets/rds_instance_sgroups/tasks/main.yml index bdb70484e2f..75f00a1cb34 100644 --- a/tests/integration/targets/rds_instance_sgroups/tasks/main.yml +++ b/tests/integration/targets/rds_instance_sgroups/tasks/main.yml @@ -35,7 +35,7 @@ - { cidr: 10.122.122.160/28, zone: "{{ aws_region }}c" } - name: Create security groups - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ item }}" description: created by rds_instance integration tests state: present @@ -274,7 +274,7 @@ ignore_errors: true - name: Remove security groups - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ item }}" description: created by rds_instance integration tests state: absent diff --git a/tests/integration/targets/rds_instance_snapshot/tasks/main.yml b/tests/integration/targets/rds_instance_snapshot/tasks/main.yml index 07f6452be6a..1136d8c1909 100644 --- a/tests/integration/targets/rds_instance_snapshot/tasks/main.yml +++ b/tests/integration/targets/rds_instance_snapshot/tasks/main.yml @@ -39,7 +39,7 @@ - _result_instance_snapshot_info.snapshots | length == 1 - name: Take a snapshot of the existing RDS instance (CHECK_MODE) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}" @@ -51,7 +51,7 @@ - _result_instance_snapshot.changed - name: Take a snapshot of the existing RDS instance - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}" @@ -91,7 +91,7 @@ - "'vpc_id' in _result_instance_snapshot" - name: Take a snapshot of the existing RDS instance (CHECK_MODE - IDEMPOTENCE) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}" @@ -103,7 +103,7 @@ - not _result_instance_snapshot.changed - name: Take a snapshot of the existing RDS instance (IDEMPOTENCE) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}" @@ -154,7 +154,7 @@ - _result_instance_snapshot_info.snapshots[0].db_snapshot_identifier == snapshot_id - name: Take another snapshot of the existing RDS instance - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}-b" @@ -204,7 +204,7 @@ #- _result_instance_snapshot_info.cluster_snapshots | length == 3 - name: Delete existing DB instance snapshot (CHECK_MODE) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: absent db_snapshot_identifier: "{{ snapshot_id }}-b" register: _result_delete_snapshot @@ -215,7 +215,7 @@ - _result_delete_snapshot.changed - name: Delete the existing DB instance snapshot - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: absent db_snapshot_identifier: "{{ snapshot_id }}-b" register: _result_delete_snapshot @@ -225,7 +225,7 @@ - _result_delete_snapshot.changed - name: Delete existing DB instance snapshot (CHECK_MODE - IDEMPOTENCE) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: absent db_snapshot_identifier: "{{ snapshot_id }}-b" register: _result_delete_snapshot @@ -236,7 +236,7 @@ - not _result_delete_snapshot.changed - name: Delete the existing DB instance snapshot (IDEMPOTENCE) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: absent db_snapshot_identifier: "{{ snapshot_id }}-b" register: _result_delete_snapshot @@ -246,7 +246,7 @@ - not _result_delete_snapshot.changed - name: Take another snapshot of the existing RDS instance and assign tags - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}-b" @@ -292,7 +292,7 @@ - "'vpc_id' in _result_instance_snapshot" - name: Attempt to take another snapshot of the existing RDS instance and assign tags (idempotence) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}-b" @@ -307,7 +307,7 @@ - not _result_instance_snapshot.changed - name: Take another snapshot of the existing RDS instance and update tags - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}-b" @@ -352,7 +352,7 @@ - "'vpc_id' in _result_instance_snapshot" - name: Take another snapshot of the existing RDS instance and update tags without purge - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}-b" @@ -398,7 +398,7 @@ - "'vpc_id' in _result_instance_snapshot" - name: Take another snapshot of the existing RDS instance and do not specify any tag to ensure previous tags are not removed - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: present db_instance_identifier: "{{ instance_id }}" db_snapshot_identifier: "{{ snapshot_id }}-b" @@ -417,7 +417,7 @@ _snapshot_arn: "{{ _result_instance_snapshot.db_snapshot_arn }}" - name: Copy a snapshot (check mode) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -430,7 +430,7 @@ - _result_instance_snapshot.changed - name: Copy a snapshot - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -450,7 +450,7 @@ - _result_instance_snapshot.tags["tag_three"] == snapshot_id+"-b Three" - name: Copy a snapshot (idempotence - check mode) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -463,7 +463,7 @@ - not _result_instance_snapshot.changed - name: Copy a snapshot (idempotence) - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: id: "{{ snapshot_id }}-copy" source_id: "{{ snapshot_id }}-b" copy_tags: true @@ -484,7 +484,7 @@ always: - name: Delete the existing DB instance snapshots - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: state: absent db_snapshot_identifier: "{{ item }}" wait: false diff --git a/tests/integration/targets/rds_instance_snapshot_mgmt/tasks/main.yml b/tests/integration/targets/rds_instance_snapshot_mgmt/tasks/main.yml index 826882d1520..a946415e942 100644 --- a/tests/integration/targets/rds_instance_snapshot_mgmt/tasks/main.yml +++ b/tests/integration/targets/rds_instance_snapshot_mgmt/tasks/main.yml @@ -44,7 +44,7 @@ - result.tags.Created_by == 'Ansible rds_instance tests' - name: Create a snapshot - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: instance_id: "{{ instance_id }}" snapshot_id: "{{ snapshot_id }}" state: present @@ -204,7 +204,7 @@ always: - name: Remove snapshots - rds_instance_snapshot: + amazon.aws.rds_instance_snapshot: db_snapshot_identifier: "{{ item }}" state: absent wait: false diff --git a/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_bucket_key.yml b/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_bucket_key.yml index 877b0459cd6..44d7200b8e3 100644 --- a/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_bucket_key.yml +++ b/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_bucket_key.yml @@ -57,7 +57,7 @@ ## https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-encryption-faq.html ## ## - name: Disable encryption from bucket - ## s3_bucket: + ## amazon.aws.s3_bucket: ## name: "{{ local_bucket_name }}" ## encryption: none ## bucket_key_enabled: false @@ -70,7 +70,7 @@ ## - not output.encryption ## ## - name: Disable encryption from bucket (idempotent) - ## s3_bucket: + ## amazon.aws.s3_bucket: ## name: "{{ local_bucket_name }}" ## bucket_key_enabled: true ## register: output diff --git a/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_kms.yml b/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_kms.yml index d9ddb534afe..b24479c72cf 100644 --- a/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_kms.yml +++ b/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_kms.yml @@ -48,7 +48,7 @@ ## https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-encryption-faq.html ## ## - name: Disable encryption from bucket - ## s3_bucket: + ## amazon.aws.s3_bucket: ## name: '{{ local_bucket_name }}' ## state: present ## encryption: "none" @@ -60,7 +60,7 @@ ## - not output.encryption ## ## - name: Disable encryption from bucket - ## s3_bucket: + ## amazon.aws.s3_bucket: ## name: '{{ local_bucket_name }}' ## state: present ## encryption: "none" diff --git a/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_sse.yml b/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_sse.yml index b58f72ca156..88ae220350f 100644 --- a/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_sse.yml +++ b/tests/integration/targets/s3_bucket/roles/s3_bucket/tasks/encryption_sse.yml @@ -49,7 +49,7 @@ ## https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-encryption-faq.html ## ## - name: Disable encryption from bucket - ## s3_bucket: + ## amazon.aws.s3_bucket: ## name: '{{ local_bucket_name }}' ## state: present ## encryption: "none" @@ -61,7 +61,7 @@ ## - not output.encryption ## ## - name: Disable encryption from bucket - ## s3_bucket: + ## amazon.aws.s3_bucket: ## name: '{{ local_bucket_name }}' ## state: present ## encryption: "none" diff --git a/tests/integration/targets/s3_bucket_info/tasks/basic.yml b/tests/integration/targets/s3_bucket_info/tasks/basic.yml index 02ff1b46b7a..ff576225ce0 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 - s3_bucket_info: + amazon.aws.s3_bucket_info: register: bucket_list - name: Assert result.changed == False and bucket list was retrieved ansible.builtin.assert: @@ -9,7 +9,7 @@ - bucket_list.buckets - name: Get complex S3 bucket list - s3_bucket_info: + amazon.aws.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 e2e6d948b91..a60e580678f 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 - s3_bucket_info: + amazon.aws.s3_bucket_info: name_filter: "{{ name_pattern }}" bucket_facts: bucket_ownership_controls: true @@ -15,7 +15,7 @@ loop_control: label: "{{ item.name }}" - name: Get complex S3 bucket list (including ownership controls) - s3_bucket_info: + amazon.aws.s3_bucket_info: name_filter: "{{ name_pattern }}" bucket_facts: bucket_accelerate_configuration: true diff --git a/tests/integration/targets/s3_object/tasks/copy_object.yml b/tests/integration/targets/s3_object/tasks/copy_object.yml index 678b30ac5bf..e17a25ad4df 100644 --- a/tests/integration/targets/s3_object/tasks/copy_object.yml +++ b/tests/integration/targets/s3_object/tasks/copy_object.yml @@ -21,7 +21,7 @@ content: "{{ lookup('password', '/dev/null chars=ascii_letters,digits,hexdigits,punctuation') }}" - name: Put a content in the source bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.src }}" mode: put content: "{{ content }}" @@ -37,7 +37,7 @@ ignore_errors: true - name: Copy the content of the source bucket into dest bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.dst }}" mode: copy object: destination.txt @@ -52,7 +52,7 @@ ignore_errors: true - name: Get the content copied into {{ copy_bucket.dst }} - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.dst }}" mode: getstr object: destination.txt @@ -64,7 +64,7 @@ - content == copy_content.contents - name: Get the download url for object copied into {{ copy_bucket.dst }} - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.dst }}" mode: geturl object: destination.txt @@ -76,7 +76,7 @@ - put_result.tags == copy_url.tags - name: Copy the same content from the source bucket into dest bucket (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.dst }}" mode: copy object: destination.txt @@ -92,7 +92,7 @@ - copy_idempotency.msg == 'ETag from source and destination are the same' - name: Copy object with tags - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.dst }}" mode: copy object: destination.txt @@ -110,7 +110,7 @@ - copy_result.tags['ansible_release'] == '2.0.1' - name: Copy object with tags (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.dst }}" mode: copy object: destination.txt @@ -127,7 +127,7 @@ - copy_result is not changed - name: Copy from unexisting key should not succeed - s3_object: + amazon.aws.s3_object: bucket: "{{ copy_bucket.dst }}" mode: copy object: missing_key.txt diff --git a/tests/integration/targets/s3_object/tasks/copy_recursively.yml b/tests/integration/targets/s3_object/tasks/copy_recursively.yml index 747bfab99b3..99c43bf0645 100644 --- a/tests/integration/targets/s3_object/tasks/copy_recursively.yml +++ b/tests/integration/targets/s3_object/tasks/copy_recursively.yml @@ -10,7 +10,7 @@ - "{{ bucket_dst }}" - name: Create object into bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_src }}" mode: put content: "{{ item.content }}" @@ -18,7 +18,7 @@ with_items: "{{ s3_objects }}" - name: Copy all objects from source bucket into destination bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: copy copy_src: @@ -26,7 +26,7 @@ check_mode: true - name: list objects from bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: list register: _objects @@ -38,7 +38,7 @@ # Test: Copy all objects using prefix - name: copy object using prefix - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: copy copy_src: @@ -47,7 +47,7 @@ register: _copy_with_prefix - name: list objects from bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: list register: _objects @@ -63,7 +63,7 @@ # Test: Copy all objects using prefix (idempotency) - name: copy object using prefix (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: copy copy_src: @@ -72,7 +72,7 @@ register: _copy_with_prefix_idempotency - name: list objects from bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: list register: _objects @@ -88,7 +88,7 @@ # Test: Copy all objects from source bucket - name: copy all objects from source bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: copy copy_src: @@ -96,7 +96,7 @@ register: _copy_all - name: list objects from bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: list register: _objects @@ -109,7 +109,7 @@ # Test: Copy all objects from source bucket (idempotency) - name: copy all objects from source bucket (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: copy copy_src: @@ -117,7 +117,7 @@ register: _copy_all_idempotency - name: list objects from bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_dst }}" mode: list register: _objects diff --git a/tests/integration/targets/s3_object/tasks/delete_bucket.yml b/tests/integration/targets/s3_object/tasks/delete_bucket.yml index 5405ef94162..9a33c8132f3 100644 --- a/tests/integration/targets/s3_object/tasks/delete_bucket.yml +++ b/tests/integration/targets/s3_object/tasks/delete_bucket.yml @@ -2,13 +2,13 @@ - name: delete bucket at the end of Integration tests block: - name: list bucket object - s3_object_info: + amazon.aws.s3_object_info: bucket_name: "{{ item }}" register: objects ignore_errors: true - name: remove objects from bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ item }}" mode: delobj object: "{{ obj }}" diff --git a/tests/integration/targets/s3_object/tasks/main.yml b/tests/integration/targets/s3_object/tasks/main.yml index b698a2a84de..54dce2ee139 100644 --- a/tests/integration/targets/s3_object/tasks/main.yml +++ b/tests/integration/targets/s3_object/tasks/main.yml @@ -64,7 +64,7 @@ register: upload_file - name: test putting an object in the bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -139,7 +139,7 @@ - '"content_type" in info_result.object_info[0].object_data' - name: test using s3_object with async - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -156,7 +156,7 @@ retries: 30 - name: test put with overwrite=different and unmodified object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -170,7 +170,7 @@ - result is not changed - name: check that roles file lookups work as expected - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: hello.txt @@ -188,7 +188,7 @@ # 'file' lookup path or a remote path. Keeping this working is dependent on # having a redirect for both the module and the action plugin - name: check that roles file lookups work as expected when using old name - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: hello.txt @@ -204,7 +204,7 @@ - result.msg == "PUT operation complete" - name: test put with overwrite=never - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -219,7 +219,7 @@ - result is not changed - name: test put with overwrite=different and modified object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -234,7 +234,7 @@ - result is changed - name: test put with overwrite=always - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -249,7 +249,7 @@ - result is changed - name: test get object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -270,7 +270,7 @@ - upload_file.stat.checksum == download_file.stat.checksum - name: test get object (absolute path) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download-2.txt" @@ -291,7 +291,7 @@ - upload_file.stat.checksum == download_file.stat.checksum - name: test get with overwrite=different and identical files - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -310,7 +310,7 @@ src: hello.txt - name: test get with overwrite=never - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -325,7 +325,7 @@ - result is not changed - name: test get with overwrite=different and modified file - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -339,7 +339,7 @@ - result is changed - name: test get with overwrite=always - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -354,7 +354,7 @@ - result is changed - name: test get with overwrite=latest and identical files - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -371,7 +371,7 @@ - name: modify mtime for local file to past ansible.builtin.shell: touch -mt 197001010900.00 "{{ remote_tmp_dir }}/download.txt" - name: test get with overwrite=latest and files that mtimes are different - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -386,7 +386,7 @@ - result is changed - name: test geturl of the object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: geturl object: delete.txt @@ -401,7 +401,7 @@ - result is changed - name: test geturl of the object with sigv4 - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: geturl sig_v4: true @@ -417,7 +417,7 @@ - result is changed - name: test getstr of the object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: getstr object: delete.txt @@ -431,7 +431,7 @@ - result.contents == content - name: test list to get all objects in the bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: list retries: 3 @@ -444,7 +444,7 @@ - result.msg == "LIST operation complete" - name: test delobj to just delete an object in the bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: delobj object: delete.txt @@ -458,7 +458,7 @@ - result is changed - name: test putting an object in the bucket with metadata set - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -477,7 +477,7 @@ - result.msg == "PUT operation complete" - name: test delobj to just delete an object in the bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: delobj object: delete_meta.txt @@ -486,7 +486,7 @@ register: result - name: test putting an encrypted object in the bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -502,7 +502,7 @@ - result.msg == "PUT operation complete" - name: test get encrypted object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download_encrypted.txt" @@ -523,7 +523,7 @@ - upload_file.stat.checksum == download_file.stat.checksum - name: delete encrypted file - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: delobj object: delete_encrypt.txt @@ -531,7 +531,7 @@ delay: 3 - name: test putting an aws:kms encrypted object in the bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -548,7 +548,7 @@ - result.msg == "PUT operation complete" - name: test get KMS encrypted object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download_kms.txt" @@ -571,7 +571,7 @@ # FIXME - could use a test that checks uploaded file is *actually* aws:kms encrypted - name: delete KMS encrypted file - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: delobj object: delete_encrypt_kms.txt @@ -583,7 +583,7 @@ # PRs exist for that, but propose deferring until after merge. - name: test creation of empty path - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: create object: foo/bar/baz/ @@ -597,7 +597,7 @@ - result is changed - name: test deletion of empty path - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: delobj object: foo/bar/baz/ @@ -637,14 +637,14 @@ when: ansible_system == 'Linux' - name: upload the file to the bucket - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: put src: "{{ remote_tmp_dir }}/largefile" object: multipart.txt - name: download file once - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -660,7 +660,7 @@ - result is changed - name: download file again - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download.txt" @@ -674,7 +674,7 @@ # Public objects aren't allowed by default - name: fail to upload the file to the bucket with an ACL - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name_acl }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -689,7 +689,7 @@ - upload_private is failed - name: upload the file to the bucket with an ACL - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name_acl }}" mode: put src: "{{ remote_tmp_dir }}/upload.txt" @@ -703,7 +703,7 @@ - upload_owner is changed - name: create an object from static content - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -716,7 +716,7 @@ - result is changed - name: ensure idempotency on static content - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -729,7 +729,7 @@ - result is not changed - name: fetch test content - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: getstr object: put-content.txt @@ -743,7 +743,7 @@ put_template_text: test template - name: create an object from a template - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-template.txt mode: put @@ -755,7 +755,7 @@ - result is changed - name: create an object from a template (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-template.txt mode: put @@ -767,7 +767,7 @@ - result is not changed - name: fetch template content - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: getstr object: put-template.txt @@ -783,7 +783,7 @@ register: put_binary - name: create an object from binary data - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-binary.bin mode: put @@ -795,7 +795,7 @@ - result is changed - name: create an object from binary data (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-binary.bin mode: put @@ -807,7 +807,7 @@ - result is not changed - name: fetch binary content - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" mode: get dest: "{{ remote_tmp_dir }}/download_binary.bin" @@ -833,7 +833,7 @@ block: # ============================================================ - name: create an object from static content - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -853,7 +853,7 @@ - result.tags["Tag Two"] == 'two {{ resource_prefix }}' - name: ensure idempotency on static content - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -873,7 +873,7 @@ - result.tags["Tag Two"] == 'two {{ resource_prefix }}' - name: Remove a tag from an S3 object - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -892,7 +892,7 @@ - "'Tag Two' not in result.tags" - name: Remove the tag from an S3 object (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -911,7 +911,7 @@ - "'Tag Two' not in result.tags" - name: Add a tag for an S3 object with purge_tags False - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -931,7 +931,7 @@ - result.tags["tag_one"] == '{{ resource_prefix }} One' - name: Add a tag for an S3 object with purge_tags False (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -951,7 +951,7 @@ - result.tags["tag_one"] == '{{ resource_prefix }} One' - name: Update tags for an S3 object with purge_tags False - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -972,7 +972,7 @@ - result.tags["TagFour"] == '{{ resource_prefix }} tag_four' - name: Update tags for an S3 object with purge_tags False (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -993,7 +993,7 @@ - result.tags["TagFour"] == '{{ resource_prefix }} tag_four' - name: Specify empty tags for an S3 object with purge_tags False - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -1013,7 +1013,7 @@ - result.tags["TagFour"] == '{{ resource_prefix }} tag_four' - name: Do not specify any tag to ensure previous tags are not removed - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -1031,7 +1031,7 @@ - result.tags["TagFour"] == '{{ resource_prefix }} tag_four' - name: Remove all tags - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put @@ -1048,7 +1048,7 @@ - (result.tags | length) == 0 - name: Remove all tags (idempotency) - s3_object: + amazon.aws.s3_object: bucket: "{{ bucket_name }}" object: put-content.txt mode: put diff --git a/tests/integration/targets/setup_ec2_instance_env/tasks/cleanup.yml b/tests/integration/targets/setup_ec2_instance_env/tasks/cleanup.yml index 47d79407fa7..7d731015695 100644 --- a/tests/integration/targets/setup_ec2_instance_env/tasks/cleanup.yml +++ b/tests/integration/targets/setup_ec2_instance_env/tasks/cleanup.yml @@ -57,13 +57,13 @@ retries: 10 - name: (Cleanup) Find all remaining Security Groups - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: vpc-id: "{{ testing_vpc.vpc.id }}" register: security_groups - name: (Cleanup) Remove the security group rules - ec2_security_group: + amazon.aws.ec2_security_group: state: present name: "{{ item.group_name }}" description: "{{ item.description }}" @@ -77,7 +77,7 @@ retries: 10 - name: (Cleanup) Remove the security groups - ec2_security_group: + amazon.aws.ec2_security_group: state: absent group_id: "{{ item.group_id }}" loop: "{{ security_groups.security_groups }}" diff --git a/tests/integration/targets/setup_ec2_vpc/tasks/cleanup.yml b/tests/integration/targets/setup_ec2_vpc/tasks/cleanup.yml index f0e52469af8..4efd66d30b5 100644 --- a/tests/integration/targets/setup_ec2_vpc/tasks/cleanup.yml +++ b/tests/integration/targets/setup_ec2_vpc/tasks/cleanup.yml @@ -18,7 +18,7 @@ register: remaining_enis - name: (VPC Cleanup) Retrieve security group info based on VPC ID - ec2_security_group_info: + amazon.aws.ec2_security_group_info: filters: vpc-id: "{{ vpc_id }}" register: remaining_groups @@ -59,7 +59,7 @@ # Cross-dependencies between rules in the SGs can cause us problems if we don't clear the rules # first - name: (VPC Cleanup) Delete rules from remaining SGs - ec2_security_group: + amazon.aws.ec2_security_group: name: "{{ item.group_name }}" group_id: "{{ item.group_id }}" description: "{{ item.description }}" @@ -69,7 +69,7 @@ ignore_errors: true - name: (VPC Cleanup) Delete remaining SGs - ec2_security_group: + amazon.aws.ec2_security_group: state: absent group_id: "{{ item.group_id }}" loop: "{{ remaining_groups.security_groups }}"