Change-Id: I67ac8b41365e1d6f90b8982659b9fd52744d2ad7changes/59/725259/21
parent
431016708a
commit
1d3bffd18b
@ -0,0 +1,71 @@
|
||||
# The trove::api::service_credentials class helps configure auth settings
|
||||
#
|
||||
# == Parameters
|
||||
# [*auth_url*]
|
||||
# (optional) the keystone public endpoint
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) the keystone region of this node
|
||||
# Optional. Defaults to 'RegionOne'
|
||||
#
|
||||
# [*username*]
|
||||
# (optional) the keystone user for trove services
|
||||
# Defaults to 'trove'
|
||||
#
|
||||
# [*password*]
|
||||
# (required) the keystone password for trove services
|
||||
#
|
||||
# [*project_name*]
|
||||
# (optional) the keystone tenant name for trove services
|
||||
# Defaults to 'services'
|
||||
#
|
||||
# [*project_domain_name*]
|
||||
# (optional) the keystone project domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
# [*user_domain_name*]
|
||||
# (optional) the keystone user domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
class trove::api::service_credentials (
|
||||
$password = $::os_service_default,
|
||||
$auth_url = undef,
|
||||
$region_name = 'RegionOne',
|
||||
$username = 'trove',
|
||||
$project_name = 'services',
|
||||
$project_domain_name = 'Default',
|
||||
$user_domain_name = 'Default',
|
||||
) {
|
||||
|
||||
include trove::deps
|
||||
|
||||
if $auth_url == undef {
|
||||
warning('The auto detection of auth_url from www_authenticate_uri will be \
|
||||
removed in a future release. Please set trove::api::service_credentials::auth_url .')
|
||||
$auth_url_base = pick($::trove::keystone::authtoken::www_authenticate_uri, 'http://127.0.0.1:5000/v3')
|
||||
} else {
|
||||
$auth_url_base = $auth_url
|
||||
}
|
||||
$auth_url_real = "${regsubst($auth_url_base, '(\/v3$|\/v2.0$|\/$)', '')}/v3"
|
||||
|
||||
$username_real = pick($::trove::nova_proxy_admin_user, $username)
|
||||
$password_real = pick($::trove::nova_proxy_admin_pass, $password)
|
||||
$project_name_real = pick($::trove::nova_proxy_tenant_name, $project_name)
|
||||
$region_name_real = pick($::trove::os_region_name, $region_name)
|
||||
|
||||
if is_service_default($password_real) {
|
||||
fail('trove::api::service_credentials::password should be set')
|
||||
}
|
||||
|
||||
trove_config {
|
||||
'service_credentials/auth_url': value => $auth_url_real;
|
||||
'service_credentials/username': value => $username_real;
|
||||
'service_credentials/password': value => $password_real, secret => true;
|
||||
'service_credentials/project_name': value => $project_name_real;
|
||||
'service_credentials/project_domain_name': value => $project_domain_name;
|
||||
'service_credentials/user_domain_name': value => $user_domain_name;
|
||||
'service_credentials/region_name': value => $region_name_real;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
# The trove::conductor::service_credentials class helps configure auth settings
|
||||
#
|
||||
# == Parameters
|
||||
# [*auth_url*]
|
||||
# (optional) the keystone public endpoint
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) the keystone region of this node
|
||||
# Optional. Defaults to 'RegionOne'
|
||||
#
|
||||
# [*username*]
|
||||
# (optional) the keystone user for trove services
|
||||
# Defaults to 'trove'
|
||||
#
|
||||
# [*password*]
|
||||
# (required) the keystone password for trove services
|
||||
#
|
||||
# [*project_name*]
|
||||
# (optional) the keystone tenant name for trove services
|
||||
# Defaults to 'services'
|
||||
#
|
||||
# [*project_domain_name*]
|
||||
# (optional) the keystone project domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
# [*user_domain_name*]
|
||||
# (optional) the keystone user domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
class trove::conductor::service_credentials (
|
||||
$password = $::os_service_default,
|
||||
$auth_url = undef,
|
||||
$region_name = 'RegionOne',
|
||||
$username = 'trove',
|
||||
$project_name = 'services',
|
||||
$project_domain_name = 'Default',
|
||||
$user_domain_name = 'Default',
|
||||
) {
|
||||
|
||||
include trove::deps
|
||||
|
||||
if $auth_url == undef {
|
||||
warning('The auto detection of auth_url from www_authenticate_uri will be \
|
||||
removed in a future release. Please set trove::conductor::service_credentials::auth_url .')
|
||||
$auth_url_base = pick($::trove::keystone::authtoken::www_authenticate_uri, 'http://127.0.0.1:5000/v3')
|
||||
} else {
|
||||
$auth_url_base = $auth_url
|
||||
}
|
||||
$auth_url_real = "${regsubst($auth_url_base, '(\/v3$|\/v2.0$|\/$)', '')}/v3"
|
||||
|
||||
$username_real = pick($::trove::nova_proxy_admin_user, $username)
|
||||
$password_real = pick($::trove::nova_proxy_admin_pass, $password)
|
||||
$project_name_real = pick($::trove::nova_proxy_tenant_name, $project_name)
|
||||
$region_name_real = pick($::trove::os_region_name, $region_name)
|
||||
|
||||
if is_service_default(password_real) {
|
||||
fail('trove::conductor::service_credentials::password should be set')
|
||||
}
|
||||
|
||||
trove_conductor_config {
|
||||
'service_credentials/auth_url': value => $auth_url_real;
|
||||
'service_credentials/username': value => $username_real;
|
||||
'service_credentials/password': value => $password_real, secret => true;
|
||||
'service_credentials/project_name': value => $project_name_real;
|
||||
'service_credentials/project_domain_name': value => $project_domain_name;
|
||||
'service_credentials/user_domain_name': value => $user_domain_name;
|
||||
'service_credentials/region_name': value => $region_name_real;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
# The trove::guestagent::service_credentials class helps configure auth settings
|
||||
#
|
||||
# == Parameters
|
||||
# [*auth_url*]
|
||||
# (optional) the keystone public endpoint
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) the keystone region of this node
|
||||
# Optional. Defaults to 'RegionOne'
|
||||
#
|
||||
# [*username*]
|
||||
# (optional) the keystone user for trove services
|
||||
# Defaults to 'trove'
|
||||
#
|
||||
# [*password*]
|
||||
# (required) the keystone password for trove services
|
||||
#
|
||||
# [*project_name*]
|
||||
# (optional) the keystone tenant name for trove services
|
||||
# Defaults to 'services'
|
||||
#
|
||||
# [*project_domain_name*]
|
||||
# (optional) the keystone project domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
# [*user_domain_name*]
|
||||
# (optional) the keystone user domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
class trove::guestagent::service_credentials (
|
||||
$password = $::os_service_default,
|
||||
$auth_url = 'http://127.0.0.1:5000/v3',
|
||||
$region_name = 'RegionOne',
|
||||
$username = 'trove',
|
||||
$project_name = 'services',
|
||||
$project_domain_name = 'Default',
|
||||
$user_domain_name = 'Default',
|
||||
) {
|
||||
|
||||
include trove::deps
|
||||
|
||||
$auth_url_base = pick($::trove::guestagent::auth_url, $auth_url)
|
||||
$auth_url_real = "${regsubst($auth_url_base, '(\/v3$|\/v2.0$|\/$)', '')}/v3"
|
||||
|
||||
$username_real = pick($::trove::nova_proxy_admin_user, $username)
|
||||
$password_real = pick($::trove::nova_proxy_admin_pass, $password)
|
||||
$project_name_real = pick($::trove::nova_proxy_tenant_name, $project_name)
|
||||
$region_name_real = pick($::trove::os_region_name, $region_name)
|
||||
|
||||
if is_service_default(password_real) {
|
||||
fail('trove::guestagent::service_credentials::password should be set')
|
||||
}
|
||||
|
||||
trove_guestagent_config {
|
||||
'service_credentials/auth_url': value => $auth_url_real;
|
||||
'service_credentials/username': value => $username_real;
|
||||
'service_credentials/password': value => $password_real, secret => true;
|
||||
'service_credentials/project_name': value => $project_name_real;
|
||||
'service_credentials/project_domain_name': value => $project_domain_name;
|
||||
'service_credentials/user_domain_name': value => $user_domain_name;
|
||||
'service_credentials/region_name': value => $region_name_real;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
# The trove::taskmanager::service_credentials class helps configure auth settings
|
||||
#
|
||||
# == Parameters
|
||||
# [*auth_url*]
|
||||
# (optional) the keystone public endpoint
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*region_name*]
|
||||
# (optional) the keystone region of this node
|
||||
# Optional. Defaults to 'RegionOne'
|
||||
#
|
||||
# [*username*]
|
||||
# (optional) the keystone user for trove services
|
||||
# Defaults to 'trove'
|
||||
#
|
||||
# [*password*]
|
||||
# (required) the keystone password for trove services
|
||||
#
|
||||
# [*project_name*]
|
||||
# (optional) the keystone tenant name for trove services
|
||||
# Defaults to 'services'
|
||||
#
|
||||
# [*project_domain_name*]
|
||||
# (optional) the keystone project domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
# [*user_domain_name*]
|
||||
# (optional) the keystone user domain name for trove services
|
||||
# Defaults to 'Default'
|
||||
#
|
||||
class trove::taskmanager::service_credentials (
|
||||
$password = $::os_service_default,
|
||||
$auth_url = undef,
|
||||
$region_name = 'RegionOne',
|
||||
$username = 'trove',
|
||||
$project_name = 'services',
|
||||
$project_domain_name = 'Default',
|
||||
$user_domain_name = 'Default',
|
||||
) {
|
||||
|
||||
include trove::deps
|
||||
|
||||
if $auth_url == undef {
|
||||
warning('The auto detection of auth_url from www_authenticate_uri will be \
|
||||
removed in a future release. Please set trove::taskmanager::service_credentials::auth_url .')
|
||||
$auth_url_base = pick($::trove::keystone::authtoken::www_authenticate_uri, 'http://127.0.0.1:5000/v3')
|
||||
} else {
|
||||
$auth_url_base = $auth_url
|
||||
}
|
||||
$auth_url_real = "${regsubst($auth_url_base, '(\/v3$|\/v2.0$|\/$)', '')}/v3"
|
||||
|
||||
$username_real = pick($::trove::nova_proxy_admin_user, $username)
|
||||
$password_real = pick($::trove::nova_proxy_admin_pass, $password)
|
||||
$project_name_real = pick($::trove::nova_proxy_tenant_name, $project_name)
|
||||
$region_name_real = pick($::trove::os_region_name, $region_name)
|
||||
|
||||
if is_service_default($password_real) {
|
||||
fail('trove::taskmanager::service_credentials::password should be set')
|
||||
}
|
||||
|
||||
trove_taskmanager_config {
|
||||
'service_credentials/auth_url': value => $auth_url_real;
|
||||
'service_credentials/username': value => $username_real;
|
||||
'service_credentials/password': value => $password_real, secret => true;
|
||||
'service_credentials/project_name': value => $project_name_real;
|
||||
'service_credentials/project_domain_name': value => $project_domain_name;
|
||||
'service_credentials/user_domain_name': value => $user_domain_name;
|
||||
'service_credentials/region_name': value => $region_name_real;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The following classes have been added to set parameters to define service
|
||||
credentials.
|
||||
|
||||
- ``trove::api::service_credentials``
|
||||
- ``trove::conductor::service_credentials``
|
||||
- ``trove::guestagent::service_credentials``
|
||||
- ``trove::taskmanager::service_credentials``
|
||||
deprecations:
|
||||
- |
|
||||
The following parameters in ``trove`` class has been deprecated and will
|
||||
be removed in a future release. Use the parameters in ``trove::auth`` class
|
||||
to set required parameters for keystone v3 auth.
|
||||
|
||||
- ``nova_proxy_admin_user``
|
||||
- ``nova_proxy_admin_pass``
|
||||
- ``nova_proxy_admin_tenant_name``
|
||||
- ``os_region_name``
|
||||
|
||||
- |
|
||||
The auto detection of auth_url parameter from www_authenticate_uri is
|
||||
deprecated and will be removed in a future release. Please set
|
||||
auth_url parameter before the detection is removed.
|
||||
|
||||
- |
|
||||
The ``trove::guestagent::auth_url`` parmaeter has been deprecated. Use
|
||||
``trove::taskmanager::service_credentials::auth_url`` instead.
|
@ -0,0 +1,73 @@
|
||||
#
|
||||
# Copyright (C) 2020 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'trove::api::service_credentials' do
|
||||
|
||||
shared_examples 'trove::api::service_credentials' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{
|
||||
:auth_url => 'http://127.0.0.1:5000/v3',
|
||||
:password => 'verysecrete'
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_config('service_credentials/username').with_value('trove')
|
||||
is_expected.to contain_trove_config('service_credentials/password').with_value('verysecrete').with_secret(true)
|
||||
is_expected.to contain_trove_config('service_credentials/project_name').with_value('services')
|
||||
is_expected.to contain_trove_config('service_credentials/region_name').with_value('RegionOne')
|
||||
is_expected.to contain_trove_config('service_credentials/user_domain_name').with_value('Default')
|
||||
is_expected.to contain_trove_config('service_credentials/project_domain_name').with_value('Default')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when overriding defaults' do
|
||||
let :params do
|
||||
{
|
||||
:auth_url => 'http://127.0.0.1:5000/v3',
|
||||
:password => 'verysecrete',
|
||||
:username => 'trove2',
|
||||
:project_name => 'services2',
|
||||
:region_name => 'RegionTwo',
|
||||
:user_domain_name => 'MyDomain',
|
||||
:project_domain_name => 'MyDomain',
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_config('service_credentials/username').with_value('trove2')
|
||||
is_expected.to contain_trove_config('service_credentials/project_name').with_value('services2')
|
||||
is_expected.to contain_trove_config('service_credentials/region_name').with_value('RegionTwo')
|
||||
is_expected.to contain_trove_config('service_credentials/user_domain_name').with_value('MyDomain')
|
||||
is_expected.to contain_trove_config('service_credentials/project_domain_name').with_value('MyDomain')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
it_configures 'trove::api::service_credentials'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,73 @@
|
||||
#
|
||||
# Copyright (C) 2020 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'trove::conductor::service_credentials' do
|
||||
|
||||
shared_examples 'trove::conductor::service_credentials' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{
|
||||
:auth_url => 'http://127.0.0.1:5000/v3',
|
||||
:password => 'verysecrete'
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/username').with_value('trove')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/password').with_value('verysecrete').with_secret(true)
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/project_name').with_value('services')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/region_name').with_value('RegionOne')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/user_domain_name').with_value('Default')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/project_domain_name').with_value('Default')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when overriding defaults' do
|
||||
let :params do
|
||||
{
|
||||
:auth_url => 'http://127.0.0.1:5000/v3',
|
||||
:password => 'verysecrete',
|
||||
:username => 'trove2',
|
||||
:project_name => 'services2',
|
||||
:region_name => 'RegionTwo',
|
||||
:user_domain_name => 'MyDomain',
|
||||
:project_domain_name => 'MyDomain',
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/username').with_value('trove2')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/project_name').with_value('services2')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/region_name').with_value('RegionTwo')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/user_domain_name').with_value('MyDomain')
|
||||
is_expected.to contain_trove_conductor_config('service_credentials/project_domain_name').with_value('MyDomain')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
it_configures 'trove::conductor::service_credentials'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,70 @@
|
||||
#
|
||||
# Copyright (C) 2020 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'trove::guestagent::service_credentials' do
|
||||
|
||||
shared_examples 'trove::guestagent::service_credentials' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{ :password => 'verysecrete' }
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/username').with_value('trove')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/password').with_value('verysecrete').with_secret(true)
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/project_name').with_value('services')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/region_name').with_value('RegionOne')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/user_domain_name').with_value('Default')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/project_domain_name').with_value('Default')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when overriding defaults' do
|
||||
let :params do
|
||||
{
|
||||
:auth_url => 'http://127.0.0.1:5000/v3',
|
||||
:password => 'verysecrete',
|
||||
:username => 'trove2',
|
||||
:project_name => 'services2',
|
||||
:region_name => 'RegionTwo',
|
||||
:user_domain_name => 'MyDomain',
|
||||
:project_domain_name => 'MyDomain',
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/username').with_value('trove2')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/project_name').with_value('services2')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/region_name').with_value('RegionTwo')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/user_domain_name').with_value('MyDomain')
|
||||
is_expected.to contain_trove_guestagent_config('service_credentials/project_domain_name').with_value('MyDomain')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
it_configures 'trove::guestagent::service_credentials'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,73 @@
|
||||
#
|
||||
# Copyright (C) 2020 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'trove::taskmanager::service_credentials' do
|
||||
|
||||
shared_examples 'trove::taskmanager::service_credentials' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :params do
|
||||
{
|
||||
:auth_url => 'http://127.0.0.1:5000/v3',
|
||||
:password => 'verysecrete'
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/username').with_value('trove')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/password').with_value('verysecrete').with_secret(true)
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/project_name').with_value('services')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/region_name').with_value('RegionOne')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/user_domain_name').with_value('Default')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/project_domain_name').with_value('Default')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when overriding defaults' do
|
||||
let :params do
|
||||
{
|
||||
:auth_url => 'http://127.0.0.1:5000/v3',
|
||||
:password => 'verysecrete',
|
||||
:username => 'trove2',
|
||||
:project_name => 'services2',
|
||||
:region_name => 'RegionTwo',
|
||||
:user_domain_name => 'MyDomain',
|
||||
:project_domain_name => 'MyDomain',
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures service credentials with default parameters' do
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/auth_url').with_value('http://127.0.0.1:5000/v3')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/username').with_value('trove2')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/project_name').with_value('services2')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/region_name').with_value('RegionTwo')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/user_domain_name').with_value('MyDomain')
|
||||
is_expected.to contain_trove_taskmanager_config('service_credentials/project_domain_name').with_value('MyDomain')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
it_configures 'trove::taskmanager::service_credentials'
|
||||
end
|
||||
end
|
||||
|
||||
end
|