Merge "Add a new parameter to enable/disable bootstrap"
This commit is contained in:
commit
7f6b218341
|
@ -54,6 +54,10 @@
|
|||
# (Optional) Which interface endpoint should be used.
|
||||
# Defaults to 'public'
|
||||
#
|
||||
# [*bootstrap*]
|
||||
# (Optional) Whether to run keystone-manage bootstrap command.
|
||||
# Defaults to true
|
||||
#
|
||||
class keystone::bootstrap (
|
||||
$password,
|
||||
$username = 'admin',
|
||||
|
@ -67,6 +71,7 @@ class keystone::bootstrap (
|
|||
$internal_url = undef,
|
||||
$region = 'RegionOne',
|
||||
$interface = 'public',
|
||||
$bootstrap = true,
|
||||
) inherits keystone::params {
|
||||
|
||||
include keystone::deps
|
||||
|
@ -82,6 +87,7 @@ class keystone::bootstrap (
|
|||
$keystone_user = $::keystone::params::keystone_user
|
||||
}
|
||||
|
||||
if $bootstrap {
|
||||
# The initial bootstrap that creates all resources required but
|
||||
# only subscribes to notifies from the keystone::dbsync::end anchor
|
||||
# which means this is not guaranteed to execute on each run.
|
||||
|
@ -146,6 +152,7 @@ class keystone::bootstrap (
|
|||
'admin_url' => $admin_url,
|
||||
'internal_url' => $internal_url_real,
|
||||
})
|
||||
}
|
||||
|
||||
# The below creates and populates the /etc/keystone/puppet.conf file that contains
|
||||
# the credentials that can be loaded by providers. Ensure it has the proper owner,
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The new ``keystone::bootstrap::bootstrap`` parameter has been added, to
|
||||
disable ``keystone-manage bootstrap`` command. This is useful to generate
|
||||
``/etc/keystone/puppet.conf`` on multiple nodes while running bootstrap
|
||||
command on a single node.
|
|
@ -179,6 +179,46 @@ describe 'keystone::bootstrap' do
|
|||
)}
|
||||
end
|
||||
|
||||
context 'with bootstrap disabled' do
|
||||
let :params do
|
||||
{
|
||||
:bootstrap => false,
|
||||
:password => 'secret'
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_class('keystone::deps') }
|
||||
|
||||
it { is_expected.to_not contain_exec('keystone bootstrap') }
|
||||
|
||||
it { is_expected.to_not contain_keystone_role('admin') }
|
||||
it { is_expected.to_not contain_keystone_user('admin') }
|
||||
it { is_expected.to_not contain_keystone_tenant('services') }
|
||||
it { is_expected.to_not contain_keystone_tenant('admin') }
|
||||
it { is_expected.to_not contain_keystone_user_role('admin@admin') }
|
||||
it { is_expected.to_not contain_keystone_service('keystone::identity') }
|
||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/keystone::identity') }
|
||||
|
||||
it { is_expected.to contain_file('/etc/keystone/puppet.conf').with(
|
||||
:ensure => 'present',
|
||||
:replace => false,
|
||||
:content => '',
|
||||
:owner => 'root',
|
||||
:group => 'root',
|
||||
:mode => '0600',
|
||||
:require => 'Anchor[keystone::install::end]',
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_keystone__resource__authtoken('keystone_puppet_config').with(
|
||||
:username => 'admin',
|
||||
:password => 'secret',
|
||||
:auth_url => 'http://127.0.0.1:5000',
|
||||
:project_name => 'admin',
|
||||
:region_name => 'RegionOne',
|
||||
:interface => 'public',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'when setting keystone_user param in keystone' do
|
||||
let :params do
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue