diff --git a/rpc_deployment/roles/rabbit_common/tasks/main.yml b/rpc_deployment/roles/rabbit_common/tasks/main.yml index 13259455a9..d17e614047 100644 --- a/rpc_deployment/roles/rabbit_common/tasks/main.yml +++ b/rpc_deployment/roles/rabbit_common/tasks/main.yml @@ -31,6 +31,16 @@ - package_install - rabbit_install +- name: Fix /etc/hosts + lineinfile: + dest: /etc/hosts + state: present + line: "{{ hostvars[item]['container_address'] }} {{ hostvars[item]['container_name'] }} {{ hostvars[item]['container_name'].split('.')[0] }}" + with_items: groups['rabbit'] + tags: + - hosts + - rabbit_config + - name: Install rabbit packages apt: pkg: "{{ item }}" @@ -43,16 +53,6 @@ - package_install - rabbit_install -- name: Fix /etc/hosts - lineinfile: - dest: /etc/hosts - state: present - line: "{{ hostvars[item]['container_address'] }} {{ hostvars[item]['container_name'] }} {{ hostvars[item]['container_name'].split('.')[0] }}" - with_items: groups['rabbit'] - tags: - - hosts - - rabbit_config - - include: restart_rabbit.yml - name: Read rabbit cookie