delegate to first in list
This commit is contained in:
parent
ede3065837
commit
818d64787a
@ -58,9 +58,10 @@
|
|||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: restart_rabbitmq
|
- name: restart_rabbitmq
|
||||||
ansible.builtin.service:
|
ansible.builtin.systemd:
|
||||||
name: rabbitmq-server
|
name: rabbitmq-server
|
||||||
state: restarted
|
state: restarted
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
- name: enable_crb
|
- name: enable_crb
|
||||||
ansible.builtin.shell: "set -o pipefail && /usr/bin/crb enable"
|
ansible.builtin.shell: "set -o pipefail && /usr/bin/crb enable"
|
||||||
|
@ -25,9 +25,6 @@ roles:
|
|||||||
- name: rockylinux.kojid
|
- name: rockylinux.kojid
|
||||||
src: https://github.com/rocky-linux/ansible-role-kojid
|
src: https://github.com/rocky-linux/ansible-role-kojid
|
||||||
version: main
|
version: main
|
||||||
- name: rockylinux.rabbitmq
|
|
||||||
src: https://github.com/rocky-linux/ansible-role-rabbitmq
|
|
||||||
version: main
|
|
||||||
- name: rockylinux.sigul
|
- name: rockylinux.sigul
|
||||||
src: https://github.com/rocky-linux/ansible-role-sigul
|
src: https://github.com/rocky-linux/ansible-role-sigul
|
||||||
version: main
|
version: main
|
||||||
|
@ -50,6 +50,8 @@
|
|||||||
content: |
|
content: |
|
||||||
[Service]
|
[Service]
|
||||||
LimitNOFILE={{ rabbitmq_file_limit }}
|
LimitNOFILE={{ rabbitmq_file_limit }}
|
||||||
|
notify:
|
||||||
|
- restart_rabbitmq
|
||||||
|
|
||||||
# We are doing it the command line way
|
# We are doing it the command line way
|
||||||
- name: Enable RabbitMQ Plugins
|
- name: Enable RabbitMQ Plugins
|
||||||
@ -83,6 +85,13 @@
|
|||||||
immediate: true
|
immediate: true
|
||||||
loop: "{{ rabbitmq_ports }}"
|
loop: "{{ rabbitmq_ports }}"
|
||||||
|
|
||||||
|
- name: Ensure RabbitMQ is running
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: rabbitmq-server
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
- name: Non-master nodes should wait for 001 to be up first
|
- name: Non-master nodes should wait for 001 to be up first
|
||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: "{{ rabbitmq_cluster_list[0] }}"
|
host: "{{ rabbitmq_cluster_list[0] }}"
|
||||||
@ -90,13 +99,7 @@
|
|||||||
delay: '15'
|
delay: '15'
|
||||||
connect_timeout: '10'
|
connect_timeout: '10'
|
||||||
state: started
|
state: started
|
||||||
when: "'rabbitmq001' not in inventory_hostname"
|
when: rabbitmq_cluster_list[0] not in inventory_hostname
|
||||||
|
|
||||||
- name: Ensure RabbitMQ is running
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: rabbitmq-server
|
|
||||||
state: started
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
- name: Drop the admin password in a file if available
|
- name: Drop the admin password in a file if available
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
vhost: "{{ item.vhost }}"
|
vhost: "{{ item.vhost }}"
|
||||||
tags: "{{ item.tags | default(omit) }}"
|
tags: "{{ item.tags | default(omit) }}"
|
||||||
loop: "{{ rabbitmq_users }}"
|
loop: "{{ rabbitmq_users }}"
|
||||||
when: item.vhost is defined
|
when:
|
||||||
|
- item.vhost is defined
|
||||||
|
- rabbitmq_cluster_list[0] in inventory_hostname
|
||||||
|
|
||||||
- name: Add and configure multi vhost users
|
- name: Add and configure multi vhost users
|
||||||
community.rabbitmq.rabbitmq_user:
|
community.rabbitmq.rabbitmq_user:
|
||||||
@ -25,10 +27,11 @@
|
|||||||
password: "{{ item.password | default(omit) }}"
|
password: "{{ item.password | default(omit) }}"
|
||||||
update_password: "{{ item.update_password | default(omit) }}"
|
update_password: "{{ item.update_password | default(omit) }}"
|
||||||
topic_permissions: "{{ item.topic_permissions | default(omit) }}"
|
topic_permissions: "{{ item.topic_permissions | default(omit) }}"
|
||||||
permissions: "{{ item.permissions }}"
|
permissions: "{{ item.permissions | default([]) }}"
|
||||||
tags: "{{ item.tags | default(omit) }}"
|
tags: "{{ item.tags | default(omit) }}"
|
||||||
loop: "{{ rabbitmq_users }}"
|
loop: "{{ rabbitmq_users }}"
|
||||||
when:
|
when:
|
||||||
- item.vhost is not defined
|
- item.vhost is not defined
|
||||||
- item.permissions is defined
|
- item.permissions is defined
|
||||||
|
- rabbitmq_cluster_list[0] in inventory_hostname
|
||||||
...
|
...
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Create virtual hosts
|
- name: Create or remove virtual hosts
|
||||||
|
delegate_to: "{{ rabbitmq_cluster_list[0] }}"
|
||||||
community.rabbitmq.rabbitmq_vhost:
|
community.rabbitmq.rabbitmq_vhost:
|
||||||
name: "{{ item.vhost }}"
|
name: "{{ item.vhost }}"
|
||||||
state: "{{ item.state }}"
|
state: "{{ item.state }}"
|
||||||
@ -8,6 +9,7 @@
|
|||||||
- rabbitmq_cluster
|
- rabbitmq_cluster
|
||||||
|
|
||||||
- name: Manage virtual host policies
|
- name: Manage virtual host policies
|
||||||
|
delegate_to: "{{ rabbitmq_cluster_list[0] }}"
|
||||||
community.rabbitmq.rabbitmq_policy:
|
community.rabbitmq.rabbitmq_policy:
|
||||||
name: "{{ item.1.name }}"
|
name: "{{ item.1.name }}"
|
||||||
apply_to: "{{ item.1.apply_to }}"
|
apply_to: "{{ item.1.apply_to }}"
|
||||||
|
@ -53,4 +53,15 @@ rabbitmq_ports:
|
|||||||
- 15672/tcp
|
- 15672/tcp
|
||||||
- 25672/tcp
|
- 25672/tcp
|
||||||
- 35672-35682/tcp
|
- 35672-35682/tcp
|
||||||
|
|
||||||
|
# Rabbitmq plugins
|
||||||
|
rabbitmq_plugins:
|
||||||
|
- rabbitmq_amqp1_0
|
||||||
|
- rabbitmq_auth_backend_ldap
|
||||||
|
- rabbitmq_auth_mechanism_ssl
|
||||||
|
- rabbitmq_management
|
||||||
|
- rabbitmq_mqtt
|
||||||
|
- rabbitmq_federation
|
||||||
|
- rabbitmq_federation_management
|
||||||
|
- rabbitmq_peer_discovery_common
|
||||||
...
|
...
|
||||||
|
Loading…
Reference in New Issue
Block a user