Skip to content

Commit ff22ac7

Browse files
committed
Fix task delegation issues for commands role
1 parent 72c61b0 commit ff22ac7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roles/commands/tasks/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
become: true
88
changed_when: true
99
when: cephadm_commands | length > 0
10-
1110
delegate_to: "{{ groups['mons'][0] }}"
1211
run_once: true
12+
vars:
13+
# NOTE: Without this, the delegate hosts's ansible_host variable will not
14+
# be respected.
15+
ansible_host: "{{ hostvars[groups['mons'][0]].ansible_host | default(inventory_hostname) }}"

0 commit comments

Comments
 (0)