Remove old authtoken options

Since we are in ocata lets remove all old parameters in api
to configure the keystone_authtoken section

Change-Id: I2ad9c559768324cb494bcbe719195817b3ca4864
This commit is contained in:
Iury Gregory Melo Ferreira
2016-11-08 00:50:52 -03:00
parent 1032a9e41e
commit 287ef4dfe2
5 changed files with 56 additions and 95 deletions

View File

@@ -116,32 +116,6 @@
# (optional) The strategy to use for authentication.
# Defaults to 'keystone'
#
# == DEPRECATED PARAMETERS
#
# [*keystone_tenant*]
# (optional) Deprecated. Use trove::keystone::authtoken::project_name instead.
# Defaults to undef.
#
# [*keystone_user*]
# (optional) Deprecated. Use trove::keystone::authtoken::username instead.
# Defaults to undef.
#
# [*keystone_password*]
# (optional) Deprecated. Use trove::keystone::authtoken::password instead.
# Defaults to undef.
#
# [*identity_uri*]
# (optional) Deprecated. Use trove::keystone::authtoken::auth_url instead.
# Defaults to undef.
#
# [*auth_uri*]
# (Optional) Deprecated. Use trove::keystone::authtoken::auth_uri instead.
# Defaults to undef.
#
# [*auth_url*]
# (optional) Deprecated. Use trove::keystone::authtoken::auth_url instead.
# Defaults to undef
#
class trove::api(
$debug = undef,
$log_file = undef,
@@ -166,13 +140,6 @@ class trove::api(
$manage_service = true,
$ensure_package = 'present',
$auth_strategy = 'keystone',
# DEPRECATED PARAMETERS
$keystone_password = undef,
$keystone_tenant = undef,
$keystone_user = undef,
$identity_uri = undef,
$auth_uri = undef,
$auth_url = undef,
) inherits trove {
include ::trove::deps
@@ -181,30 +148,6 @@ class trove::api(
include ::trove::logging
include ::trove::params
if $keystone_password {
warning('keystone_password is deprecated, use trove::keystone::authtoken::password instead.')
}
if $keystone_tenant {
warning('keystone_password is deprecated, use trove::keystone::authtoken::project_name instead.')
}
if $keystone_user {
warning('keystone_password is deprecated, use trove::keystone::authtoken::username instead.')
}
if $identity_uri {
warning('keystone_password is deprecated, use trove::keystone::authtoken::auth_url instead.')
}
if $auth_uri {
warning('keystone_password is deprecated, use trove::keystone::authtoken::auth_uri instead.')
}
if $auth_url {
warning('auth_url is deprecated, use trove::keystone::authtoken::auth_url instead.')
}
# basic service config
trove_config {
'DEFAULT/bind_host': value => $bind_host;
@@ -225,7 +168,7 @@ class trove::api(
include ::trove::keystone::authtoken
trove_config {
'DEFAULT/trove_auth_url' : value => pick($auth_uri,$::trove::keystone::authtoken::auth_uri);
'DEFAULT/trove_auth_url' : value => $::trove::keystone::authtoken::auth_uri;
}
}

View File

@@ -228,23 +228,16 @@ class trove::keystone::authtoken(
$token_cache_time = $::os_service_default,
) {
if is_service_default($password) and ! $::trove::api::keystone_password {
if is_service_default($password) {
fail('Please set password for trove service user')
}
#NOTE(iurygregory): Use pick to keep backward compatibility
$username_real = pick($::trove::api::keystone_user,$username)
$password_real = pick($::trove::api::keystone_password,$password)
$project_name_real = pick($::trove::api::keystone_tenant,$project_name)
$auth_url_real = pick($::trove::api::identity_uri,$::trove::api::auth_url,$auth_url)
$auth_uri_real = pick($::trove::api::auth_uri,$auth_uri)
keystone::resource::authtoken { 'trove_config':
username => $username_real,
password => $password_real,
project_name => $project_name_real,
auth_url => $auth_url_real,
auth_uri => $auth_uri_real,
username => $username,
password => $password,
project_name => $project_name,
auth_url => $auth_url,
auth_uri => $auth_uri,
auth_version => $auth_version,
auth_type => $auth_type,
auth_section => $auth_section,

View File

@@ -0,0 +1,8 @@
---
other:
- removed deprecated trove::api::keystone_user
- removed deprecated trove::api::keystone_password
- removed deprecated trove::api::keystone_tenant
- removed deprecated trove::api::identity_uri
- removed deprecated trove::api::auth_url
- removed deprecated trove::api::auth_uri

View File

@@ -41,10 +41,10 @@ describe 'basic trove' do
class { '::trove::keystone::auth':
password => 'a_big_secret',
}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}
class { '::trove::api':
keystone_password => 'a_big_secret',
identity_uri => 'http://127.0.0.1:35357/',
auth_uri => 'http://127.0.0.1:5000/',
debug => true,
}
class { '::trove::client': }

View File

@@ -22,12 +22,7 @@ require 'spec_helper'
describe 'trove::api' do
let :params do
{ :keystone_password => 'passw0rd',
:identity_uri => 'http://10.0.0.10:35357/',
:auth_uri => 'http://10.0.0.10:5000/v2.0/',
:keystone_tenant => '_services_',
:keystone_user => 'trove',
}
{}
end
shared_examples 'trove-api' do
@@ -42,7 +37,10 @@ describe 'trove::api' do
cinder_service_type => 'volume',
swift_service_type => 'object-store',
heat_service_type => 'orchestration',
neutron_service_type => 'network'}"
neutron_service_type => 'network'}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it 'installs trove-api package and service' do
@@ -64,15 +62,10 @@ describe 'trove::api' do
is_expected.to contain_trove_config('DEFAULT/bind_port').with_value('8779')
is_expected.to contain_trove_config('DEFAULT/backlog').with_value('4096')
is_expected.to contain_trove_config('DEFAULT/trove_api_workers').with_value('8')
is_expected.to contain_trove_config('DEFAULT/trove_auth_url').with_value('http://10.0.0.10:5000/v2.0/')
is_expected.to contain_trove_config('DEFAULT/trove_auth_url').with_value('http://localhost:5000')
is_expected.to contain_trove_config('DEFAULT/nova_proxy_admin_user').with_value('admin')
is_expected.to contain_trove_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')
is_expected.to contain_trove_config('keystone_authtoken/auth_uri').with_value('http://10.0.0.10:5000/v2.0/')
is_expected.to contain_trove_config('keystone_authtoken/auth_url').with_value('http://10.0.0.10:35357/')
is_expected.to contain_trove_config('keystone_authtoken/project_name').with_value('_services_')
is_expected.to contain_trove_config('keystone_authtoken/username').with_value('trove')
is_expected.to contain_trove_config('keystone_authtoken/password').with_value('passw0rd')
is_expected.to contain_trove_config('DEFAULT/control_exchange').with_value('trove')
is_expected.to contain_trove_config('DEFAULT/os_region_name').with_value('RegionOne')
is_expected.to contain_trove_config('DEFAULT/nova_compute_service_type').with_value('compute')
@@ -139,7 +132,10 @@ describe 'trove::api' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_host => '10.0.0.1'}"
rabbit_host => '10.0.0.1'}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
@@ -154,7 +150,10 @@ describe 'trove::api' do
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
amqp_durable_queues => 'true',
rabbit_host => '10.0.0.1'}"
rabbit_host => '10.0.0.1'}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
@@ -168,7 +167,10 @@ describe 'trove::api' do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
rabbit_hosts => ['10.0.0.1','10.0.0.2']}"
rabbit_hosts => ['10.0.0.1','10.0.0.2']}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_hosts').with_value(['10.0.0.1,10.0.0.2'])
@@ -186,7 +188,10 @@ describe 'trove::api' do
kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
kombu_ssl_certfile => '/path/to/ssl/cert/file',
kombu_ssl_keyfile => '/path/to/ssl/keyfile',
kombu_ssl_version => 'TLSv1'}"
kombu_ssl_version => 'TLSv1'}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it do
@@ -202,7 +207,10 @@ describe 'trove::api' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true}"
rabbit_use_ssl => true}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it do
@@ -218,7 +226,10 @@ describe 'trove::api' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false}"
rabbit_use_ssl => false}
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it do
@@ -235,7 +246,10 @@ describe 'trove::api' do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }"
notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it do
@@ -248,7 +262,10 @@ describe 'trove::api' do
let :pre_condition do
"class { 'trove' :
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'amqp' }"
rpc_backend => 'amqp' }
class { '::trove::keystone::authtoken':
password => 'a_big_secret',
}"
end
it do