Add support for ms_bind_ipv4

so that we can make ceph use IPv6 only.

Change-Id: I0920053e4615212caaf89d34834c1d1db7ecbad6
This commit is contained in:
Takashi Kajinami 2023-03-08 00:22:44 +09:00
parent b6731d247e
commit 5a9340437d
5 changed files with 17 additions and 0 deletions

View File

@ -81,6 +81,9 @@
# individually through ceph::mon. # individually through ceph::mon.
# Optional. String like e.g. 'a, b, c'. # Optional. String like e.g. 'a, b, c'.
# #
# [*ms_bind_ipv4*] Enables Ceph daemons to bind to IPv4 addresses.
# Optional. Boolean. Default provided by Ceph.
#
# [*ms_bind_ipv6*] Enables Ceph daemons to bind to IPv6 addresses. # [*ms_bind_ipv6*] Enables Ceph daemons to bind to IPv6 addresses.
# Optional. Boolean. Default provided by Ceph. # Optional. Boolean. Default provided by Ceph.
# #
@ -155,6 +158,7 @@ class ceph (
$mon_osd_nearfull_ratio = undef, $mon_osd_nearfull_ratio = undef,
$mon_initial_members = undef, $mon_initial_members = undef,
$mon_host = undef, $mon_host = undef,
$ms_bind_ipv4 = undef,
$ms_bind_ipv6 = undef, $ms_bind_ipv6 = undef,
$require_signatures = undef, $require_signatures = undef,
$cluster_require_signatures = undef, $cluster_require_signatures = undef,
@ -205,6 +209,7 @@ this module to assign values and will be removed in a future release.')
'global/mon_osd_nearfull_ratio': value => $mon_osd_nearfull_ratio; 'global/mon_osd_nearfull_ratio': value => $mon_osd_nearfull_ratio;
'global/mon_initial_members': value => $mon_initial_members; 'global/mon_initial_members': value => $mon_initial_members;
'global/mon_host': value => $mon_host; 'global/mon_host': value => $mon_host;
'global/ms_bind_ipv4': value => $ms_bind_ipv4;
'global/ms_bind_ipv6': value => $ms_bind_ipv6; 'global/ms_bind_ipv6': value => $ms_bind_ipv6;
'global/require_signatures': value => $require_signatures; 'global/require_signatures': value => $require_signatures;
'global/cluster_require_signatures': value => $cluster_require_signatures; 'global/cluster_require_signatures': value => $cluster_require_signatures;

View File

@ -42,6 +42,7 @@ class ceph::profile::base {
osd_pool_default_min_size => $ceph::profile::params::osd_pool_default_min_size, osd_pool_default_min_size => $ceph::profile::params::osd_pool_default_min_size,
mon_initial_members => $ceph::profile::params::mon_initial_members, mon_initial_members => $ceph::profile::params::mon_initial_members,
mon_host => $ceph::profile::params::mon_host, mon_host => $ceph::profile::params::mon_host,
ms_bind_ipv4 => $ceph::profile::params::ms_bind_ipv4,
ms_bind_ipv6 => $ceph::profile::params::ms_bind_ipv6, ms_bind_ipv6 => $ceph::profile::params::ms_bind_ipv6,
cluster_network => $ceph::profile::params::cluster_network, cluster_network => $ceph::profile::params::cluster_network,
public_network => $ceph::profile::params::public_network, public_network => $ceph::profile::params::public_network,

View File

@ -38,6 +38,9 @@
# individually through ceph::mon. # individually through ceph::mon.
# Optional. String like e.g. 'a, b, c'. # Optional. String like e.g. 'a, b, c'.
# #
# [*ms_bind_ipv4*] Enables Ceph daemons to bind to IPv4 addresses.
# Optional. Boolean. Default provided by Ceph.
#
# [*ms_bind_ipv6*] Enables Ceph daemons to bind to IPv6 addresses. # [*ms_bind_ipv6*] Enables Ceph daemons to bind to IPv6 addresses.
# Optional. Boolean. Default provided by Ceph. # Optional. Boolean. Default provided by Ceph.
# #
@ -185,6 +188,7 @@ class ceph::profile::params (
$authentication_type = undef, $authentication_type = undef,
$mon_initial_members = undef, $mon_initial_members = undef,
$mon_host = undef, $mon_host = undef,
$ms_bind_ipv4 = undef,
$ms_bind_ipv6 = undef, $ms_bind_ipv6 = undef,
$osd_journal_size = undef, $osd_journal_size = undef,
$osd_max_object_name_len = undef, $osd_max_object_name_len = undef,

View File

@ -0,0 +1,4 @@
---
features:
- |
Support for the ``[global] ms_bind_ipv4`` option has been added.

View File

@ -42,6 +42,7 @@ describe 'ceph' do
it { should_not contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('85') } it { should_not contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('85') }
it { should_not contain_ceph_config('global/mon_initial_members').with_value('mon.01') } it { should_not contain_ceph_config('global/mon_initial_members').with_value('mon.01') }
it { should_not contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') } it { should_not contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') }
it { should_not contain_ceph_config('global/ms_bind_ipv4').with_value('true') }
it { should_not contain_ceph_config('global/ms_bind_ipv6').with_value('false') } it { should_not contain_ceph_config('global/ms_bind_ipv6').with_value('false') }
it { should_not contain_ceph_config('global/require_signatures').with_value('false') } it { should_not contain_ceph_config('global/require_signatures').with_value('false') }
it { should_not contain_ceph_config('global/cluster_require_signatures').with_value('false') } it { should_not contain_ceph_config('global/cluster_require_signatures').with_value('false') }
@ -81,6 +82,7 @@ describe 'ceph' do
:mon_osd_nearfull_ratio => '90', :mon_osd_nearfull_ratio => '90',
:mon_initial_members => 'mon.01', :mon_initial_members => 'mon.01',
:mon_host => 'mon01.ceph, mon02.ceph', :mon_host => 'mon01.ceph, mon02.ceph',
:ms_bind_ipv4 => 'false',
:ms_bind_ipv6 => 'true', :ms_bind_ipv6 => 'true',
:require_signatures => 'true', :require_signatures => 'true',
:cluster_require_signatures => 'true', :cluster_require_signatures => 'true',
@ -118,6 +120,7 @@ describe 'ceph' do
it { should contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('90') } it { should contain_ceph_config('global/mon_osd_nearfull_ratio').with_value('90') }
it { should contain_ceph_config('global/mon_initial_members').with_value('mon.01') } it { should contain_ceph_config('global/mon_initial_members').with_value('mon.01') }
it { should contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') } it { should contain_ceph_config('global/mon_host').with_value('mon01.ceph, mon02.ceph') }
it { should contain_ceph_config('global/ms_bind_ipv4').with_value('false') }
it { should contain_ceph_config('global/ms_bind_ipv6').with_value('true') } it { should contain_ceph_config('global/ms_bind_ipv6').with_value('true') }
it { should contain_ceph_config('global/require_signatures').with_value('true') } it { should contain_ceph_config('global/require_signatures').with_value('true') }
it { should contain_ceph_config('global/cluster_require_signatures').with_value('true') } it { should contain_ceph_config('global/cluster_require_signatures').with_value('true') }