From a13ed77cae697edca637dc4b99b9bce38aa4ba10 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 21 Sep 2020 15:17:09 +0100 Subject: [PATCH] Set broker_state when enabling plugins with ansible 2.10 Test enabling plugins when broker is not running, see [1]. [1] https://github.com/ansible-collections/community.rabbitmq/commit/da644207923089bb504c888162d39bd33f91d09b Change-Id: Id1cb84220fc587aa4cde87b75346742a59e59805 --- tasks/rabbitmq_post_install.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tasks/rabbitmq_post_install.yml b/tasks/rabbitmq_post_install.yml index 45da1685..a8c94f7f 100644 --- a/tasks/rabbitmq_post_install.yml +++ b/tasks/rabbitmq_post_install.yml @@ -64,7 +64,18 @@ # don't trigger ANSIBLE0016 - skip_ansible_lint -- name: Configure rabbitmq plugins +- name: Configure rabbitmq plugins (ansible 2.10.x with rabbitmq collection) + rabbitmq_plugin: + names: "{{ item.name }}" + state: "{{ item.state }}" + broker_state: offline + with_items: "{{ rabbitmq_plugins }}" + register: rabbitmq_plugin + tags: + - rabbitmq-config + when: ansible_version.full is version('2.10', '>') + +- name: Configure rabbitmq plugins (ansible 2.9.x) rabbitmq_plugin: names: "{{ item.name }}" state: "{{ item.state }}" @@ -72,6 +83,7 @@ register: rabbitmq_plugin tags: - rabbitmq-config + when: ansible_version.full is version('2.10', '<') - include_tasks: rabbitmq_restart.yml when: rabbit_config is changed or rabbitmq_plugin is changed or cookie_set is changed or rabbitmq_upgrade | bool