We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 333c04f + 6d407c1 commit a5e1070Copy full SHA for a5e1070
roles/cephadm/tasks/osds.yml
@@ -1,4 +1,9 @@
1
---
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 }}"
7
8
- name: Add OSDs individually
9
command:
@@ -14,4 +19,4 @@
14
19
vars:
15
20
# NOTE: Without this, the delegate hosts's ansible_host variable will not
16
21
# 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