File tree Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 1
1
# Create an empty NSS database with a password file.
2
2
#
3
3
# Parameters:
4
- # $owner - required - the file/directory user
5
- # $group - required - the file/directory group
6
- # $password - required - password to set on the database
7
- # $mode - optional - defaults to '0600'
8
- # $certdir_mode - optional - defaults to '0700'
4
+ # $owner - required - the file/directory user
5
+ # $group - required - the file/directory group
6
+ # $password - required - password to set on the database
7
+ # $certdir - optional - defaults to title
8
+ # $mode - optional - defaults to '0600'
9
+ # $certdir_mode - optional - defaults to '0700'
9
10
#
10
11
# Actions:
11
12
# creates a new NSS database, consisting of 4 files:
29
30
$owner ,
30
31
$group ,
31
32
$password ,
33
+ $certdir = $title,
32
34
$mode = ' 0600' ,
33
35
$certdir_mode = ' 0700' ,
34
36
$manage_certdir = true
35
37
) {
36
38
include nssdb
37
39
38
- validate_absolute_path($title )
39
- $certdir = $title
40
+ validate_absolute_path($certdir )
40
41
41
42
if $manage_certdir {
42
43
file { $certdir:
43
- ensure => directory ,
44
- mode => $certdir_mode ,
45
- owner => $owner ,
46
- group => $group ,
44
+ ensure => directory ,
45
+ mode => $certdir_mode ,
46
+ owner => $owner ,
47
+ group => $group ,
47
48
}
48
49
49
50
$require_certdir = File [$certdir ]
Original file line number Diff line number Diff line change 69
69
end # default params
70
70
71
71
context 'all params' do
72
- let ( :title ) { '/obsolete' }
72
+ # when certdir is set, title should not have to be an absolute path
73
+ let ( :title ) { 'foo' }
73
74
let ( :params ) do
74
75
{
76
+ :certdir => '/obsolete' ,
75
77
:owner => 'nobody' ,
76
78
:group => 'nobody' ,
77
79
:mode => '0660' ,
104
106
:owner => 'nobody' ,
105
107
:group => 'nobody' ,
106
108
:mode => '0660' ,
107
- :require => [ 'File[/obsolete/password.conf]' , 'Exec[create_nss_db_/obsolete ]' ]
109
+ :require => [ 'File[/obsolete/password.conf]' , 'Exec[create_nss_db_foo ]' ]
108
110
)
109
111
end
110
112
end
111
113
end
112
114
113
115
context 'create nss db' do
114
116
it do
115
- should contain_exec ( 'create_nss_db_/obsolete ' ) . with (
117
+ should contain_exec ( 'create_nss_db_foo ' ) . with (
116
118
:command => %r{-d /obsolete -f /obsolete} ,
117
119
:creates => [
118
120
'/obsolete/cert8.db' ,
You can’t perform that action at this time.
0 commit comments