diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 993166a7..ae5815a5 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -488,6 +488,8 @@ def get_ceph_context(upgrading=False): cephcontext['bdev_discard'] = False if config('prefer-ipv6'): + cephcontext['ms_bind_ipv4'] = False + cephcontext['ms_bind_ipv6'] = True dynamic_ipv6_address = get_ipv6_addr()[0] if not public_network: cephcontext['public_addr'] = dynamic_ipv6_address diff --git a/templates/ceph.conf b/templates/ceph.conf index 931ff8c2..81b9ea1a 100644 --- a/templates/ceph.conf +++ b/templates/ceph.conf @@ -15,6 +15,12 @@ err to syslog = {{ use_syslog }} clog to syslog = {{ use_syslog }} debug osd = {{ loglevel }}/5 +{% if ms_bind_ipv6 %} +ms_bind_ipv6 = true +{%- endif %} +{%- if ms_bind_ipv4 == false %} +ms_bind_ipv4 = false +{% endif %} {% if ceph_public_network is string %} public network = {{ ceph_public_network }} {%- endif %}