diff --git a/manifests/init.pp b/manifests/init.pp index b520f195a..ad70c7715 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -565,7 +565,7 @@ class nova( ensure => directory, mode => '0750', owner => 'nova', - group => 'nova', + group => $::nova::params::nova_log_group, require => Package['nova-common'], } nova_config { 'DEFAULT/log_dir': value => $log_dir;} diff --git a/manifests/params.pp b/manifests/params.pp index d2f44e94d..647a2d9ab 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -42,6 +42,7 @@ class nova::params { # redhat specific config defaults $root_helper = 'sudo nova-rootwrap' $lock_path = '/var/lib/nova/tmp' + $nova_log_group = 'nova' case $::operatingsystem { 'Fedora': { $special_service_provider = undef @@ -99,6 +100,7 @@ class nova::params { $vncproxy_package_name = 'nova-consoleproxy' # Use default provider on Debian $special_service_provider = undef + $nova_log_group = 'nova' } default: { $spicehtml5proxy_package_name = 'nova-spiceproxy' @@ -106,6 +108,7 @@ class nova::params { $vncproxy_package_name = 'nova-novncproxy' # some of the services need to be started form the special upstart provider $special_service_provider = 'upstart' + $nova_log_group = 'adm' } } } diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index 4f8964e8f..abc421a88 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -28,7 +28,6 @@ describe 'nova' do :ensure => 'directory', :mode => '0750', :owner => 'nova', - :group => 'nova', :require => 'Package[nova-common]' ) should contain_file('/etc/nova/nova.conf').with( @@ -568,7 +567,8 @@ describe 'nova' do context 'on Debian platforms' do let :facts do - { :osfamily => 'Debian' } + { :osfamily => 'Debian', + :operatingsystem => 'Debian' } end let :platform_params do @@ -577,6 +577,26 @@ describe 'nova' do end it_behaves_like 'nova' + it 'creates the log folder with the right group for Debian' do + should contain_file('/var/log/nova').with(:group => 'nova') + end + end + + context 'on Ubuntu platforms' do + let :facts do + { :osfamily => 'Debian', + :operatingsystem => 'Ubuntu' } + end + + let :platform_params do + { :nova_common_package => 'nova-common', + :lock_path => '/var/lock/nova' } + end + + it_behaves_like 'nova' + it 'creates the log folder with the right group for Ubuntu' do + should contain_file('/var/log/nova').with(:group => 'adm') + end end context 'on RedHat platforms' do @@ -590,5 +610,9 @@ describe 'nova' do end it_behaves_like 'nova' + + it 'creates the log folder with the right group for RedHat' do + should contain_file('/var/log/nova').with(:group => 'nova') + end end end