ceph-ansible/roles/ceph-common/templates/ceph.conf.j2

163 lines
6.7 KiB
Django/Jinja

#jinja2: trim_blocks: "true", lstrip_blocks: "true"
# {{ ansible_managed }}
[global]
{% if not cephx %}
auth cluster required = none
auth service required = none
auth client required = none
auth supported = none
{% endif %}
{% if ip_version == 'ipv6' %}
ms bind ipv6
{% endif %}
{% if not mon_containerized_deployment_with_kv and not mon_containerized_deployment %}
fsid = {{ fsid }}
{% endif %}
max open files = {{ max_open_files }}
{% if common_single_host_mode is defined and common_single_host_mode %}
osd crush chooseleaf type = 0
{% endif %}
{# NOTE (leseb): the blank lines in-between are needed otherwise we won't get any line break #}
{% if groups[mon_group_name] is defined %}
mon initial members = {% for host in groups[mon_group_name] %}
{% if hostvars[host]['ansible_fqdn'] is defined and mon_use_fqdn -%}
{{ hostvars[host]['ansible_fqdn'] }}
{%- elif hostvars[host]['ansible_hostname'] is defined -%}
{{ hostvars[host]['ansible_hostname'] }}
{%- endif %}
{%- if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
{% if not mon_containerized_deployment and not mon_containerized_deployment_with_kv %}
{% if monitor_address_block %}
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 %}
mon host = {% for host in groups[mon_group_name] %}
{% set address = hostvars[host]['monitor_address'] if hostvars[host]['monitor_address'] is defined else monitor_address %}
{% set interface = hostvars[host]['monitor_interface'] if hostvars[host]['monitor_interface'] is defined else monitor_interface %}
{% if interface != "interface" %}
{% for key in hostvars[host].keys() %}
{% if hostvars[host][key]['macaddress'] is defined and hostvars[host][key]['device'] is defined and hostvars[host][key]['device'] == interface -%}
{{ hostvars[host][key][ip_version]['address'] }}
{%- endif %}
{% endfor %}
{% elif address != "0.0.0.0" -%}
{{ address }}
{%- endif %}
{%- if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if mon_containerized_deployment %}
fsid = {{ fsid }}
{% if groups[mon_group_name] is defined %}
mon host = {% for host in groups[mon_group_name] %}
{% set interface = ["ansible_",ceph_mon_docker_interface]|join %}
{% if mon_containerized_deployment -%}
{{ hostvars[host][interface]['ipv4']['address'] }}
{%- elif hostvars[host]['monitor_address'] is defined -%}
{{ hostvars[host]['monitor_address'] }}
{%- elif monitor_address != "0.0.0.0" -%}
{{ monitor_address }}
{%- endif %}
{%- if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if public_network is defined %}
public network = {{ public_network }}
{% endif %}
{% if cluster_network is defined %}
cluster network = {{ cluster_network }}
{% endif %}
[client.libvirt]
admin socket = {{ rbd_client_admin_socket_path }}/$cluster-$type.$id.$pid.$cctid.asok # must be writable by QEMU and allowed by SELinux or AppArmor
log file = {{ rbd_client_log_file }} # must be writable by QEMU and allowed by SELinux or AppArmor
[osd]
osd mkfs type = {{ osd_mkfs_type }}
osd mkfs options xfs = {{ osd_mkfs_options_xfs }}
osd mount options xfs = {{ osd_mount_options_xfs }}
osd journal size = {{ journal_size }}
{% if filestore_xattr_use_omap != None %}
filestore xattr use omap = {{ filestore_xattr_use_omap }}
{% elif osd_mkfs_type == "ext4" %}
filestore xattr use omap = true
{# else, default is false #}
{% endif %}
{% if groups[mds_group_name] is defined %}
{% for host in groups[mds_group_name] %}
{% if hostvars[host]['ansible_fqdn'] is defined and mds_use_fqdn %}
[mds.{{ hostvars[host]['ansible_fqdn'] }}]
host = {{ hostvars[host]['ansible_fqdn'] }}
{% elif hostvars[host]['ansible_hostname'] is defined %}
[mds.{{ hostvars[host]['ansible_hostname'] }}]
host = {{ hostvars[host]['ansible_hostname'] }}
{% endif %}
{% endfor %}
{% endif %}
{% if groups[rgw_group_name] is defined %}
{% for host in groups[rgw_group_name] %}
{% if hostvars[host]['ansible_hostname'] is defined %}
[client.rgw.{{ hostvars[host]['ansible_hostname'] }}]
{% if radosgw_dns_name is defined %}
rgw dns name = {{ radosgw_dns_name }}
{% endif %}
host = {{ hostvars[host]['ansible_hostname'] }}
keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}/keyring
rgw socket path = /tmp/radosgw-{{ hostvars[host]['ansible_hostname'] }}.sock
log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] }}.log
rgw data = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}
rgw frontends = civetweb {{ radosgw_civetweb_options }}
rgw resolve cname = {{ radosgw_resolve_cname | bool }}
{% if radosgw_keystone %}
rgw keystone url = {{ radosgw_keystone_url }}
rgw keystone api version = {{ radosgw_keystone_api_version }}
{% if radosgw_keystone_auth_method == 'admin_token' %}
rgw keystone admin token = {{ radosgw_keystone_admin_token }}
{% elif radosgw_keystone_auth_method == 'auth_token' %}
rgw keystone admin user = {{ radosgw_keystone_admin_user }}
rgw keystone admin password = {{ radosgw_keystone_admin_password }}
rgw keystone admin tenant = {{ radosgw_keystone_admin_tenant }}
rgw keystone admin domain = {{ radosgw_keystone_admin_domain }}
{% endif %}
rgw keystone accepted roles = {{ radosgw_keystone_accepted_roles }}
rgw keystone token cache size = {{ radosgw_keystone_token_cache_size }}
rgw keystone revocation interval = {{ radosgw_keystone_revocation_internal }}
rgw s3 auth use keystone = {{ radosgw_s3_auth_use_keystone }}
{% if radosgw_keystone_ssl | bool %}
nss db path = {{ radosgw_nss_db_path }}
{% endif %}
{% endif %}
{% if radosgw_usage_log | bool %}
rgw enable usage log = true
rgw usage log tick interval = {{ radosgw_usage_log_tick_interval }}
rgw usage log flush threshold = {{ radosgw_usage_log_flush_threshold }}
rgw usage max shards = {{ radosgw_usage_max_shards }}
rgw usage max user shards = {{ radosgw_usage_max_user_shards }}
{% endif %}
{% if radosgw_static_website | bool %}
rgw enable static website = {{ radosgw_static_website }}
rgw dns s3website name = {{ radosgw_dns_s3website_name }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% if groups[restapi_group_name] is defined %}
[client.restapi]
{% if restapi_interface != "interface" %}
{% include 'client_restapi_interface.j2' %}
{% else %}
{% include 'client_restapi_address.j2' %}
{% endif %}
keyring = /var/lib/ceph/restapi/ceph-restapi/keyring
log file = /var/log/ceph/ceph-restapi.log
{% endif %}