ansible-ops-management/tasks/rabbitmq/vhost.yml
2023-07-15 18:51:26 -07:00

25 lines
705 B
YAML

---
- name: Create or remove virtual hosts
delegate_to: "{{ rabbitmq_cluster_list[0] }}"
community.rabbitmq.rabbitmq_vhost:
name: "{{ item.vhost }}"
state: "{{ item.state }}"
loop: "{{ rabbitmq_vhosts }}"
tags:
- rabbitmq_cluster
- name: Manage virtual host policies
delegate_to: "{{ rabbitmq_cluster_list[0] }}"
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
...