From ca2174222031eca40cf4049d5f2776237b1da809 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Tue, 14 Jan 2014 13:57:56 -0700 Subject: [PATCH] add mode parameter to nssdb::create --- manifests/create.pp | 5 +++-- spec/defines/nssdb_create_spec.rb | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/create.pp b/manifests/create.pp index 32c49ff..3d29f29 100644 --- a/manifests/create.pp +++ b/manifests/create.pp @@ -34,6 +34,7 @@ $owner_id, $group_id, $password, + $mode = '0600', $basedir = '/etc/pki', $cacert = '/etc/pki/certs/CA/ca.crt', $canickname = 'CA', @@ -49,7 +50,7 @@ } file {"${basedir}/${dbname}/password.conf": ensure => file, - mode => 0600, + mode => $mode, owner => $owner_id, group => $group_id, content => $password, @@ -59,7 +60,7 @@ } file { ["${basedir}/${dbname}/cert8.db", "${basedir}/${dbname}/key3.db", "${basedir}/${dbname}/secmod.db"] : ensure => file, - mode => 0600, + mode => $mode, owner => $owner_id, group => $group_id, require => [ diff --git a/spec/defines/nssdb_create_spec.rb b/spec/defines/nssdb_create_spec.rb index bf95fa9..10fdf2f 100644 --- a/spec/defines/nssdb_create_spec.rb +++ b/spec/defines/nssdb_create_spec.rb @@ -5,6 +5,7 @@ let(:params) do { :owner_id => 'nobody', :group_id => 'nobody', + :mode => '0660', :password => 'secret', :basedir => '/obsolete', :cacert => '/ca.crt', @@ -24,6 +25,7 @@ it{ should contain_file('/obsolete/test/password.conf').with( :owner => 'nobody', :group => 'nobody', + :mode => '0660', :content => 'secret', :require => 'File[/obsolete/test]' )} @@ -35,6 +37,7 @@ it{ should contain_file('/obsolete/test/' + db).with( :owner => 'nobody', :group => 'nobody', + :mode => '0660', :require => [ 'File[/obsolete/test/password.conf]', 'Exec[create_nss_db]'] )} end