Skip to content

Commit a5e1070

Browse files
authored
Merge pull request #98 from stackhpc/delegate-fix
Fix delegation issue
2 parents 333c04f + 6d407c1 commit a5e1070

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

roles/cephadm/tasks/osds.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
# We need to register this as a variable, otherwise it will not be interpreted
3+
# correctly when setting ansible_host in the next task.
4+
- name: Set a fact about the Ansible host
5+
set_fact:
6+
mon_ansible_host: "{{ hostvars[inventory_hostname].ansible_host }}"
27

38
- name: Add OSDs individually
49
command:
@@ -14,4 +19,4 @@
1419
vars:
1520
# NOTE: Without this, the delegate hosts's ansible_host variable will not
1621
# be respected.
17-
ansible_host: "{{ hostvars[inventory_hostname].ansible_host if 'mons' in group_names else hostvars[groups['mons'][0]].ansible_host }}"
22+
ansible_host: "{{ mon_ansible_host if 'mons' in group_names else hostvars[groups['mons'][0]].ansible_host }}"

0 commit comments

Comments
 (0)