Add a new parameter to enable/disable bootstrap
This change introduces a new parameter to enable/disable bootstrap command by the keystone::bootstrap command. This parameter is useful expecially in the deployment with multiple controller nodes, and we can run bootstrap command on only one of the controller nodes while we generate puppet.conf on all controller nodes, so that we can use openstack providers in all controller nodes. Change-Id: If049e33fefc2681d2f4340f5910402b07e6e286f
This commit is contained in:
parent
e361dcbd5f
commit
b8515bc3e4
@ -56,6 +56,10 @@
|
|||||||
# (Optional) Which interface endpoint should be used.
|
# (Optional) Which interface endpoint should be used.
|
||||||
# Defaults to 'public'
|
# Defaults to 'public'
|
||||||
#
|
#
|
||||||
|
# [*bootstrap*]
|
||||||
|
# (Optional) Whether to run keystone-manage bootstrap command.
|
||||||
|
# Defaults to true
|
||||||
|
#
|
||||||
class keystone::bootstrap (
|
class keystone::bootstrap (
|
||||||
$password,
|
$password,
|
||||||
$username = 'admin',
|
$username = 'admin',
|
||||||
@ -69,6 +73,7 @@ class keystone::bootstrap (
|
|||||||
$internal_url = undef,
|
$internal_url = undef,
|
||||||
$region = 'RegionOne',
|
$region = 'RegionOne',
|
||||||
$interface = 'public',
|
$interface = 'public',
|
||||||
|
$bootstrap = true,
|
||||||
) inherits keystone::params {
|
) inherits keystone::params {
|
||||||
|
|
||||||
include keystone::deps
|
include keystone::deps
|
||||||
@ -84,6 +89,7 @@ class keystone::bootstrap (
|
|||||||
$keystone_user = $::keystone::params::keystone_user
|
$keystone_user = $::keystone::params::keystone_user
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $bootstrap {
|
||||||
# The initial bootstrap that creates all resources required but
|
# The initial bootstrap that creates all resources required but
|
||||||
# only subscribes to notifies from the keystone::dbsync::end anchor
|
# only subscribes to notifies from the keystone::dbsync::end anchor
|
||||||
# which means this is not guaranteed to execute on each run.
|
# which means this is not guaranteed to execute on each run.
|
||||||
@ -148,6 +154,7 @@ class keystone::bootstrap (
|
|||||||
'admin_url' => $admin_url,
|
'admin_url' => $admin_url,
|
||||||
'internal_url' => $internal_url_real,
|
'internal_url' => $internal_url_real,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
# The below creates and populates the /etc/keystone/puppet.conf file that contains
|
# 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,
|
# 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
|
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
|
context 'when setting keystone_user param in keystone' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user