Merge pull request #145 from Mirantis/api-bind-address
API bind address customizable
This commit is contained in:
commit
3a48cb5660
|
@ -7,7 +7,8 @@ class nova::api(
|
||||||
$auth_protocol = 'http',
|
$auth_protocol = 'http',
|
||||||
$admin_tenant_name = 'services',
|
$admin_tenant_name = 'services',
|
||||||
$admin_user = 'nova',
|
$admin_user = 'nova',
|
||||||
$admin_password = 'passw0rd'
|
$admin_password = 'passw0rd',
|
||||||
|
$api_bind_address = '0.0.0.0',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include nova::params
|
include nova::params
|
||||||
|
@ -33,6 +34,13 @@ class nova::api(
|
||||||
|
|
||||||
nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; }
|
nova_config { 'api_paste_config': value => '/etc/nova/api-paste.ini'; }
|
||||||
|
|
||||||
|
nova_config {
|
||||||
|
'ec2_listen': value => $api_bind_address;
|
||||||
|
'osapi_compute_listen': value => $api_bind_address;
|
||||||
|
'metadata_listen': value => $api_bind_address;
|
||||||
|
'osapi_volume_listen': value => $api_bind_address;
|
||||||
|
}
|
||||||
|
|
||||||
file { '/etc/nova/api-paste.ini':
|
file { '/etc/nova/api-paste.ini':
|
||||||
content => template('nova/api-paste.ini.erb'),
|
content => template('nova/api-paste.ini.erb'),
|
||||||
require => Class['nova'],
|
require => Class['nova'],
|
||||||
|
|
|
@ -44,7 +44,7 @@ describe 'nova::api' do
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
describe 'with defaults' do
|
describe 'with defaults' do
|
||||||
it 'should use default params for api-paste.init' do
|
it 'should use default params for api-paste.ini' do
|
||||||
verify_contents(subject, '/etc/nova/api-paste.ini',
|
verify_contents(subject, '/etc/nova/api-paste.ini',
|
||||||
[
|
[
|
||||||
'[filter:authtoken]',
|
'[filter:authtoken]',
|
||||||
|
@ -55,10 +55,14 @@ describe 'nova::api' do
|
||||||
'auth_uri = http://127.0.0.1:35357/v2.0',
|
'auth_uri = http://127.0.0.1:35357/v2.0',
|
||||||
'admin_tenant_name = services',
|
'admin_tenant_name = services',
|
||||||
'admin_user = nova',
|
'admin_user = nova',
|
||||||
'admin_password = passw0rd'
|
'admin_password = passw0rd',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
it { should contain_nova_config('ec2_listen').with('value' => '0.0.0.0') }
|
||||||
|
it { should contain_nova_config('osapi_compute_listen').with('value' => '0.0.0.0') }
|
||||||
|
it { should contain_nova_config('metadata_listen').with('value' => '0.0.0.0') }
|
||||||
|
it { should contain_nova_config('osapi_volume_listen').with('value' => '0.0.0.0') }
|
||||||
end
|
end
|
||||||
describe 'with params' do
|
describe 'with params' do
|
||||||
let :params do
|
let :params do
|
||||||
|
@ -69,10 +73,11 @@ describe 'nova::api' do
|
||||||
:auth_protocol => 'https',
|
:auth_protocol => 'https',
|
||||||
:admin_tenant_name => 'service2',
|
:admin_tenant_name => 'service2',
|
||||||
:admin_user => 'nova2',
|
:admin_user => 'nova2',
|
||||||
:admin_password => 'passw0rd2'
|
:admin_password => 'passw0rd2',
|
||||||
|
:api_bind_address => '192.168.56.210',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it 'should use default params for api-paste.init' do
|
it 'should use default params for api-paste.ini' do
|
||||||
verify_contents(subject, '/etc/nova/api-paste.ini',
|
verify_contents(subject, '/etc/nova/api-paste.ini',
|
||||||
[
|
[
|
||||||
'[filter:authtoken]',
|
'[filter:authtoken]',
|
||||||
|
@ -83,10 +88,14 @@ describe 'nova::api' do
|
||||||
'auth_uri = https://10.0.0.1:1234/v2.0',
|
'auth_uri = https://10.0.0.1:1234/v2.0',
|
||||||
'admin_tenant_name = service2',
|
'admin_tenant_name = service2',
|
||||||
'admin_user = nova2',
|
'admin_user = nova2',
|
||||||
'admin_password = passw0rd2'
|
'admin_password = passw0rd2',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
it { should contain_nova_config('ec2_listen').with('value' => '192.168.56.210') }
|
||||||
|
it { should contain_nova_config('osapi_compute_listen').with('value' => '192.168.56.210') }
|
||||||
|
it { should contain_nova_config('metadata_listen').with('value' => '192.168.56.210') }
|
||||||
|
it { should contain_nova_config('osapi_volume_listen').with('value' => '192.168.56.210') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe 'on rhel' do
|
describe 'on rhel' do
|
||||||
|
|
Loading…
Reference in New Issue