API bind address customizable
This commit is contained in:
parent
440d8077fb
commit
a867719e5d
|
@ -7,7 +7,8 @@ class nova::api(
|
|||
$auth_protocol = 'http',
|
||||
$admin_tenant_name = 'services',
|
||||
$admin_user = 'nova',
|
||||
$admin_password = 'passw0rd'
|
||||
$admin_password = 'passw0rd',
|
||||
$api_bind_address = '0.0.0.0',
|
||||
) {
|
||||
|
||||
include nova::params
|
||||
|
@ -33,6 +34,13 @@ class nova::api(
|
|||
|
||||
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':
|
||||
content => template('nova/api-paste.ini.erb'),
|
||||
require => Class['nova'],
|
||||
|
|
|
@ -44,7 +44,7 @@ describe 'nova::api' do
|
|||
)}
|
||||
end
|
||||
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',
|
||||
[
|
||||
'[filter:authtoken]',
|
||||
|
@ -55,10 +55,14 @@ describe 'nova::api' do
|
|||
'auth_uri = http://127.0.0.1:35357/v2.0',
|
||||
'admin_tenant_name = services',
|
||||
'admin_user = nova',
|
||||
'admin_password = passw0rd'
|
||||
'admin_password = passw0rd',
|
||||
]
|
||||
)
|
||||
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
|
||||
describe 'with params' do
|
||||
let :params do
|
||||
|
@ -69,10 +73,11 @@ describe 'nova::api' do
|
|||
:auth_protocol => 'https',
|
||||
:admin_tenant_name => 'service2',
|
||||
:admin_user => 'nova2',
|
||||
:admin_password => 'passw0rd2'
|
||||
:admin_password => 'passw0rd2',
|
||||
:api_bind_address => '192.168.56.210',
|
||||
}
|
||||
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',
|
||||
[
|
||||
'[filter:authtoken]',
|
||||
|
@ -83,10 +88,14 @@ describe 'nova::api' do
|
|||
'auth_uri = https://10.0.0.1:1234/v2.0',
|
||||
'admin_tenant_name = service2',
|
||||
'admin_user = nova2',
|
||||
'admin_password = passw0rd2'
|
||||
'admin_password = passw0rd2',
|
||||
]
|
||||
)
|
||||
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
|
||||
describe 'on rhel' do
|
||||
|
|
Loading…
Reference in New Issue