{% if mon_containerized_deployment %}
fsid = {{ fsid }}
{% if groups[mon_group_name] is defined %}
-{% for host in groups[mon_group_name] %}
+mon host = {% for host in groups[mon_group_name] -%}
{% if mon_containerized_deployment %}
{% set interface = ["ansible_",ceph_mon_docker_interface]|join %}
-mon_host = {{ hostvars[host][interface]['ipv4']['address'] }}
-{% if not loop.last %},{% endif %}
+{{ hostvars[host][interface]['ipv4']['address'] }}
+{%- if not loop.last %},{% endif %}
{% elif hostvars[host]['monitor_address'] is defined %}
-mon_host = {{ hostvars[host]['monitor_address'] }}
-{% if not loop.last %},{% endif %}
+{{ hostvars[host]['monitor_address'] }}
+{%- if not loop.last %},{% endif %}
{% elif monitor_address != "0.0.0.0" %}
-mon_host = monitor_address
-{% if not loop.last %},{% endif %}
+monitor_address
+{%- if not loop.last %},{% endif %}
{% endif %}
-{% endfor %}
+{%- endfor %}
{% endif %}
{% endif %}
---
# Defines deployment design and assigns role to server groups
-- hosts: all
+- hosts: mons # gather mon facts first before we process ceph-mon serially
tasks: []
- hosts: mons
become: True
+ gather_facts: false
roles:
- ceph-mon
serial: 1 # MUST be '1' WHEN DEPLOYING MONITORS ON DOCKER CONTAINERS