diff --git a/defaults/main.yml b/defaults/main.yml index b40e6b8..b8764da 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -41,3 +41,5 @@ rabbitmq_plugins: # Enable the public pubsub or not rabbitmq_enable_public: false #pubsub_federation_pass: ... + +rabbitmq_mbs_password: "ThisIsNotThePassword!" diff --git a/tasks/runners/mkqueue.yml b/tasks/runners/mkqueue.yml index bed2eef..8080d13 100644 --- a/tasks/runners/mkqueue.yml +++ b/tasks/runners/mkqueue.yml @@ -19,7 +19,7 @@ vhost: "{{ vhost|default('/pubsub') }}" auto_delete: false durable: true - message_ttl: "{{ message_ttl|default(omit)) }}" + message_ttl: "{{ message_ttl|default(omit) }}" state: present login_user: rockyadmin login_password: "{{ rabbitmq_admin_password }}" diff --git a/tasks/users.yml b/tasks/users.yml index 2cb5838..5b869ff 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -59,3 +59,18 @@ - "'rabbitmq001' in inventory_hostname" - rabbitmq_monitoring_username is defined - rabbitmq_monitoring_password is defined + +# Add MBS +- name: Create MBS User + community.rabbitmq.rabbitmq_user: + user: "mbs" + password: "{{ rabbitmq_mbs_password }}" + update_password: always + vhost: /mbs + configure_priv: "^$" + read_priv: "^$" + write_priv: "^$" + when: + - "'rabbitmq001' in inventory_hostname" + - rabbitmq_monitoring_username is defined + - rabbitmq_monitoring_password is defined diff --git a/tasks/vhosts.yml b/tasks/vhosts.yml index cf3f5bd..69b5f8c 100644 --- a/tasks/vhosts.yml +++ b/tasks/vhosts.yml @@ -58,3 +58,27 @@ vhost: /public_pubsub tags: - rabbitmq_cluster + +- name: Configure MBS vhost + run_once: true + delegate_to: "{{ rabbitmq_cluster_list[0] }}" + community.rabbitmq.rabbitmq_vhost: + name: /mbs + state: present + tags: + - rabbitmq_cluster + +- name: Configure MBS HA Policy + run_once: true + delegate_to: "{{ rabbitmq_cluster_list[0] }}" + community.rabbitmq.rabbitmq_policy: + apply_to: queues + name: HA + pattern: ".*" + tags: + ha-mode: all + ha-sync-mode: automatic + ha-sync-batch-size: 10000 + vhost: /mbs + tags: + - rabbitmq_cluster