Fix tags usage

With include_tasks we got tags behaviour broken since they need to
be specifically applied and "always" tag should be assigned for include
itself for tags inside include to work properly.

Change-Id: If912a2fe2ca5358dd680fec85ef16823c46713bb
This commit is contained in:
Dmitriy Rabotyagov 2021-11-30 21:04:04 +02:00
parent 52e3978312
commit e6ef36449b
5 changed files with 41 additions and 10 deletions

View File

@ -24,13 +24,20 @@
tags:
- always
- include_tasks: rabbitmq_pre_install.yml
- import_tasks: rabbitmq_pre_install.yml
tags:
- rabbitmq_server-install
# The install process will be skipped if `rabbitmq_ignore_version_state=true`
- include_tasks: rabbitmq_install.yml
when: not rabbitmq_ignore_version_state | bool
args:
apply:
tags:
- rabbitmq_server-install
- rabbitmq-install
tags:
- always
- name: Create and install SSL certificates
include_role:
@ -48,16 +55,17 @@
pki_certificates: "{{ rabbitmq_pki_certificates }}"
pki_install_certificates: "{{ rabbitmq_pki_install_certificates }}"
- include_tasks: rabbitmq_set_cookie.yml
- import_tasks: rabbitmq_set_cookie.yml
tags:
- rabbitmq_server-config
- rabbitmq-config
- include_tasks: rabbitmq_post_install.yml
- import_tasks: rabbitmq_post_install.yml
tags:
- rabbitmq_server-config
- rabbitmq-config
- include_tasks: rabbitmq_cluster.yml
- import_tasks: rabbitmq_cluster.yml
tags:
- rabbitmq_server-config
- rabbitmq-cluster

View File

@ -13,13 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include_tasks: rabbitmq_upgrade_check.yml
- import_tasks: rabbitmq_upgrade_check.yml
- include_tasks: "install_{{ ansible_facts['pkg_mgr'] }}.yml"
args:
apply:
tags:
- rabbitmq-apt-packages
- rabbitmq-dnf-packages
- rabbitmq_server-install
tags:
- rabbitmq-apt-packages
- rabbitmq-dnf-packages
- rabbitmq_server-install
- always
- name: Reload the systemd daemon
systemd:

View File

@ -80,7 +80,7 @@
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
- always
- name: Apply rabbitmq policies
community.rabbitmq.rabbitmq_policy:
@ -101,7 +101,7 @@
tags: rabbitmq-config
when: rabbitmq_policy is changed
tags:
- rabbitmq-config
- always
# This is being done because the rabbitctl command used by the module
# is not very effective at returning proper status codes for failure

View File

@ -14,7 +14,20 @@
# limitations under the License.
- include_tasks: rabbitmq_stopped.yml
args:
apply:
tags:
- rabbitmq-restart
tags:
- always
- include_tasks: rabbitmq_started.yml
args:
apply:
tags:
- rabbitmq-restart
tags:
- always
- name: Wait for rabbitmq to be started
wait_for:

View File

@ -70,4 +70,10 @@
- rabbitmq-apt-packages
- include_tasks: rabbitmq_upgrade_prep.yml
args:
apply:
tags:
- rabbitmq-upgrade
when: rabbitmq_upgrade | bool
tags:
- always