Merge pull request #83 from enovance/sileht/pr/publicport
Allow to have a different internal port and public port
This commit is contained in:
commit
26c270f164
@ -6,9 +6,15 @@ class swift::keystone::auth(
|
|||||||
$tenant = 'services',
|
$tenant = 'services',
|
||||||
$email = 'swift@localhost',
|
$email = 'swift@localhost',
|
||||||
$region = 'RegionOne',
|
$region = 'RegionOne',
|
||||||
$public_protocol = 'http'
|
$public_protocol = 'http',
|
||||||
|
$public_port = undef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if ! $public_port {
|
||||||
|
$real_public_port = $port
|
||||||
|
} else {
|
||||||
|
$real_public_port = $public_port
|
||||||
|
}
|
||||||
keystone_user { $auth_name:
|
keystone_user { $auth_name:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
password => $password,
|
password => $password,
|
||||||
@ -28,7 +34,7 @@ class swift::keystone::auth(
|
|||||||
}
|
}
|
||||||
keystone_endpoint { "${region}/${auth_name}":
|
keystone_endpoint { "${region}/${auth_name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
public_url => "${public_protocol}://${address}:${port}/v1/AUTH_%(tenant_id)s",
|
public_url => "${public_protocol}://${address}:${real_public_port}/v1/AUTH_%(tenant_id)s",
|
||||||
admin_url => "http://${address}:${port}/",
|
admin_url => "http://${address}:${port}/",
|
||||||
internal_url => "http://${address}:${port}/v1/AUTH_%(tenant_id)s",
|
internal_url => "http://${address}:${port}/v1/AUTH_%(tenant_id)s",
|
||||||
}
|
}
|
||||||
@ -40,7 +46,7 @@ class swift::keystone::auth(
|
|||||||
}
|
}
|
||||||
keystone_endpoint { "${region}/${auth_name}_s3":
|
keystone_endpoint { "${region}/${auth_name}_s3":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
public_url => "${public_protocol}://${address}:${port}",
|
public_url => "${public_protocol}://${address}:${real_public_port}",
|
||||||
admin_url => "http://${address}:${port}",
|
admin_url => "http://${address}:${port}",
|
||||||
internal_url => "http://${address}:${port}",
|
internal_url => "http://${address}:${port}",
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,32 @@ describe 'swift::keystone::auth' do
|
|||||||
) }
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'when overriding public_port' do
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:public_port => '80'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_keystone_endpoint('RegionOne/swift').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:public_url => "http://127.0.0.1:80/v1/AUTH_%(tenant_id)s",
|
||||||
|
:admin_url => "http://127.0.0.1:8080/",
|
||||||
|
:internal_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s"
|
||||||
|
) }
|
||||||
|
|
||||||
|
it { should contain_keystone_endpoint('RegionOne/swift_s3').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:public_url => 'http://127.0.0.1:80',
|
||||||
|
:admin_url => 'http://127.0.0.1:8080',
|
||||||
|
:internal_url => 'http://127.0.0.1:8080'
|
||||||
|
) }
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
describe 'when overriding password' do
|
describe 'when overriding password' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
|
Loading…
Reference in New Issue
Block a user