ansible-ops-management/tasks/rabbitmq/vhost.yml

25 lines
705 B
YAML
Raw Normal View History

2023-07-15 07:10:52 +00:00
---
2023-07-16 01:51:26 +00:00
- name: Create or remove virtual hosts
delegate_to: "{{ rabbitmq_cluster_list[0] }}"
2023-07-15 07:10:52 +00:00
community.rabbitmq.rabbitmq_vhost:
name: "{{ item.vhost }}"
state: "{{ item.state }}"
loop: "{{ rabbitmq_vhosts }}"
tags:
- rabbitmq_cluster
- name: Manage virtual host policies
2023-07-16 01:51:26 +00:00
delegate_to: "{{ rabbitmq_cluster_list[0] }}"
2023-07-15 07:10:52 +00:00
community.rabbitmq.rabbitmq_policy:
name: "{{ item.1.name }}"
apply_to: "{{ item.1.apply_to }}"
pattern: "{{ item.1.pattern }}"
tags: "{{ item.1.tags }}"
vhost: "{{ item.0.vhost }}"
state: present
loop: "{{ rabbitmq_vhosts | subelements('policy', 'skip_missing=True') }}"
when: item.0.state == 'present'
tags:
- rabbitmq_cluster
...