Merge pull request #1065 from ceph/fix-conf-template

various fixes for the ceph.conf template
pull/1070/head
Leseb 2016-11-03 15:30:51 +01:00 committed by GitHub
commit d4320d4dea
3 changed files with 17 additions and 16 deletions

View File

@ -17,18 +17,27 @@ osd crush chooseleaf type = 0
{% endif %} {% endif %}
{# NOTE (leseb): the blank lines in-between are needed otherwise we won't get any line break #} {# NOTE (leseb): the blank lines in-between are needed otherwise we won't get any line break #}
{% if groups[mon_group_name] is defined %} {% if groups[mon_group_name] is defined %}
mon_initial_members = {% if groups[mon_group_name] is defined %}{% for host in groups[mon_group_name] %}{% if hostvars[host]['ansible_fqdn'] is defined and mon_use_fqdn %}{{ hostvars[host]['ansible_fqdn'] }}{% if not loop.last %},{% endif %}{% elif hostvars[host]['ansible_hostname'] is defined %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endif %}{% endfor %}{% endif %} mon initial members = {% if groups[mon_group_name] is defined %}{% for host in groups[mon_group_name] %}{% if hostvars[host]['ansible_fqdn'] is defined and mon_use_fqdn %}{{ hostvars[host]['ansible_fqdn'] }}{% if not loop.last %},{% endif %}{% elif hostvars[host]['ansible_hostname'] is defined %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endif %}{% endfor %}{% endif %}
{% endif %} {% endif %}
{% if not mon_containerized_deployment and not mon_containerized_deployment_with_kv %} {% if not mon_containerized_deployment and not mon_containerized_deployment_with_kv %}
{% if monitor_address_block is defined %} {% if monitor_address_block is defined %}
mon host = {% for host in groups[mon_group_name] %}{{ hostvars[host]['ansible_all_ipv4_addresses'] | ipaddr(monitor_address_block) | first }}{% if not loop.last %},{% endif %}{% endfor %} mon host = {% for host in groups[mon_group_name] %}{{ hostvars[host]['ansible_all_ipv4_addresses'] | ipaddr(monitor_address_block) | first }}{% if not loop.last %},{% endif %}{% endfor %}
{% elif groups[mon_group_name] is defined %} {% elif groups[mon_group_name] is defined %}
mon host = {% for host in groups[mon_group_name] %}{% for key in hostvars[host].iterkeys() %}{% if hostvars[host][key]['macaddress'] is defined and hostvars[host][key]['device'] is defined and hostvars[host][key]['device'] == monitor_interface %}{{ hostvars[host][key]['ipv4']['address'] }}{% endif %}{% endfor %}{% if not loop.last %},{% endif %}{% endfor %} mon host = {% for host in groups[mon_group_name] %}
{% elif (hostvars[host]['monitor_interface'] is defined and hostvars[host]['monitor_interface'] != "interface") or monitor_interface != "interface" %} {% set address = hostvars[host]['monitor_address'] if hostvars[host]['monitor_address'] is defined else monitor_address %}
{% include 'mon_addr_interface.j2' %} {% set interface = hostvars[host]['monitor_interface'] if hostvars[host]['monitor_interface'] is defined else monitor_interface %}
{% else %} {% if address != "0.0.0.0" -%}
{% include 'mon_addr_address.j2' %} {{ address }}
{%- else %}
{% for key in hostvars[host].iterkeys() %}
{% if hostvars[host][key]['macaddress'] is defined and hostvars[host][key]['device'] is defined and hostvars[host][key]['device'] == interface -%}
{{ hostvars[host][key]['ipv4']['address'] }}
{%- endif %}
{% endfor %}
{% endif %}
{%- if not loop.last %},{% endif %}
{% endfor %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if mon_containerized_deployment %} {% if mon_containerized_deployment %}
@ -51,10 +60,10 @@ monitor_address
{% endif %} {% endif %}
{% if public_network is defined %} {% if public_network is defined %}
public_network = {{ public_network }} public network = {{ public_network }}
{% endif %} {% endif %}
{% if cluster_network is defined %} {% if cluster_network is defined %}
cluster_network = {{ cluster_network }} cluster network = {{ cluster_network }}
{% endif %} {% endif %}
[client.libvirt] [client.libvirt]

View File

@ -1 +0,0 @@
mon host = {% for host in groups[mon_group_name] %}{{ hostvars[host]['monitor_address'] if hostvars[host]['monitor_address'] is defined else monitor_address }}{% if not loop.last %},{% endif %}{% endfor %}

View File

@ -1,7 +0,0 @@
mon host = {% for host in groups[mon_group_name] %}
{% for key in hostvars[host].iterkeys() %}
{% if hostvars[host][key]['macaddress'] is defined and hostvars[host][key]['device'] is defined and hostvars[host][key]['device'] == monitor_interface %}
{{ hostvars[host][key]['ipv4']['address'] }}
{% endif %}
{% endfor %}
{% if not loop.last %},{% endif %}{% endfor %}