{% if groups[mds_group_name] is defined %}
{% if mds_group_name in group_names %}
+{% if inventory_hostname in groups.get(mds_group_name, []) %}
{% for host in groups[mds_group_name] %}
{% if hostvars[host]['ansible_fqdn'] is defined and mds_use_fqdn %}
[mds.{{ hostvars[host]['ansible_fqdn'] }}]
{% endfor %}
{% endif %}
{% endif %}
+{% endif %}
{% if groups[rgw_group_name] is defined %}
{% if rgw_group_name in group_names %}
+{% if inventory_hostname in groups.get(rgw_group_name, []) %}
{% for host in groups[rgw_group_name] %}
{% if hostvars[host]['ansible_hostname'] is defined %}
[client.rgw.{{ hostvars[host]['ansible_hostname'] }}]
host = {{ hostvars[host]['ansible_hostname'] }}
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}/keyring
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] }}.log
-{% if radosgw_address_block | length > 0 %}
+{% if hostvars[host]['radosgw_address_block'] is defined and hostvars[host]['radosgw_address_block'] | length > 0 %}
{% if ip_version == 'ipv4' -%}
rgw frontends = civetweb port={{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{%- elif ip_version == 'ipv6' -%}
rgw frontends = civetweb port=[{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {%- endif %}
+ {%- endif -%}
+
{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != '0.0.0.0' -%}
{% if ip_version == 'ipv4' -%}
rgw frontends = civetweb port={{ hostvars[host]['radosgw_address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{%- elif ip_version == 'ipv6' -%}
rgw frontends = civetweb port=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {% endif %}
+ {%- endif -%}
+
{%- else -%}
{% if ip_version == 'ipv4' -%}
rgw frontends = civetweb port={{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{%- elif ip_version == 'ipv6' -%}
rgw frontends = civetweb port=[{{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {% endif %}
+ {%- endif -%}
+
{%- endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
+{% endif %}
{% if groups[nfs_group_name] is defined %}
{% if nfs_group_name in group_names %}
+{% if inventory_hostname in groups.get(nfs_group_name, []) %}
{% for host in groups[nfs_group_name] %}
{% if nfs_obj_gw %}
{% if hostvars[host]['ansible_hostname'] is defined %}
host = {{ hostvars[host]['ansible_hostname'] }}
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}/keyring
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] }}.log
-rgw data = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}
-{% if radosgw_address_block | length > 0 %}
- {% if ip_version == 'ipv4' -%}
- rgw frontends = civetweb port={{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {%- elif ip_version == 'ipv6' -%}
- rgw frontends = civetweb port=[{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {%- endif %}
-{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != '0.0.0.0' -%}
- {% if ip_version == 'ipv4' -%}
- rgw frontends = civetweb port={{ hostvars[host]['radosgw_address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {%- elif ip_version == 'ipv6' -%}
- rgw frontends = civetweb port=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {% endif %}
-{%- else -%}
- {% set interface = 'ansible_' + hostvars[host]['radosgw_interface'] %}
- {% if ip_version == 'ipv6' -%}
- rgw frontends = civetweb port=[{{ hostvars[host][interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {%- elif ip_version == 'ipv4' -%}
- rgw frontends = civetweb port={{ hostvars[host][interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
- {% endif %}
-{%- endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
+{% endif %}
{% if groups[restapi_group_name] is defined %}
{% if restapi_group_name in group_names %}
+{% if inventory_hostname in groups.get(restapi_group_name, []) %}
[client.restapi]
{% if restapi_interface != "interface" %}
{% include 'client_restapi_interface.j2' %}
log file = /var/log/ceph/ceph-restapi.log
{% endif %}
{% endif %}
-
+{% endif %}