Merge "Add support for manila db purge job"
This commit is contained in:
@@ -75,7 +75,11 @@
|
|||||||
# (Optional) The current step in deployment. See tripleo-heat-templates
|
# (Optional) The current step in deployment. See tripleo-heat-templates
|
||||||
# for more details.
|
# for more details.
|
||||||
# Defaults to hiera('step')
|
# Defaults to hiera('step')
|
||||||
|
#
|
||||||
|
# [*manila_enable_db_purge*]
|
||||||
|
# (Optional) Whether to enable db purging
|
||||||
|
# Defaults to true
|
||||||
|
#
|
||||||
class tripleo::profile::base::manila::api (
|
class tripleo::profile::base::manila::api (
|
||||||
$backend_generic_enabled = hiera('manila_backend_generic_enabled', false),
|
$backend_generic_enabled = hiera('manila_backend_generic_enabled', false),
|
||||||
$backend_netapp_enabled = hiera('manila_backend_netapp_enabled', false),
|
$backend_netapp_enabled = hiera('manila_backend_netapp_enabled', false),
|
||||||
@@ -89,6 +93,7 @@ class tripleo::profile::base::manila::api (
|
|||||||
$manila_api_network = hiera('manila_api_network', undef),
|
$manila_api_network = hiera('manila_api_network', undef),
|
||||||
$enable_internal_tls = hiera('enable_internal_tls', false),
|
$enable_internal_tls = hiera('enable_internal_tls', false),
|
||||||
$step = Integer(hiera('step')),
|
$step = Integer(hiera('step')),
|
||||||
|
$manila_enable_db_purge = true,
|
||||||
) {
|
) {
|
||||||
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
|
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
|
||||||
$sync_db = true
|
$sync_db = true
|
||||||
@@ -133,4 +138,10 @@ class tripleo::profile::base::manila::api (
|
|||||||
ssl_key => $tls_keyfile,
|
ssl_key => $tls_keyfile,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $step >= 5 {
|
||||||
|
if $manila_enable_db_purge {
|
||||||
|
include manila::cron::db_purge
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -47,6 +47,7 @@ eos
|
|||||||
is_expected.to_not contain_class('tripleo::profile::base::apache')
|
is_expected.to_not contain_class('tripleo::profile::base::apache')
|
||||||
is_expected.to_not contain_class('manila::api')
|
is_expected.to_not contain_class('manila::api')
|
||||||
is_expected.to_not contain_class('manila::wsgi::apache')
|
is_expected.to_not contain_class('manila::wsgi::apache')
|
||||||
|
is_expected.to_not contain_class('manila::cron::db_purge')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -67,6 +68,7 @@ eos
|
|||||||
:enabled_share_protocols => 'NFS,CIFS'
|
:enabled_share_protocols => 'NFS,CIFS'
|
||||||
)
|
)
|
||||||
is_expected.to contain_class('manila::wsgi::apache')
|
is_expected.to contain_class('manila::wsgi::apache')
|
||||||
|
is_expected.to_not contain_class('manila::cron::db_purge')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -84,6 +86,7 @@ eos
|
|||||||
is_expected.to_not contain_class('tripleo::profile::base::apache')
|
is_expected.to_not contain_class('tripleo::profile::base::apache')
|
||||||
is_expected.to_not contain_class('manila::api')
|
is_expected.to_not contain_class('manila::api')
|
||||||
is_expected.to_not contain_class('manila::wsgi::apache')
|
is_expected.to_not contain_class('manila::wsgi::apache')
|
||||||
|
is_expected.to_not contain_class('manila::cron::db_purge')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -105,6 +108,7 @@ eos
|
|||||||
)
|
)
|
||||||
is_expected.to contain_class('manila::wsgi::apache')
|
is_expected.to contain_class('manila::wsgi::apache')
|
||||||
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to_not contain_class('manila::cron::db_purge')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -127,6 +131,52 @@ eos
|
|||||||
)
|
)
|
||||||
is_expected.to contain_class('manila::wsgi::apache')
|
is_expected.to contain_class('manila::wsgi::apache')
|
||||||
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to_not contain_class('manila::cron::db_purge')
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with step 5' do
|
||||||
|
let(:params) { {
|
||||||
|
:step => 5,
|
||||||
|
:bootstrap_node => 'other.example.com',
|
||||||
|
:backend_generic_enabled => true
|
||||||
|
} }
|
||||||
|
|
||||||
|
it {
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::authtoken')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::apache')
|
||||||
|
is_expected.to contain_class('manila::api').with(
|
||||||
|
:enabled_share_protocols => 'NFS,CIFS'
|
||||||
|
)
|
||||||
|
is_expected.to contain_class('manila::wsgi::apache')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to contain_class('manila::cron::db_purge')
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with step 5 without db_purge' do
|
||||||
|
let(:params) { {
|
||||||
|
:step => 5,
|
||||||
|
:bootstrap_node => 'other.example.com',
|
||||||
|
:backend_generic_enabled => true,
|
||||||
|
:manila_enable_db_purge => false,
|
||||||
|
} }
|
||||||
|
|
||||||
|
it {
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::authtoken')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::apache')
|
||||||
|
is_expected.to contain_class('manila::api').with(
|
||||||
|
:enabled_share_protocols => 'NFS,CIFS'
|
||||||
|
)
|
||||||
|
is_expected.to contain_class('manila::wsgi::apache')
|
||||||
|
is_expected.to contain_class('tripleo::profile::base::manila::api')
|
||||||
|
is_expected.to_not contain_class('manila::cron::db_purge')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user