diff --git a/manifests/db/mysql_api.pp b/manifests/db/mysql_api.pp index a9336f5ab..498b0c460 100644 --- a/manifests/db/mysql_api.pp +++ b/manifests/db/mysql_api.pp @@ -32,9 +32,8 @@ # Defaults to undef # # [*setup_cell0*] -# (optional) Setup a cell0 for the cell_v2 functionality. This option will -# be set to true by default in Ocata when the cell v2 setup is mandatory. -# Defaults to false +# (optional) Setup a cell0 for the cell_v2 functionality. +# Defaults to true # class nova::db::mysql_api( $password, @@ -44,7 +43,7 @@ class nova::db::mysql_api( $charset = 'utf8', $collate = 'utf8_general_ci', $allowed_hosts = undef, - $setup_cell0 = false, + $setup_cell0 = true, ) { include ::nova::deps diff --git a/manifests/db/sync_api.pp b/manifests/db/sync_api.pp index 12eb31f48..d09e661bc 100644 --- a/manifests/db/sync_api.pp +++ b/manifests/db/sync_api.pp @@ -11,13 +11,12 @@ # # [*cellv2_setup*] # (optional) This flag toggles if we run the cell_v2 simple_cell_setup action -# with nova-manage. This flag will be set to true in Ocata when the cell v2 -# setup is mandatory. -# Defaults to false. +# with nova-manage. +# Defaults to true. # class nova::db::sync_api( $extra_params = undef, - $cellv2_setup = false, + $cellv2_setup = true, ) { include ::nova::deps diff --git a/releasenotes/notes/cell_v2-setup-default-true-569b431a5e987739.yaml b/releasenotes/notes/cell_v2-setup-default-true-569b431a5e987739.yaml new file mode 100644 index 000000000..c5403dca2 --- /dev/null +++ b/releasenotes/notes/cell_v2-setup-default-true-569b431a5e987739.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - The cell_v2 setup has been enabled by default. To skip it or + prevent it from running, set nova::db::mysql_api::setup_cell0 and + nova::db::sync_api::cellv2_setup to false. + as the prelude. This may mean repeating some details. diff --git a/spec/classes/nova_db_mysql_api_spec.rb b/spec/classes/nova_db_mysql_api_spec.rb index 68e7ba341..806c4c7be 100644 --- a/spec/classes/nova_db_mysql_api_spec.rb +++ b/spec/classes/nova_db_mysql_api_spec.rb @@ -23,7 +23,13 @@ describe 'nova::db::mysql_api' do :collate => 'utf8_general_ci', )} - it { is_expected.to_not contain_openstacklib__db__mysql('nova_api_cell0') } + it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with( + :user => 'nova_api', + :password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601', + :charset => 'utf8', + :collate => 'utf8_general_ci', + :create_user => false, + )} end context 'overriding allowed_hosts param to array' do @@ -40,6 +46,13 @@ describe 'nova::db::mysql_api' do :collate => 'utf8_general_ci', :allowed_hosts => ['127.0.0.1','%'], )} + it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with( + :user => 'nova_api', + :password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601', + :charset => 'utf8', + :collate => 'utf8_general_ci', + :allowed_hosts => ['127.0.0.1','%'], + )} end context 'overriding allowed_hosts param to string' do @@ -56,6 +69,13 @@ describe 'nova::db::mysql_api' do :collate => 'utf8_general_ci', :allowed_hosts => '192.168.1.1', )} + it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with( + :user => 'nova_api', + :password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601', + :charset => 'utf8', + :collate => 'utf8_general_ci', + :allowed_hosts => '192.168.1.1', + )} end context 'when overriding charset' do @@ -68,20 +88,17 @@ describe 'nova::db::mysql_api' do it { is_expected.to contain_openstacklib__db__mysql('nova_api').with( :charset => 'latin1', )} + it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with( + :charset => 'latin1', + )} end - context 'when enabling cell0 setup' do + context 'when disabling cell0 setup' do let :params do - { :setup_cell0 => true }.merge(required_params) + { :setup_cell0 => false }.merge(required_params) end - it { is_expected.to contain_openstacklib__db__mysql('nova_api_cell0').with( - :user => 'nova_api', - :password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601', - :charset => 'utf8', - :collate => 'utf8_general_ci', - :create_user => false, - )} + it { is_expected.to_not contain_openstacklib__db__mysql('nova_api_cell0') } end end diff --git a/spec/classes/nova_db_sync_api_spec.rb b/spec/classes/nova_db_sync_api_spec.rb index 1d26c06bc..d1bb1b319 100644 --- a/spec/classes/nova_db_sync_api_spec.rb +++ b/spec/classes/nova_db_sync_api_spec.rb @@ -15,14 +15,14 @@ describe 'nova::db::sync_api' do :notify => 'Anchor[nova::dbsync_api::end]', ) } - it { is_expected.to_not contain_class('nova::db::sync_cell_v2') } + it { is_expected.to contain_class('nova::db::sync_cell_v2') } end context "overriding extra_params" do let :params do { :extra_params => '--config-file /etc/nova/nova.conf', - :cellv2_setup => true + :cellv2_setup => false } end @@ -37,7 +37,7 @@ describe 'nova::db::sync_api' do :notify => 'Anchor[nova::dbsync_api::end]', ) } - it { is_expected.to contain_class('nova::db::sync_cell_v2') } + it { is_expected.to_not contain_class('nova::db::sync_cell_v2') } end end