Synchronize from one host to anothers

16 views
Skip to first unread message

Daniel Dębny

unread,
Jun 19, 2017, 11:35:29 AM6/19/17
to Ansible Project
Hi!

I try run command "corosync-keygen -l creates=/etc/corosync/authkey" and send this key to all of my servers but I stil have problem with it. Can You help me?
Just it looks like that and doesnt work:

- name: Generate corosync key
  shell: corosync-keygen -l creates=/etc/corosync/authkey
  run_once: true
  notify:
    - restart_corosync
    - ha_authkey_warning

- name: Synchronizacja
  synchronize: src=etc/corosync/authkey dest=/etc/corosync/authkey
  delegate_to: 192.168.10.186

- name: Generate corosync configuration
  template: src=corosync.conf.j2 dest=/etc/corosync/corosync.conf force={{ corosync.force_update }}
  notify: restart_corosync



J Hawkesworth

unread,
Jun 20, 2017, 1:14:18 AM6/20/17
to Ansible Project

It looks like you are missing a / in the src= part of your synchronize action, here:


- name: Synchronizacja
  synchronize: src=etc/corosync/authkey dest=/etc/corosync/authkey
  delegate_to: 192.168.10.186

instead try

- name: Synchronizacja
  synchronize: src=/etc/corosync/authkey dest=/etc/corosync/authkey
  delegate_to: 192.168.10.186

You might find it easier to use 'yaml style' module parameters like this

- name: Synchronizacja
  synchronize:
     src: /etc/corosync/authkey
     dest: /etc/corosync/authkey
  delegate_to: 192.168.10.186

Personally I find this easier to read than the key=value key=value style.

Hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages