add parameter for endpoint protocols
This gives the ability to specify https endpoint for internal and/or admin endpoints. Change-Id: I5f936593f83ce8f00338709e5864f7d00f9d0d8c backport: havana
This commit is contained in:

committed by
Gerrit Code Review

parent
5f8a944a46
commit
50f0716b67
@@ -63,6 +63,12 @@
|
|||||||
# (optional) Protocol to use for the public endpoint. Can be http or https.
|
# (optional) Protocol to use for the public endpoint. Can be http or https.
|
||||||
# Defaults to 'http'
|
# Defaults to 'http'
|
||||||
#
|
#
|
||||||
|
# [*admin_protocol*]
|
||||||
|
# Protocol for admin endpoints. Defaults to 'http'.
|
||||||
|
#
|
||||||
|
# [*internal_protocol*]
|
||||||
|
# Protocol for internal endpoints. Defaults to 'http'.
|
||||||
|
#
|
||||||
class nova::keystone::auth(
|
class nova::keystone::auth(
|
||||||
$password,
|
$password,
|
||||||
$auth_name = 'nova',
|
$auth_name = 'nova',
|
||||||
@@ -78,7 +84,9 @@ class nova::keystone::auth(
|
|||||||
$configure_ec2_endpoint = true,
|
$configure_ec2_endpoint = true,
|
||||||
$cinder = undef,
|
$cinder = undef,
|
||||||
$public_protocol = 'http',
|
$public_protocol = 'http',
|
||||||
$configure_endpoint = true
|
$configure_endpoint = true,
|
||||||
|
$admin_protocol = 'http',
|
||||||
|
$internal_protocol = 'http'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if $cinder != undef {
|
if $cinder != undef {
|
||||||
@@ -107,8 +115,8 @@ class nova::keystone::auth(
|
|||||||
keystone_endpoint { "${region}/${auth_name}":
|
keystone_endpoint { "${region}/${auth_name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
public_url => "${public_protocol}://${public_address}:${compute_port}/${compute_version}/%(tenant_id)s",
|
public_url => "${public_protocol}://${public_address}:${compute_port}/${compute_version}/%(tenant_id)s",
|
||||||
admin_url => "http://${admin_address}:${compute_port}/${compute_version}/%(tenant_id)s",
|
admin_url => "${admin_protocol}://${admin_address}:${compute_port}/${compute_version}/%(tenant_id)s",
|
||||||
internal_url => "http://${internal_address}:${compute_port}/${compute_version}/%(tenant_id)s",
|
internal_url => "${internal_protocol}://${internal_address}:${compute_port}/${compute_version}/%(tenant_id)s",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,8 +129,8 @@ class nova::keystone::auth(
|
|||||||
keystone_endpoint { "${region}/${auth_name}_ec2":
|
keystone_endpoint { "${region}/${auth_name}_ec2":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
public_url => "${public_protocol}://${public_address}:${ec2_port}/services/Cloud",
|
public_url => "${public_protocol}://${public_address}:${ec2_port}/services/Cloud",
|
||||||
admin_url => "http://${admin_address}:${ec2_port}/services/Admin",
|
admin_url => "${admin_protocol}://${admin_address}:${ec2_port}/services/Admin",
|
||||||
internal_url => "http://${internal_address}:${ec2_port}/services/Cloud",
|
internal_url => "${internal_protocol}://${internal_address}:${ec2_port}/services/Cloud",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -78,28 +78,31 @@ describe 'nova::keystone::auth' do
|
|||||||
context 'when overriding endpoint params' do
|
context 'when overriding endpoint params' do
|
||||||
before do
|
before do
|
||||||
params.merge!(
|
params.merge!(
|
||||||
:public_address => '10.0.0.1',
|
:public_address => '10.0.0.1',
|
||||||
:admin_address => '10.0.0.2',
|
:admin_address => '10.0.0.2',
|
||||||
:internal_address => '10.0.0.3',
|
:internal_address => '10.0.0.3',
|
||||||
:compute_port => '9774',
|
:compute_port => '9774',
|
||||||
:ec2_port => '9773',
|
:ec2_port => '9773',
|
||||||
:compute_version => 'v2.2',
|
:compute_version => 'v2.2',
|
||||||
:region => 'RegionTwo'
|
:region => 'RegionTwo',
|
||||||
|
:admin_protocol => 'https',
|
||||||
|
:internal_protocol => 'https',
|
||||||
|
:public_protocol => 'https'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('RegionTwo/nova').with(
|
it { should contain_keystone_endpoint('RegionTwo/nova').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:public_url => 'http://10.0.0.1:9774/v2.2/%(tenant_id)s',
|
:public_url => 'https://10.0.0.1:9774/v2.2/%(tenant_id)s',
|
||||||
:admin_url => 'http://10.0.0.2:9774/v2.2/%(tenant_id)s',
|
:admin_url => 'https://10.0.0.2:9774/v2.2/%(tenant_id)s',
|
||||||
:internal_url => 'http://10.0.0.3:9774/v2.2/%(tenant_id)s'
|
:internal_url => 'https://10.0.0.3:9774/v2.2/%(tenant_id)s'
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { should contain_keystone_endpoint('RegionTwo/nova_ec2').with(
|
it { should contain_keystone_endpoint('RegionTwo/nova_ec2').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:public_url => 'http://10.0.0.1:9773/services/Cloud',
|
:public_url => 'https://10.0.0.1:9773/services/Cloud',
|
||||||
:admin_url => 'http://10.0.0.2:9773/services/Admin',
|
:admin_url => 'https://10.0.0.2:9773/services/Admin',
|
||||||
:internal_url => 'http://10.0.0.3:9773/services/Cloud'
|
:internal_url => 'https://10.0.0.3:9773/services/Cloud'
|
||||||
)}
|
)}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user