diff --git a/data/common.yaml b/data/common.yaml index ebba0b6..9cc1d2a 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -8,7 +8,7 @@ limits::manage_limits_d_dir: true limits::purge_limits_d_dir: true limits::limits_file: /etc/security/limits.conf -limits::manage_limits_file: false +limits::manage_limits_file: true limits::limits_file_owner: 'root' limits::limits_file_group: 'root' limits::limits_file_mode: '0644' diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 7318f1f..b957896 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -28,7 +28,12 @@ end it do - is_expected.not_to contain_file('/etc/security/limits.conf') + is_expected.to contain_file('/etc/security/limits.conf').with( + 'ensure' => 'file', + 'owner' => 'root', + 'group' => 'root', + 'mode' => '0644' + ) end end @@ -61,20 +66,15 @@ it { is_expected.not_to contain_file('/etc/security/limits.d') } end - describe 'with manage_limits_file set to true' do + describe 'with manage_limits_file set to false' do let :params do { - manage_limits_file: true + manage_limits_file: false } end it do - is_expected.to contain_file('/etc/security/limits.conf').with( - 'ensure' => 'file', - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0644' - ) + is_expected.not_to contain_file('/etc/security/limits.conf') end end end