diff --git a/roles/common/templates/ceph.conf.j2 b/roles/common/templates/ceph.conf.j2 index 8c9cccabd..06ef6e0ff 100644 --- a/roles/common/templates/ceph.conf.j2 +++ b/roles/common/templates/ceph.conf.j2 @@ -31,9 +31,11 @@ [mon] {% for host in groups['mons'] %} + {% if hostvars[host]['ansible_hostname'] is defined %} [mon.{{ hostvars[host]['ansible_hostname'] }}] host = {{ hostvars[host]['ansible_hostname'] }} mon addr = {{ hostvars[host]['ansible_' + monitor_interface ]['ipv4']['address'] }} + {% endif %} {% endfor %} [osd]