ansible-ops-management/tasks/rabbitmq/vhost.yml
2023-07-15 00:10:52 -07:00

23 lines
599 B
YAML

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