From 4b32158c1e46d0fa2aaf4a42d509a7840462f33e Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sun, 3 Jul 2016 20:22:00 -0400 Subject: [PATCH] Add user_domain_name and project_domain_name - Add user_domain_name and project_domain_name set to 'Default' by default. - Change project_domain_id and user_domain_id to be os_service_default. This change is required with latest Keystone, as we need to specify domain names to authentificate against Keystone. Change-Id: Id3debd30aec0c3925c92332afe99fb092c006d1a --- manifests/server.pp | 40 ++++++++++++------- .../notes/domain_name-4070c4ee0f0357f4.yaml | 3 ++ spec/classes/neutron_server_spec.rb | 34 ++++++++-------- 3 files changed, 47 insertions(+), 30 deletions(-) create mode 100644 releasenotes/notes/domain_name-4070c4ee0f0357f4.yaml diff --git a/manifests/server.pp b/manifests/server.pp index 78572b92c..4a34844a9 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -54,6 +54,10 @@ # # [*project_domain_id*] # (optional) Auth user project's domain ID +# Defaults to $::os_service_default +# +# [*project_domain_name*] +# (optional) Auth user project's domain name # Defaults to 'Default' # # [*project_name*] @@ -62,6 +66,10 @@ # # [*user_domain_id*] # (optional) Auth user's domain ID +# Defaults to $::os_service_default +# +# [*user_domain_name*] +# (optional) Auth user's domain name # Defaults to 'Default' # # [*region_name*] @@ -329,9 +337,11 @@ class neutron::server ( $username = 'neutron', $password = false, $region_name = $::os_service_default, - $project_domain_id = 'Default', + $project_domain_id = $::os_service_default, + $project_domain_name = 'Default', $project_name = 'services', - $user_domain_id = 'Default', + $user_domain_id = $::os_service_default, + $user_domain_name = 'Default', $database_connection = undef, $database_max_retries = undef, $database_idle_timeout = undef, @@ -552,18 +562,20 @@ class neutron::server ( } neutron_config { - 'keystone_authtoken/auth_url': value => $auth_url; - 'keystone_authtoken/username': value => $username; - 'keystone_authtoken/password': value => $password, secret => true; - 'keystone_authtoken/region_name': value => $region_name; - 'keystone_authtoken/project_domain_id': value => $project_domain_id; - 'keystone_authtoken/project_name': value => $project_name_real; - 'keystone_authtoken/user_domain_id': value => $user_domain_id; - 'keystone_authtoken/admin_tenant_name': ensure => absent; - 'keystone_authtoken/admin_user': ensure => absent; - 'keystone_authtoken/admin_password': ensure => absent; - 'keystone_authtoken/auth_region': ensure => absent; - 'keystone_authtoken/identity_uri': ensure => absent; + 'keystone_authtoken/auth_url': value => $auth_url; + 'keystone_authtoken/username': value => $username; + 'keystone_authtoken/password': value => $password, secret => true; + 'keystone_authtoken/region_name': value => $region_name; + 'keystone_authtoken/project_domain_id': value => $project_domain_id; + 'keystone_authtoken/project_domain_name': value => $project_domain_name; + 'keystone_authtoken/project_name': value => $project_name_real; + 'keystone_authtoken/user_domain_id': value => $user_domain_id; + 'keystone_authtoken/user_domain_name': value => $user_domain_name; + 'keystone_authtoken/admin_tenant_name': ensure => absent; + 'keystone_authtoken/admin_user': ensure => absent; + 'keystone_authtoken/admin_password': ensure => absent; + 'keystone_authtoken/auth_region': ensure => absent; + 'keystone_authtoken/identity_uri': ensure => absent; } neutron_api_config { 'filter:authtoken/admin_tenant_name': ensure => absent; diff --git a/releasenotes/notes/domain_name-4070c4ee0f0357f4.yaml b/releasenotes/notes/domain_name-4070c4ee0f0357f4.yaml new file mode 100644 index 000000000..815ee046f --- /dev/null +++ b/releasenotes/notes/domain_name-4070c4ee0f0357f4.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add user_domain_name and project_domain_name parameters. diff --git a/spec/classes/neutron_server_spec.rb b/spec/classes/neutron_server_spec.rb index 844ab6b0a..912672a8e 100644 --- a/spec/classes/neutron_server_spec.rb +++ b/spec/classes/neutron_server_spec.rb @@ -7,12 +7,12 @@ describe 'neutron::server' do end let :params do - { :password => 'passw0rd', - :username => 'neutron', - :keystone_auth_type => 'password', - :project_domain_id => 'Default', - :project_name => 'services', - :user_domain_id => 'Default'} + { :password => 'passw0rd', + :username => 'neutron', + :keystone_auth_type => 'password', + :project_domain_name => 'Default', + :project_name => 'services', + :user_domain_name => 'Default'} end let :default_params do @@ -56,9 +56,11 @@ describe 'neutron::server' do is_expected.to contain_neutron_config('keystone_authtoken/password').with_secret( true ) is_expected.to contain_neutron_config('keystone_authtoken/auth_uri').with_value("http://localhost:5000/"); is_expected.to contain_neutron_config('keystone_authtoken/auth_url').with_value("http://localhost:35357/"); - is_expected.to contain_neutron_config('keystone_authtoken/project_domain_id').with_value(p[:project_domain_id]); + is_expected.to contain_neutron_config('keystone_authtoken/project_domain_name').with_value(p[:project_domain_name]); + is_expected.to contain_neutron_config('keystone_authtoken/project_domain_id').with_value(''); is_expected.to contain_neutron_config('keystone_authtoken/project_name').with_value(p[:project_name]); - is_expected.to contain_neutron_config('keystone_authtoken/user_domain_id').with_value(p[:user_domain_id]); + is_expected.to contain_neutron_config('keystone_authtoken/user_domain_name').with_value(p[:user_domain_name]); + is_expected.to contain_neutron_config('keystone_authtoken/user_domain_id').with_value(''); is_expected.to contain_neutron_config('keystone_authtoken/admin_tenant_name').with_ensure('absent'); is_expected.to contain_neutron_config('keystone_authtoken/admin_user').with_ensure('absent'); is_expected.to contain_neutron_config('keystone_authtoken/admin_password').with_ensure('absent'); @@ -340,20 +342,20 @@ describe 'neutron::server' do end before do params.merge!({ - :auth_uri => 'https://foo.bar:5000/', - :auth_url => 'https://foo.bar:35357/v3', - :keystone_auth_type => 'v3password', - :project_domain_id => 'non_default', - :project_name => 'new_services', - :user_domain_id => 'non_default' + :auth_uri => 'https://foo.bar:5000/', + :auth_url => 'https://foo.bar:35357/v3', + :keystone_auth_type => 'v3password', + :project_domain_name => 'non_default', + :project_name => 'new_services', + :user_domain_name => 'non_default' }) end it 'configures keystone authentication params' do is_expected.to contain_neutron_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/"); is_expected.to contain_neutron_config('keystone_authtoken/auth_url').with_value("https://foo.bar:35357/v3"); - is_expected.to contain_neutron_config('keystone_authtoken/project_domain_id').with_value("non_default"); + is_expected.to contain_neutron_config('keystone_authtoken/project_domain_name').with_value("non_default"); is_expected.to contain_neutron_config('keystone_authtoken/project_name').with_value("new_services"); - is_expected.to contain_neutron_config('keystone_authtoken/user_domain_id').with_value("non_default"); + is_expected.to contain_neutron_config('keystone_authtoken/user_domain_name').with_value("non_default"); end end