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

184 lines
7.4 KiB
Plaintext
Raw Normal View History

#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 = true
{% endif %}
{% if not containerized_deployment_with_kv and not 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 containerized_deployment and not containerized_deployment_with_kv -%}
mon host = {% for host in groups[mon_group_name] -%}
{% if monitor_address_block is defined %}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
{%- elif ip_version == 'ipv6' -%}
[{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}]
{%- endif %}
{% elif hostvars[host]['monitor_address'] is defined and hostvars[host]['monitor_address'] != '0.0.0.0' -%}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['monitor_address'] }}
{%- elif ip_version == 'ipv6' -%}
[{{ hostvars[host]['monitor_address'] }}]
{%- endif %}
{%- else -%}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['ansible_' + monitor_interface][ip_version]['address'] }}
{%- elif ip_version == 'ipv6' -%}
[{{ hostvars[host]['ansible_' + monitor_interface][ip_version][0]['address'] }}]
{%- endif %}
{%- endif %}
{% if not loop.last -%},{%- endif %}
{%- endfor %}
{%- endif %}
{% if containerized_deployment %}
fsid = {{ fsid }}
mon host = {% for host in groups[mon_group_name] -%}
{% if monitor_address_block is defined %}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}
{%- elif ip_version == 'ipv6' -%}
[{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}]
{%- endif %}
{% elif hostvars[host]['monitor_address'] is defined and hostvars[host]['monitor_address'] != '0.0.0.0' -%}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['monitor_address'] }}
{%- elif ip_version == 'ipv6' -%}
[{{ hostvars[host]['monitor_address'] }}]
{%- endif %}
{%- else -%}
{% set interface = ["ansible_",ceph_mon_docker_interface]|join %}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host][interface][ip_version]['address'] }}
{%- elif ip_version == 'ipv6' -%}
[{{ hostvars[host][interface][ip_version][0]['address'] }}]
{%- endif %}
{%- endif %}
{% if not loop.last -%},{%- endif %}
{%- endfor %}
{% endif %}
{% if public_network is defined %}
public network = {{ public_network }}
{% endif %}
{% if cluster_network is defined %}
cluster network = {{ cluster_network }}
{% endif %}
{% if rgw_override_bucket_index_max_shards is defined %}
rgw override bucket index max shards = {{ rgw_override_bucket_index_max_shards }}
{% endif %}
{% if rgw_bucket_default_quota_max_objects is defined %}
rgw bucket default quota max objects = {{ rgw_bucket_default_quota_max_objects }}
{% 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 %}
2015-06-11 08:42:41 +08:00
{% 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 %}
2015-06-11 08:42:41 +08:00
{% for host in groups[rgw_group_name] %}
2014-03-20 19:14:43 +08:00
{% 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 %}
2014-03-20 19:14:43 +08:00
{% 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 %}
2014-03-19 19:40:02 +08:00
{% 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 %}