Skip to content

Commit dc767bc

Browse files
jackhodgkisscityofships
authored andcommitted
fix!: use inventory_hostname if ansible_host is unset
If using FQDNs within an ansible inventory the variable `ansible_host` never gets set causing an error when setting `mon_ansible_host`.
1 parent 673b381 commit dc767bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roles/cephadm/tasks/osds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# correctly when setting ansible_host in the next task.
44
- name: Set a fact about the Ansible host
55
set_fact:
6-
mon_ansible_host: "{{ hostvars[inventory_hostname].ansible_host }}"
6+
mon_ansible_host: "{{ hostvars[inventory_hostname].ansible_host | default(inventory_hostname) }}"
77

88
- name: Add OSDs individually
99
command:

0 commit comments

Comments
 (0)