From b4377f616344b72d4bfa1a3c5b4b1d7473e61acc Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 16 Apr 2019 10:31:44 +0200 Subject: [PATCH] update: refact msgr2 migration this commit refact the msgr2 protocol introduction. If it's a fresh install, let's go with v2 only. If we upgrade to nautilus, we should go with v2+v1 syntax to ensure nothing breaks. Signed-off-by: Guillaume Abrioux (cherry picked from commit a4bc7bda5148a94e917d228037447a138bd08cab) --- group_vars/all.yml.sample | 6 ++++++ group_vars/rhcs.yml.sample | 6 ++++++ roles/ceph-config/templates/ceph.conf.j2 | 15 ++++++++------- roles/ceph-defaults/defaults/main.yml | 6 ++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 5b7258cc3..99e4e4b21 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -337,6 +337,12 @@ dummy: #ip_version: ipv4 #mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf +#mon_host_v1: +# enabled: True +# suffix: ':6789' +#mon_host_v2: +# suffix: ':3300' + ########## # CEPHFS # ########## diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index ff62ab1ba..4dce4ae3f 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -337,6 +337,12 @@ ceph_rhcs_version: 3 #ip_version: ipv4 #mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf +#mon_host_v1: +# enabled: True +# suffix: ':6789' +#mon_host_v2: +# suffix: ':3300' + ########## # CEPHFS # ########## diff --git a/roles/ceph-config/templates/ceph.conf.j2 b/roles/ceph-config/templates/ceph.conf.j2 index 88759a8fe..f01fc108e 100644 --- a/roles/ceph-config/templates/ceph.conf.j2 +++ b/roles/ceph-config/templates/ceph.conf.j2 @@ -41,16 +41,17 @@ fsid = {{ fsid }} log file = /dev/null mon cluster log file = /dev/null {% endif %} -{% if ceph_release not in ['jewel', 'kraken', 'luminous', 'mimic'] %} -{% set mon_host_v1_suffix = ":6789" %} -{% set mon_host_v2_suffix = ":3300" %} -{% endif %} mon host = {% if nb_mon > 0 %} {% for host in _monitor_addresses -%} -{% if msgr2_migration | default(False) or not rolling_update %} -[{{ "v2:" + host.addr + mon_host_v2_suffix }},{{ "v1:" + host.addr + mon_host_v1_suffix }}] -{%- else -%} +{% if msgr2_migration | default(False) %} +[{{ "v2:" + host.addr + mon_host_v2.suffix }},{{ "v1:" + host.addr + mon_host_v1.suffix }}] +{%- elif not msgr2_migration | default(False) and rolling_update -%} {{ host.addr }} +{%- else -%} +{% if mon_host_v1.enabled %} +{% set _v1 = ',v1:' + host.addr + mon_host_v1.suffix %} +{% endif %} +[{{ "v2:" + host.addr + mon_host_v2.suffix }}{{ _v1 | default('') }}] {%- endif %} {%- if not loop.last -%},{%- endif %} {%- endfor %} diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 7688e0dc4..042e55491 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -329,6 +329,12 @@ monitor_address_block: subnet ip_version: ipv4 mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf +mon_host_v1: + enabled: True + suffix: ':6789' +mon_host_v2: + suffix: ':3300' + ########## # CEPHFS # ##########