From 5900cd23e820b74f3105e06894a0e0615d442575 Mon Sep 17 00:00:00 2001 From: Ali AlKhalidi Date: Wed, 12 Jul 2023 11:36:43 +0300 Subject: [PATCH] fix: mq_broker creation with tags; closes #1832 Signed-off-by: Ali AlKhalidi --- changelogs/fragments/1832-mq_broker_tags.yml | 2 ++ plugins/modules/mq_broker.py | 1 + tests/integration/targets/mq/defaults/main.yml | 2 ++ tests/integration/targets/mq/tasks/broker_tests.yml | 2 ++ tests/integration/targets/mq/tasks/main.yml | 2 +- 5 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/1832-mq_broker_tags.yml diff --git a/changelogs/fragments/1832-mq_broker_tags.yml b/changelogs/fragments/1832-mq_broker_tags.yml new file mode 100644 index 00000000000..b2320dd3c71 --- /dev/null +++ b/changelogs/fragments/1832-mq_broker_tags.yml @@ -0,0 +1,2 @@ +bugfixes: + - mq_broker - ensure broker is created with ``tags`` when passed (https://github.com/ansible-collections/community.aws/issues/1832). \ No newline at end of file diff --git a/plugins/modules/mq_broker.py b/plugins/modules/mq_broker.py index 5fda006b8b0..0453a43b6d0 100644 --- a/plugins/modules/mq_broker.py +++ b/plugins/modules/mq_broker.py @@ -237,6 +237,7 @@ "storage_type": "StorageType", "subnet_ids": "SubnetIds", "users": "Users", + "tags": "Tags", } diff --git a/tests/integration/targets/mq/defaults/main.yml b/tests/integration/targets/mq/defaults/main.yml index 896ba8afa7d..2199c2f637f 100644 --- a/tests/integration/targets/mq/defaults/main.yml +++ b/tests/integration/targets/mq/defaults/main.yml @@ -5,3 +5,5 @@ vpc_name: "{{ resource_prefix }}-vpc" vpc_cidr: "10.0.0.0/16" subnet_cidr: "10.0.1.0/24" sg_name: "{{resource_prefix}}-sg" +tags: + workload_type: other \ No newline at end of file diff --git a/tests/integration/targets/mq/tasks/broker_tests.yml b/tests/integration/targets/mq/tasks/broker_tests.yml index 958b80cb205..d4d399da7c1 100644 --- a/tests/integration/targets/mq/tasks/broker_tests.yml +++ b/tests/integration/targets/mq/tasks/broker_tests.yml @@ -3,6 +3,7 @@ broker_name: "{{ broker_name }}" security_groups: "{{ broker_sg_ids.split(',') }}" subnet_ids: "{{ broker_subnet_ids.split(',') }}" + tags: "{{ tags }}" register: result - set_fact: broker_id: "{{ result.broker['broker_id'] }}" @@ -20,6 +21,7 @@ - result_c1.broker['broker_name'] == broker_name - result_c1.broker['broker_state'] == 'CREATION_IN_PROGRESS' - ( result_c1.broker['storage_type'] | upper ) == 'EFS' + - result_c1.broker['tags'] == tags when: not ansible_check_mode - debug: msg: "Wait until broker {{ broker_name }} ({{ broker_id }}) enters running state. This may take several minutes" diff --git a/tests/integration/targets/mq/tasks/main.yml b/tests/integration/targets/mq/tasks/main.yml index 59b772b44e0..b206ab87082 100644 --- a/tests/integration/targets/mq/tasks/main.yml +++ b/tests/integration/targets/mq/tasks/main.yml @@ -32,4 +32,4 @@ - name: cleanup broker include_tasks: broker_cleanup.yml - - include_tasks: env_cleanup.yml \ No newline at end of file + - include_tasks: env_cleanup.yml