Add auth_strategy configuration
Added missing auth_strategy configuration and keystone authtoken initialization to the API service. Change-Id: Ic38d4f9f9a8e69ffcee6ccc4bba9a9ab0f161d0e
This commit is contained in:
parent
c7b4060c72
commit
2ee0e421d1
@ -22,6 +22,10 @@
|
|||||||
# (optional) ensure state for package.
|
# (optional) ensure state for package.
|
||||||
# Defaults to 'present'
|
# Defaults to 'present'
|
||||||
#
|
#
|
||||||
|
# [*auth_strategy*]
|
||||||
|
# (optional) set authentication mechanism
|
||||||
|
# Defaults to 'keystone'
|
||||||
|
#
|
||||||
# [*sync_db*]
|
# [*sync_db*]
|
||||||
# (optional) Run octavia-db-manage upgrade head on api nodes after installing the package.
|
# (optional) Run octavia-db-manage upgrade head on api nodes after installing the package.
|
||||||
# Defaults to false
|
# Defaults to false
|
||||||
@ -32,6 +36,7 @@ class octavia::api (
|
|||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$host = '0.0.0.0',
|
$host = '0.0.0.0',
|
||||||
$port = '9876',
|
$port = '9876',
|
||||||
|
$auth_strategy = 'keystone',
|
||||||
$sync_db = false,
|
$sync_db = false,
|
||||||
) inherits octavia::params {
|
) inherits octavia::params {
|
||||||
|
|
||||||
@ -39,6 +44,10 @@ class octavia::api (
|
|||||||
include ::octavia::policy
|
include ::octavia::policy
|
||||||
include ::octavia::db
|
include ::octavia::db
|
||||||
|
|
||||||
|
if $auth_strategy == 'keystone' {
|
||||||
|
include ::octavia::keystone::authtoken
|
||||||
|
}
|
||||||
|
|
||||||
package { 'octavia-api':
|
package { 'octavia-api':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
name => $::octavia::params::api_package_name,
|
name => $::octavia::params::api_package_name,
|
||||||
@ -69,6 +78,7 @@ class octavia::api (
|
|||||||
octavia_config {
|
octavia_config {
|
||||||
'DEFAULT/host' : value => $host;
|
'DEFAULT/host' : value => $host;
|
||||||
'DEFAULT/port' : value => $port;
|
'DEFAULT/port' : value => $port;
|
||||||
|
'DEFAULT/auth_strategy' : value => $auth_strategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- support for configuring auth_strategy for the Octavia api service has
|
||||||
|
been added and the keystone authtoken support properly initialized.
|
@ -4,7 +4,11 @@ describe 'octavia::api' do
|
|||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
"class { 'octavia': }
|
"class { 'octavia': }
|
||||||
include ::octavia::db"
|
include ::octavia::db
|
||||||
|
class { '::octavia::keystone::authtoken':
|
||||||
|
password => 'password';
|
||||||
|
}
|
||||||
|
"
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
@ -21,6 +25,7 @@ describe 'octavia::api' do
|
|||||||
it { is_expected.to contain_class('octavia::deps') }
|
it { is_expected.to contain_class('octavia::deps') }
|
||||||
it { is_expected.to contain_class('octavia::params') }
|
it { is_expected.to contain_class('octavia::params') }
|
||||||
it { is_expected.to contain_class('octavia::policy') }
|
it { is_expected.to contain_class('octavia::policy') }
|
||||||
|
it { is_expected.to contain_class('octavia::keystone::authtoken') }
|
||||||
|
|
||||||
it 'installs octavia-api package' do
|
it 'installs octavia-api package' do
|
||||||
is_expected.to contain_package('octavia-api').with(
|
is_expected.to contain_package('octavia-api').with(
|
||||||
@ -30,6 +35,20 @@ describe 'octavia::api' do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when not parameters are defined' do
|
||||||
|
before do
|
||||||
|
params.clear()
|
||||||
|
end
|
||||||
|
it 'configures with default values' do
|
||||||
|
is_expected.to contain_octavia_config('DEFAULT/host').with_value( '0.0.0.0' )
|
||||||
|
is_expected.to contain_octavia_config('DEFAULT/port').with_value( '9876' )
|
||||||
|
is_expected.to contain_octavia_config('DEFAULT/auth_strategy').with_value( 'keystone' )
|
||||||
|
end
|
||||||
|
it 'does not sync the database' do
|
||||||
|
is_expected.not_to contain_class('octavia::db::sync')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it 'configures bind_host and bind_port' do
|
it 'configures bind_host and bind_port' do
|
||||||
is_expected.to contain_octavia_config('DEFAULT/host').with_value( params[:host] )
|
is_expected.to contain_octavia_config('DEFAULT/host').with_value( params[:host] )
|
||||||
is_expected.to contain_octavia_config('DEFAULT/port').with_value( params[:port] )
|
is_expected.to contain_octavia_config('DEFAULT/port').with_value( params[:port] )
|
||||||
|
Loading…
Reference in New Issue
Block a user