diff --git a/tests/integration/targets/rds_cluster/inventory b/tests/integration/targets/rds_cluster/inventory deleted file mode 100644 index 1acd8642050..00000000000 --- a/tests/integration/targets/rds_cluster/inventory +++ /dev/null @@ -1,23 +0,0 @@ -[tests] -# basic rds_cluster cretion tests -create - -# restore cluster tests -restore - -# TODO: Cannot be tested in the CI because: -# An error occurred (InvalidParameterValue) when calling the CreateDBCluster operation: Replication from cluster in same region is not supported -# promote - -# security groups db tests -create_sgs - -# basic modify operations applied on the rds cluster -modify - -# tag rds cluster test -tag - -[all:vars] -ansible_connection=local -ansible_python_interpreter="{{ ansible_playbook_python }}" diff --git a/tests/integration/targets/rds_cluster/main.yml b/tests/integration/targets/rds_cluster/main.yml deleted file mode 100644 index 2674f426818..00000000000 --- a/tests/integration/targets/rds_cluster/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Beware: most of our tests here are run in parallel. -# To add new tests you'll need to add a new host to the inventory and a matching -# '{{ inventory_hostname }}'.yml file in roles/rds_cluster/tasks/ - -- hosts: all - gather_facts: no - strategy: free - serial: 6 - roles: - - rds_cluster diff --git a/tests/integration/targets/rds_cluster/meta/main.yml b/tests/integration/targets/rds_cluster/meta/main.yml deleted file mode 100644 index 32cf5dda7ed..00000000000 --- a/tests/integration/targets/rds_cluster/meta/main.yml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/meta/main.yml b/tests/integration/targets/rds_cluster/roles/rds_cluster/meta/main.yml deleted file mode 100644 index 73b314ff7c7..00000000000 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/meta/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- \ No newline at end of file diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/main.yml b/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/main.yml deleted file mode 100644 index 55f8a551e02..00000000000 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: rds_cluster integration tests - module_defaults: - group/aws: - region: '{{ aws_region }}' - aws_access_key: '{{ aws_access_key }}' - aws_secret_key: '{{ aws_secret_key }}' - security_token: '{{ security_token | default(omit) }}' - - block: - - include: ./test_{{ inventory_hostname }}.yml diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/vars/main.yml b/tests/integration/targets/rds_cluster/roles/rds_cluster/vars/main.yml deleted file mode 100644 index ed97d539c09..00000000000 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/tests/integration/targets/rds_cluster/runme.sh b/tests/integration/targets/rds_cluster/runme.sh deleted file mode 100755 index 21720b263e1..00000000000 --- a/tests/integration/targets/rds_cluster/runme.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# -# Beware: most of our tests here are run in parallel. -# To add new tests you'll need to add a new host to the inventory and a matching -# '{{ inventory_hostname }}'.yml file in roles/rds_cluster/tasks/ - - -set -eux - -export ANSIBLE_ROLES_PATH=../ - -ansible-playbook main.yml -i inventory "$@" diff --git a/tests/integration/targets/rds_cluster/aliases b/tests/integration/targets/rds_cluster_create/aliases similarity index 75% rename from tests/integration/targets/rds_cluster/aliases rename to tests/integration/targets/rds_cluster_create/aliases index 6e9f239e073..281c185522e 100644 --- a/tests/integration/targets/rds_cluster/aliases +++ b/tests/integration/targets/rds_cluster_create/aliases @@ -1,5 +1,4 @@ time=10m - cloud/aws - +rds_cluster rds_cluster_info diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/defaults/main.yml b/tests/integration/targets/rds_cluster_create/defaults/main.yml similarity index 100% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/defaults/main.yml rename to tests/integration/targets/rds_cluster_create/defaults/main.yml diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create.yml b/tests/integration/targets/rds_cluster_create/tasks/main.yaml similarity index 94% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create.yml rename to tests/integration/targets/rds_cluster_create/tasks/main.yaml index 8d49d9f5fa1..2870669dee5 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create.yml +++ b/tests/integration/targets/rds_cluster_create/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_create_sgs/aliases b/tests/integration/targets/rds_cluster_create_sgs/aliases new file mode 100644 index 00000000000..281c185522e --- /dev/null +++ b/tests/integration/targets/rds_cluster_create_sgs/aliases @@ -0,0 +1,4 @@ +time=10m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_create_sgs/defaults/main.yml b/tests/integration/targets/rds_cluster_create_sgs/defaults/main.yml new file mode 100644 index 00000000000..173425336e8 --- /dev/null +++ b/tests/integration/targets/rds_cluster_create_sgs/defaults/main.yml @@ -0,0 +1,37 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 +tags_create: + Name: ansible-test-cluster-{{ tiny_prefix }} + Created_By: Ansible_rds_cluster_integration_test + +# Modify cluster +new_cluster_id: ansible-test-cluster-{{ tiny_prefix }}-new +new_port: 1155 +new_password: test-rds_password-new +new_db_parameter_group_name: ansible-test-db-parameter-group-{{ tiny_prefix }}-new + +# Tag cluster +tags_patch: + Name: '{{ tiny_prefix }}-new' + Created_by: Ansible rds_cluster integration tests + +# Create cluster in a VPC +vpc_name: ansible-test-vpc-{{ tiny_prefix }} +vpc_cidr: 10.{{ 256 | random(seed=tiny_prefix) }}.0.0/16 +subnets: +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.1.0/24', zone: '{{ aws_region }}a'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.2.0/24', zone: '{{ aws_region }}b'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.3.0/24', zone: '{{ aws_region }}c'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.4.0/24', zone: '{{ aws_region }}d'} + +security_groups: +- '{{ tiny_prefix }}-sg-1' +- '{{ tiny_prefix }}-sg-2' +- '{{ tiny_prefix }}-sg-3' diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create_sgs.yml b/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml similarity index 97% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create_sgs.yml rename to tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml index 7f3ac5d3ea4..4896613e6ce 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_create_sgs.yml +++ b/tests/integration/targets/rds_cluster_create_sgs/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_modify/aliases b/tests/integration/targets/rds_cluster_modify/aliases new file mode 100644 index 00000000000..281c185522e --- /dev/null +++ b/tests/integration/targets/rds_cluster_modify/aliases @@ -0,0 +1,4 @@ +time=10m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_modify/defaults/main.yml b/tests/integration/targets/rds_cluster_modify/defaults/main.yml new file mode 100644 index 00000000000..173425336e8 --- /dev/null +++ b/tests/integration/targets/rds_cluster_modify/defaults/main.yml @@ -0,0 +1,37 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 +tags_create: + Name: ansible-test-cluster-{{ tiny_prefix }} + Created_By: Ansible_rds_cluster_integration_test + +# Modify cluster +new_cluster_id: ansible-test-cluster-{{ tiny_prefix }}-new +new_port: 1155 +new_password: test-rds_password-new +new_db_parameter_group_name: ansible-test-db-parameter-group-{{ tiny_prefix }}-new + +# Tag cluster +tags_patch: + Name: '{{ tiny_prefix }}-new' + Created_by: Ansible rds_cluster integration tests + +# Create cluster in a VPC +vpc_name: ansible-test-vpc-{{ tiny_prefix }} +vpc_cidr: 10.{{ 256 | random(seed=tiny_prefix) }}.0.0/16 +subnets: +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.1.0/24', zone: '{{ aws_region }}a'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.2.0/24', zone: '{{ aws_region }}b'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.3.0/24', zone: '{{ aws_region }}c'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.4.0/24', zone: '{{ aws_region }}d'} + +security_groups: +- '{{ tiny_prefix }}-sg-1' +- '{{ tiny_prefix }}-sg-2' +- '{{ tiny_prefix }}-sg-3' diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_modify.yml b/tests/integration/targets/rds_cluster_modify/tasks/main.yaml similarity index 97% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_modify.yml rename to tests/integration/targets/rds_cluster_modify/tasks/main.yaml index dc6518974ac..b1734146373 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_modify.yml +++ b/tests/integration/targets/rds_cluster_modify/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_promote/aliases b/tests/integration/targets/rds_cluster_promote/aliases new file mode 100644 index 00000000000..af9d1ba866b --- /dev/null +++ b/tests/integration/targets/rds_cluster_promote/aliases @@ -0,0 +1,7 @@ +# TODO: Cannot be tested in the CI because: +# An error occurred (InvalidParameterValue) when calling the CreateDBCluster operation: Replication from cluster in s +disabled +time=10m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_promote/defaults/main.yml b/tests/integration/targets/rds_cluster_promote/defaults/main.yml new file mode 100644 index 00000000000..173425336e8 --- /dev/null +++ b/tests/integration/targets/rds_cluster_promote/defaults/main.yml @@ -0,0 +1,37 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 +tags_create: + Name: ansible-test-cluster-{{ tiny_prefix }} + Created_By: Ansible_rds_cluster_integration_test + +# Modify cluster +new_cluster_id: ansible-test-cluster-{{ tiny_prefix }}-new +new_port: 1155 +new_password: test-rds_password-new +new_db_parameter_group_name: ansible-test-db-parameter-group-{{ tiny_prefix }}-new + +# Tag cluster +tags_patch: + Name: '{{ tiny_prefix }}-new' + Created_by: Ansible rds_cluster integration tests + +# Create cluster in a VPC +vpc_name: ansible-test-vpc-{{ tiny_prefix }} +vpc_cidr: 10.{{ 256 | random(seed=tiny_prefix) }}.0.0/16 +subnets: +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.1.0/24', zone: '{{ aws_region }}a'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.2.0/24', zone: '{{ aws_region }}b'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.3.0/24', zone: '{{ aws_region }}c'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.4.0/24', zone: '{{ aws_region }}d'} + +security_groups: +- '{{ tiny_prefix }}-sg-1' +- '{{ tiny_prefix }}-sg-2' +- '{{ tiny_prefix }}-sg-3' diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_promote.yml b/tests/integration/targets/rds_cluster_promote/tasks/main.yaml similarity index 96% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_promote.yml rename to tests/integration/targets/rds_cluster_promote/tasks/main.yaml index f43f41fad18..fb9c7ff9b1e 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_promote.yml +++ b/tests/integration/targets/rds_cluster_promote/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_restore/aliases b/tests/integration/targets/rds_cluster_restore/aliases new file mode 100644 index 00000000000..281c185522e --- /dev/null +++ b/tests/integration/targets/rds_cluster_restore/aliases @@ -0,0 +1,4 @@ +time=10m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_restore/defaults/main.yml b/tests/integration/targets/rds_cluster_restore/defaults/main.yml new file mode 100644 index 00000000000..173425336e8 --- /dev/null +++ b/tests/integration/targets/rds_cluster_restore/defaults/main.yml @@ -0,0 +1,37 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 +tags_create: + Name: ansible-test-cluster-{{ tiny_prefix }} + Created_By: Ansible_rds_cluster_integration_test + +# Modify cluster +new_cluster_id: ansible-test-cluster-{{ tiny_prefix }}-new +new_port: 1155 +new_password: test-rds_password-new +new_db_parameter_group_name: ansible-test-db-parameter-group-{{ tiny_prefix }}-new + +# Tag cluster +tags_patch: + Name: '{{ tiny_prefix }}-new' + Created_by: Ansible rds_cluster integration tests + +# Create cluster in a VPC +vpc_name: ansible-test-vpc-{{ tiny_prefix }} +vpc_cidr: 10.{{ 256 | random(seed=tiny_prefix) }}.0.0/16 +subnets: +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.1.0/24', zone: '{{ aws_region }}a'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.2.0/24', zone: '{{ aws_region }}b'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.3.0/24', zone: '{{ aws_region }}c'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.4.0/24', zone: '{{ aws_region }}d'} + +security_groups: +- '{{ tiny_prefix }}-sg-1' +- '{{ tiny_prefix }}-sg-2' +- '{{ tiny_prefix }}-sg-3' diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_restore.yml b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml similarity index 97% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_restore.yml rename to tests/integration/targets/rds_cluster_restore/tasks/main.yaml index 8240cda579d..8af3035210b 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_restore.yml +++ b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}' diff --git a/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml b/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml index a60469fe8aa..c29c54a6b59 100644 --- a/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml +++ b/tests/integration/targets/rds_cluster_snapshot/tasks/main.yml @@ -7,7 +7,6 @@ security_token: "{{ security_token | default(omit) }}" collections: - amazon.aws - block: - name: Create a source DB cluster rds_cluster: diff --git a/tests/integration/targets/rds_cluster_tag/aliases b/tests/integration/targets/rds_cluster_tag/aliases new file mode 100644 index 00000000000..281c185522e --- /dev/null +++ b/tests/integration/targets/rds_cluster_tag/aliases @@ -0,0 +1,4 @@ +time=10m +cloud/aws +rds_cluster +rds_cluster_info diff --git a/tests/integration/targets/rds_cluster_tag/defaults/main.yml b/tests/integration/targets/rds_cluster_tag/defaults/main.yml new file mode 100644 index 00000000000..173425336e8 --- /dev/null +++ b/tests/integration/targets/rds_cluster_tag/defaults/main.yml @@ -0,0 +1,37 @@ +# defaults file for rds_cluster + +# Create cluster +cluster_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +username: testrdsusername +password: test-rds_password +engine: aurora +port: 3306 +tags_create: + Name: ansible-test-cluster-{{ tiny_prefix }} + Created_By: Ansible_rds_cluster_integration_test + +# Modify cluster +new_cluster_id: ansible-test-cluster-{{ tiny_prefix }}-new +new_port: 1155 +new_password: test-rds_password-new +new_db_parameter_group_name: ansible-test-db-parameter-group-{{ tiny_prefix }}-new + +# Tag cluster +tags_patch: + Name: '{{ tiny_prefix }}-new' + Created_by: Ansible rds_cluster integration tests + +# Create cluster in a VPC +vpc_name: ansible-test-vpc-{{ tiny_prefix }} +vpc_cidr: 10.{{ 256 | random(seed=tiny_prefix) }}.0.0/16 +subnets: +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.1.0/24', zone: '{{ aws_region }}a'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.2.0/24', zone: '{{ aws_region }}b'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.3.0/24', zone: '{{ aws_region }}c'} +- {cidr: '10.{{ 256 | random(seed=tiny_prefix) }}.4.0/24', zone: '{{ aws_region }}d'} + +security_groups: +- '{{ tiny_prefix }}-sg-1' +- '{{ tiny_prefix }}-sg-2' +- '{{ tiny_prefix }}-sg-3' diff --git a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_tag.yml b/tests/integration/targets/rds_cluster_tag/tasks/main.yaml similarity index 98% rename from tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_tag.yml rename to tests/integration/targets/rds_cluster_tag/tasks/main.yaml index e2130fa891e..d03b7032bd4 100644 --- a/tests/integration/targets/rds_cluster/roles/rds_cluster/tasks/test_tag.yml +++ b/tests/integration/targets/rds_cluster_tag/tasks/main.yaml @@ -1,4 +1,10 @@ -- block: +- module_defaults: + group/aws: + region: '{{ aws_region }}' + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + block: - name: Ensure the resource doesn't exist rds_cluster: id: '{{ cluster_id }}'