tripleo-ansible/tripleo_ansible/roles/tripleo_ceph_client/templates/ceph_conf.j2

43 lines
1.4 KiB
Django/Jinja

# {{ ansible_managed }}
{# MACRO AREA #}
{% macro render_map(root) -%}
{% for key, value in root.items() %}
{{ key}} = {{ value }}
{% endfor %}
{% endmacro %}
[global]
{% if tripleo_ceph_client_cluster_network is defined and tripleo_ceph_client_cluster_network | length > 0 %}
cluster network = {{ tripleo_ceph_client_cluster_network | regex_replace(' ', '') }}
{% endif %}
fsid = {{ tripleo_ceph_client_fsid }}
mon host = {% if tripleo_ceph_client_mon_ips is defined and tripleo_ceph_client_mon_ips | length > 0 %}
{% for ip in tripleo_ceph_client_mon_ips %}{{ip}}{% if not loop.last %},{% endif %}{% endfor %}
{% else %}
{{ external_cluster_mon_ips }}
{% endif %}
{# Build CephConfigOverrides #}
{% for key, value in (config_overrides | default({})).items() %}
{% if not (['global', 'mon', 'mgr', 'osd', 'mds', 'client']) | intersect([key]) %}
{{ key }} = {{ value }}
{% elif (['global']) | intersect([key]) %}
{# Merge global defined values into this section #}
{{ render_map(value) }}
{% endif %}
{% endfor %}
{# Build the remaining sections #}
{% for key, value in (config_overrides | default({})).items() %}
{% if (['mon', 'mgr', 'osd', 'mds', 'client']) | intersect([key]) %}
[{{ key }}]
{# Render the current section #}
{{ render_map(value) }}
{% endif %}
{% endfor %}
[client.libvirt]
admin socket = {{ tripleo_ceph_client_rbd_admin_socket_path }}/$cluster-$type.$id.$pid.$cctid.asok
log file = {{ tripleo_ceph_client_rbd_log_file }}