Skip to content

Commit 89d3134

Browse files
committed
Use localhost to copy authkey since synchronize requires cross-auth
1 parent 37fb1ca commit 89d3134

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

tasks/pacemaker.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,31 @@
1818
register: __corosync_authkey_created
1919
notify: Restart corosync
2020

21-
- name: Copy authkey to other nodes
22-
synchronize: src=/etc/corosync/authkey dest=/etc/corosync/authkey
21+
- name: Generate tmpdir for authkey
22+
local_action: tempfile
23+
register: authkey_tempfile
24+
changed_when: False
25+
when: inventory_hostname != groups[pacemaker_corosync_group][0]
26+
27+
- name: Fetch authkey for other nodes
28+
fetch: src=/etc/corosync/authkey dest="{{ authkey_tempfile.path }}" flat=yes
2329
delegate_to: "{{ groups[pacemaker_corosync_group][0] }}"
30+
changed_when: False
31+
when: inventory_hostname != groups[pacemaker_corosync_group][0]
32+
33+
- name: Copy authkey to other nodes
34+
copy: src="{{ authkey_tempfile.path }}" dest=/etc/corosync/authkey mode=0400
2435
when: inventory_hostname != groups[pacemaker_corosync_group][0]
2536
notify: Restart corosync
2637

38+
- name: Clean up tmpdir
39+
local_action:
40+
module: file
41+
path: "{{ authkey_tempfile.path }}"
42+
state: "absent"
43+
changed_when: False
44+
when: inventory_hostname != groups[pacemaker_corosync_group][0]
45+
2746
- name: Chowns authkeys
2847
file:
2948
path: /etc/corosync/authkey

0 commit comments

Comments
 (0)