diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/main.yml index b910c58be3..f117f7c5f0 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/main.yml @@ -10,6 +10,13 @@ - specification.cluster.is_clustered | bool - inventory_hostname == rabbitmq_master +- name: Set erlang_cookie fact for nodes + when: + - specification.cluster.is_clustered | bool + - inventory_hostname != rabbitmq_master + set_fact: + erlang_cookie: "{{ hostvars[rabbitmq_master]['erlang_cookie'] }}" + # Cookie is updated on master in previous step - include_tasks: "update-erlang-cookie.yml" when: diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/set-erlang-cookie.yml b/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/set-erlang-cookie.yml index e63c15efed..4df1cd77c5 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/set-erlang-cookie.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/rabbitmq/tasks/set-erlang-cookie.yml @@ -38,9 +38,6 @@ when: not cookie_file_stat.stat.exists set_fact: erlang_cookie: "{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}" - delegate_to: "{{ item }}" - delegate_facts: true - loop: "{{ ansible_play_hosts }}" # Cookie must be applied on master first - include_tasks: "update-erlang-cookie.yml" diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/rabbitmq.yml b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/rabbitmq.yml index 3420febf3f..5b7214800e 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/rabbitmq.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/rabbitmq.yml @@ -1,8 +1,4 @@ --- -- name: RabbitMQ | Set rabbitmq_master fact - set_fact: - rabbitmq_master: "{{ groups['rabbitmq'][0] }}" - - name: RabbitMQ | Check version command: rabbitmqctl version register: rabbitmq_version_current @@ -12,6 +8,10 @@ include_vars: file: roles/rabbitmq/defaults/main.yml +- name: RabbitMQ | Set rabbitmq_master fact + set_fact: + rabbitmq_master: "{{ groups['rabbitmq'][0] }}" + - name: RabbitMQ | Offline upgrade when: rabbitmq_version_current.stdout != versions.general block: diff --git a/core/src/epicli/data/common/defaults/configuration/rabbitmq.yml b/core/src/epicli/data/common/defaults/configuration/rabbitmq.yml index 65b9a456a4..ddacc0ac4e 100644 --- a/core/src/epicli/data/common/defaults/configuration/rabbitmq.yml +++ b/core/src/epicli/data/common/defaults/configuration/rabbitmq.yml @@ -11,7 +11,7 @@ specification: ulimit_open_files: 65535 amqp_port: 5672 - rabbitmq_use_longname: true + rabbitmq_use_longname: false rabbitmq_policies: [] rabbitmq_plugins: [] custom_configurations: []