diff --git a/manifests/objectstore.pp b/manifests/objectstore.pp index c26afac17..84e27dc85 100644 --- a/manifests/objectstore.pp +++ b/manifests/objectstore.pp @@ -16,10 +16,15 @@ # (optional) The package state to set # Defaults to 'present' # +# [*bind_address*] +# (optional) The address to bind to +# Defaults to '0.0.0.0' +# class nova::objectstore( $enabled = false, $manage_service = true, - $ensure_package = 'present' + $ensure_package = 'present', + $bind_address = '0.0.0.0' ) { include nova::params @@ -32,4 +37,7 @@ class nova::objectstore( ensure_package => $ensure_package, } + nova_config { + 'DEFAULT/s3_listen': value => $bind_address; + } } diff --git a/spec/classes/nova_objectstore_spec.rb b/spec/classes/nova_objectstore_spec.rb index 5f1a1d386..7d0477d24 100644 --- a/spec/classes/nova_objectstore_spec.rb +++ b/spec/classes/nova_objectstore_spec.rb @@ -15,6 +15,15 @@ describe 'nova::objectstore' do :name => 'nova-objectstore', :package_name => 'nova-objectstore', :service_name => 'nova-objectstore' } + it { should contain_nova_config('DEFAULT/s3_listen').with_value('0.0.0.0') } + + context 'with custom bind parameter' do + let :params do + { :bind_address => '192.168.0.1'} + end + it { should contain_nova_config('DEFAULT/s3_listen').with_value('192.168.0.1') } + end + end context 'on RedHat platforms' do @@ -26,5 +35,14 @@ describe 'nova::objectstore' do :name => 'nova-objectstore', :package_name => 'openstack-nova-objectstore', :service_name => 'openstack-nova-objectstore' } + it { should contain_nova_config('DEFAULT/s3_listen').with_value('0.0.0.0')} + + context 'with custom bind parameter' do + let :params do + { :bind_address => '192.168.0.1'} + end + it { should contain_nova_config('DEFAULT/s3_listen').with_value('192.168.0.1') } + end + end end