Fix service restart when using tags

If an adjustment to the rabbit config is made which rewrites the
config file, and the playbook is run with
--tags rabbitmq-config,rabbitmq_server-config then the new config
file will be written but the service is not restarted.

This patch adds tag inheritance to the include_tasks for service
restarts to ensure that the service is restarted if the just the
config is updated.

Change-Id: Ia4bcc7a9421d16a8bc35340e1a31a3eb15519369
This commit is contained in:
Jonathan Rosser 2021-05-05 11:15:38 +00:00
parent b9a265926f
commit fb93d2862d

View File

@ -74,8 +74,13 @@
tags: tags:
- rabbitmq-config - rabbitmq-config
- include_tasks: rabbitmq_restart.yml - include_tasks:
when: rabbit_config is changed or rabbitmq_plugin is changed or cookie_set is changed or rabbitmq_upgrade | bool file: rabbitmq_restart.yml
apply:
tags: rabbitmq-config
when: rabbit_config is changed or rabbitmq_plugin is changed or (cookie_set is defined and cookie_set is changed) or rabbitmq_upgrade | bool
tags:
- rabbitmq-config
- name: Apply rabbitmq policies - name: Apply rabbitmq policies
community.rabbitmq.rabbitmq_policy: community.rabbitmq.rabbitmq_policy:
@ -90,8 +95,13 @@
- rabbitmq-config - rabbitmq-config
- rabbitmq-cluster - rabbitmq-cluster
- include_tasks: rabbitmq_restart.yml - include_tasks:
file: rabbitmq_restart.yml
apply:
tags: rabbitmq-config
when: rabbitmq_policy is changed when: rabbitmq_policy is changed
tags:
- rabbitmq-config
# This is being done because the rabbitctl command used by the module # This is being done because the rabbitctl command used by the module
# is not very effective at returning proper status codes for failure # is not very effective at returning proper status codes for failure