Hi,

i have to understand "synchronize" module with "delegate_to"
i am installing corosync on 2 nodes

here infos:

[corosync]
node_a ansible_host=192.168.122.200
node_b ansible_host=192.168.122.201

playbook.yml

- name: Generates corosync key
  command: corosync-keygen
  args:
    creates: /etc/corosync/authkey
  when: inventory_hostname == groups[corosync][0]

- name: Copy authkey to other nodes ###task stop here###
  synchronize: src=/etc/corosync/authkey dest=/etc/corosync/authkey
  delegate_to: "{{ groups[corosync][0] }}"
  when: inventory_hostname != groups[corosync][0]

is this the best way to use delegate_to ?
thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b37fc7aa-2b9f-4ddf-a39b-fa99dd72d574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to