diff --git a/manifests/compute/nova.pp b/manifests/compute/nova.pp index 34d5751d..62a93515 100644 --- a/manifests/compute/nova.pp +++ b/manifests/compute/nova.pp @@ -48,8 +48,7 @@ # # [*password*] # (optional) User's password -# Only required if auth_type has been set to "password" -# Defaults to undef +# Defaults to $::os_service_default # class manila::compute::nova ( $insecure = $::os_service_default, @@ -62,27 +61,22 @@ class manila::compute::nova ( $region_name = $::os_service_default, $endpoint_type = $::os_service_default, $username = 'nova', - $password = undef, + $password = $::os_service_default, ) { include manila::deps manila_config { - 'nova/insecure': value => $insecure; - 'nova/auth_url': value => $auth_url; - 'nova/auth_type': value => $auth_type; - 'nova/cafile': value => $cafile; - 'nova/region_name': value => $region_name; - 'nova/endpoint_type': value => $endpoint_type; - } - - if $auth_type == 'password' { - manila_config { - 'nova/username': value => $username; - 'nova/user_domain_name': value => $user_domain_name; - 'nova/password': value => $password, secret => true; - 'nova/project_name': value => $project_name; - 'nova/project_domain_name': value => $project_domain_name; - } + 'nova/insecure': value => $insecure; + 'nova/auth_url': value => $auth_url; + 'nova/auth_type': value => $auth_type; + 'nova/cafile': value => $cafile; + 'nova/region_name': value => $region_name; + 'nova/endpoint_type': value => $endpoint_type; + 'nova/username': value => $username; + 'nova/user_domain_name': value => $user_domain_name; + 'nova/password': value => $password, secret => true; + 'nova/project_name': value => $project_name; + 'nova/project_domain_name': value => $project_domain_name; } } diff --git a/manifests/network/neutron.pp b/manifests/network/neutron.pp index d9bc7ea2..dd363c47 100644 --- a/manifests/network/neutron.pp +++ b/manifests/network/neutron.pp @@ -52,7 +52,7 @@ # # [*password*] # (optional) User's password -# Defaults to undef +# Defaults to $::os_service_default # # [*network_plugin_ipv4_enabled*] # (optional) Whether to support Ipv4 network resource @@ -74,7 +74,7 @@ class manila::network::neutron ( $timeout = $::os_service_default, $endpoint_type = $::os_service_default, $username = 'neutron', - $password = undef, + $password = $::os_service_default, $network_plugin_ipv4_enabled = $::os_service_default, $network_plugin_ipv6_enabled = $::os_service_default, ) { @@ -90,17 +90,12 @@ class manila::network::neutron ( 'neutron/region_name': value => $region_name; 'neutron/timeout': value => $timeout; 'neutron/endpoint_type': value => $endpoint_type; + 'neutron/username': value => $username; + 'neutron/user_domain_name': value => $user_domain_name; + 'neutron/password': value => $password, secret => true; + 'neutron/project_name': value => $project_name; + 'neutron/project_domain_name': value => $project_domain_name; 'DEFAULT/network_plugin_ipv4_enabled': value => $network_plugin_ipv4_enabled; 'DEFAULT/network_plugin_ipv6_enabled': value => $network_plugin_ipv6_enabled; - } - - if $auth_type == 'password' { - manila_config { - 'neutron/username': value => $username; - 'neutron/user_domain_name': value => $user_domain_name; - 'neutron/password': value => $password, secret => true; - 'neutron/project_name': value => $project_name; - 'neutron/project_domain_name': value => $project_domain_name; - } } } diff --git a/manifests/volume/cinder.pp b/manifests/volume/cinder.pp index 24e43135..bc5d5116 100644 --- a/manifests/volume/cinder.pp +++ b/manifests/volume/cinder.pp @@ -48,8 +48,7 @@ # # [*password*] # (optional) User's password -# Only required if auth_type has been set to "password" -# Defaults to undef +# Defaults to $::os_service_default # # [*http_retries*] # (optional) Number of cinderclient retries on failed http calls. @@ -92,7 +91,7 @@ # # [*cinder_admin_password*] # (optional) Cinder admin password. -# Defaults to undef +# Defaults to $::os_service_default # # [*cinder_admin_tenant_name*] # (optional) Cinder admin tenant name @@ -113,7 +112,7 @@ class manila::volume::cinder ( $region_name = $::os_service_default, $endpoint_type = $::os_service_default, $username = 'cinder', - $password = undef, + $password = $::os_service_default, $http_retries = $::os_service_default, $cross_az_attach = $::os_service_default, # DEPRECATED PARAMETERS @@ -176,23 +175,18 @@ class manila::volume::cinder ( $cross_az_attach_real = pick($cinder_cross_az_attach, $cross_az_attach) manila_config { - 'cinder/insecure': value => $insecure_real; - 'cinder/auth_url': value => $auth_url_real; - 'cinder/auth_type': value => $auth_type; - 'cinder/cafile': value => $cafile_real; - 'cinder/region_name': value => $region_name; - 'cinder/endpoint_type': value => $endpoint_type; - 'cinder/http_retries': value => $http_retries_real; - 'cinder/cross_az_attach': value => $cross_az_attach_real; - } - - if $auth_type == 'password' { - manila_config { - 'cinder/username': value => $username_real; - 'cinder/user_domain_name': value => $user_domain_name; - 'cinder/password': value => $password_real, secret => true; - 'cinder/project_name': value => $project_name_real; - 'cinder/project_domain_name': value => $project_domain_name; - } + 'cinder/insecure': value => $insecure_real; + 'cinder/auth_url': value => $auth_url_real; + 'cinder/auth_type': value => $auth_type; + 'cinder/cafile': value => $cafile_real; + 'cinder/region_name': value => $region_name; + 'cinder/endpoint_type': value => $endpoint_type; + 'cinder/username': value => $username_real; + 'cinder/user_domain_name': value => $user_domain_name; + 'cinder/password': value => $password_real, secret => true; + 'cinder/project_name': value => $project_name_real; + 'cinder/project_domain_name': value => $project_domain_name; + 'cinder/http_retries': value => $http_retries_real; + 'cinder/cross_az_attach': value => $cross_az_attach_real; } } diff --git a/releasenotes/notes/auth_type-fix-62bc3acab9700deb.yaml b/releasenotes/notes/auth_type-fix-62bc3acab9700deb.yaml new file mode 100644 index 00000000..36ae66a7 --- /dev/null +++ b/releasenotes/notes/auth_type-fix-62bc3acab9700deb.yaml @@ -0,0 +1,10 @@ +--- +fixes: + - | + Now the following classes set keystone_credential parameters lik username + in manila.conf, even auth_type is not ``password``. This fixes the problem + with the other auth_type value like ``v3password``. + + - ``manila::compute::nova`` + - ``manila::network::neutron`` + - ``manila::volume::cinder`` diff --git a/spec/classes/manila_compute_nova_spec.rb b/spec/classes/manila_compute_nova_spec.rb index ef122b34..2515aac1 100644 --- a/spec/classes/manila_compute_nova_spec.rb +++ b/spec/classes/manila_compute_nova_spec.rb @@ -8,15 +8,13 @@ describe 'manila::compute::nova' do is_expected.to contain_manila_config('nova/auth_url').with_value('') is_expected.to contain_manila_config('nova/auth_type').with_value('') is_expected.to contain_manila_config('nova/cafile').with_value('') + is_expected.to contain_manila_config('nova/user_domain_name').with_value('Default') + is_expected.to contain_manila_config('nova/project_domain_name').with_value('Default') + is_expected.to contain_manila_config('nova/project_name').with_value('services') is_expected.to contain_manila_config('nova/region_name').with_value('') is_expected.to contain_manila_config('nova/endpoint_type').with_value('') - - # These should be added only when auth_type is 'password' - is_expected.not_to contain_manila_config('nova/user_domain_name') - is_expected.not_to contain_manila_config('nova/project_domain_name') - is_expected.not_to contain_manila_config('nova/project_name') - is_expected.not_to contain_manila_config('nova/username') - is_expected.not_to contain_manila_config('nova/password') + is_expected.to contain_manila_config('nova/username').with_value('nova') + is_expected.to contain_manila_config('nova/password').with_value('') end end diff --git a/spec/classes/manila_network_neutron_spec.rb b/spec/classes/manila_network_neutron_spec.rb index dfac6790..5b51dd3d 100644 --- a/spec/classes/manila_network_neutron_spec.rb +++ b/spec/classes/manila_network_neutron_spec.rb @@ -8,18 +8,16 @@ describe 'manila::network::neutron' do is_expected.to contain_manila_config('neutron/auth_url').with_value('') is_expected.to contain_manila_config('neutron/auth_type').with_value('') is_expected.to contain_manila_config('neutron/cafile').with_value('') + is_expected.to contain_manila_config('neutron/user_domain_name').with_value('Default') + is_expected.to contain_manila_config('neutron/project_domain_name').with_value('Default') + is_expected.to contain_manila_config('neutron/project_name').with_value('services') is_expected.to contain_manila_config('neutron/region_name').with_value('') is_expected.to contain_manila_config('neutron/timeout').with_value('') is_expected.to contain_manila_config('neutron/endpoint_type').with_value('') + is_expected.to contain_manila_config('neutron/username').with_value('neutron') + is_expected.to contain_manila_config('neutron/password').with_value('') is_expected.to contain_manila_config('DEFAULT/network_plugin_ipv4_enabled').with_value('') is_expected.to contain_manila_config('DEFAULT/network_plugin_ipv6_enabled').with_value('') - - # These should be added only when auth_type is 'password' - is_expected.not_to contain_manila_config('neutron/user_domain_name') - is_expected.not_to contain_manila_config('neutron/project_domain_name') - is_expected.not_to contain_manila_config('neutron/project_name') - is_expected.not_to contain_manila_config('neutron/username') - is_expected.not_to contain_manila_config('neutron/password') end end diff --git a/spec/classes/manila_volume_cinder.rb b/spec/classes/manila_volume_cinder.rb index 1437f8c7..575dba3b 100644 --- a/spec/classes/manila_volume_cinder.rb +++ b/spec/classes/manila_volume_cinder.rb @@ -10,15 +10,13 @@ describe 'manila::volume::cinder' do is_expected.to contain_manila_config('cinder/cafile').with_value('') is_expected.to contain_manila_config('cinder/region_name').with_value('') is_expected.to contain_manila_config('cinder/endpoint_type').with_value('') + is_expected.to contain_manila_config('cinder/user_domain_name').with_value('Default') + is_expected.to contain_manila_config('cinder/project_domain_name').with_value('Default') + is_expected.to contain_manila_config('cinder/project_name').with_value('services') + is_expected.to contain_manila_config('cinder/username').with_value('cinder') + is_expected.to contain_manila_config('cinder/password').with_value('') is_expected.to contain_manila_config('cinder/http_retries').with_value('') is_expected.to contain_manila_config('cinder/cross_az_attach').with_value('') - - # These should be added only when auth_type is 'password' - is_expected.not_to contain_manila_config('cinder/user_domain_name') - is_expected.not_to contain_manila_config('cinder/project_domain_name') - is_expected.not_to contain_manila_config('cinder/project_name') - is_expected.not_to contain_manila_config('cinder/username') - is_expected.not_to contain_manila_config('cinder/password') end end