]> git.immae.eu Git - github/fretlink/ansible-rabbitmq.git/commitdiff
Updated example playbook as part of code cleanup #10
authorLarry Smith Jr <mrlesmithjr@gmail.com>
Sun, 21 May 2017 01:18:56 +0000 (21:18 -0400)
committerLarry Smith Jr <mrlesmithjr@gmail.com>
Sun, 21 May 2017 01:18:56 +0000 (21:18 -0400)
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
playbook.yml

index 19683208be372d68d5a782f98238640e3acd345e..4936577fd3dda6cc5056319cfd0eb718828b9261 100644 (file)
@@ -1,25 +1,12 @@
 ---
-- hosts: all
-  become: true
+- hosts: rabbitmq_cluster
   vars:
-    pri_domain_name: 'test.vagrant.local'
-  roles:
-  tasks:
-    - name: updating /etc/hosts
-      lineinfile:
-        dest: /etc/hosts
-        regexp: "^{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}"
-        line: "{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}"
-        state: present
-      with_items: "{{ groups['all'] }}"
-
-- hosts: all
-  become: true
-  vars:
-    pri_domain_name: 'test.vagrant.local'
-    rabbitmq_config_ha: true
+    etc_hosts_add_all_hosts: true
+    etc_hosts_pri_dns_name: '{{ pri_domain_name }}'
+    pri_domain_name: 'vagrant.local'
     rabbitmq_enable_clustering: true
-    rabbitmq_master: 'node0'
+    rabbitmq_master: "{{ groups['rabbitmq_cluster'][0] }}"
   roles:
+    - role: ansible-etc-hosts
     - role: ansible-rabbitmq
   tasks: