Skip to content

Commit

Permalink
add mode parameter to nssdb::create
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed Jan 14, 2014
1 parent 398e639 commit ca21742
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions manifests/create.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
$owner_id,
$group_id,
$password,
$mode = '0600',
$basedir = '/etc/pki',
$cacert = '/etc/pki/certs/CA/ca.crt',
$canickname = 'CA',
Expand All @@ -49,7 +50,7 @@
}
file {"${basedir}/${dbname}/password.conf":
ensure => file,
mode => 0600,
mode => $mode,
owner => $owner_id,
group => $group_id,
content => $password,
Expand All @@ -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 => [
Expand Down
3 changes: 3 additions & 0 deletions spec/defines/nssdb_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
let(:params) do {
:owner_id => 'nobody',
:group_id => 'nobody',
:mode => '0660',
:password => 'secret',
:basedir => '/obsolete',
:cacert => '/ca.crt',
Expand All @@ -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]'
)}
Expand All @@ -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
Expand Down

0 comments on commit ca21742

Please sign in to comment.