Skip to content

Commit 32a0e64

Browse files
committed
ensure relationships between ssl::certs and dependencies
1 parent 50343c0 commit 32a0e64

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

manifests/init.pp

+5
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414
group => 'root',
1515
mode => '0444',
1616
}
17+
18+
# make sure our package is installed and that our metadata directory
19+
# exists
20+
Class[ssl::package] -> Ssl::Cert<| |>
21+
File["${::ssl::params::crt_dir}/meta"] -> Ssl::Cert<| |>
1722
}

spec/classes/ssl_spec.rb

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
require 'spec_helper'
22

33
describe 'ssl', :type => :class do
4+
let :pre_condition do
5+
[
6+
'define ssl::cert {}',
7+
'ssl::cert { "certname": }'
8+
]
9+
end
10+
411
it do
5-
should contain_class('ssl::package').with_package('openssl')
12+
should \
13+
contain_class('ssl::package').
14+
with_package('openssl').
15+
that_comes_before('ssl::cert[certname]')
616
end
717

818
let :file_meta_params do
@@ -20,7 +30,8 @@
2030
it do
2131
should \
2232
contain_file('/etc/pki/tls/certs/meta').
23-
with(file_meta_params)
33+
with(file_meta_params).
34+
that_comes_before('ssl::cert[certname]')
2435
end
2536
end
2637

@@ -30,7 +41,8 @@
3041
it do
3142
should \
3243
contain_file('/etc/ssl/certs/meta').
33-
with(file_meta_params)
44+
with(file_meta_params).
45+
that_comes_before('ssl::cert[certname]')
3446
end
3547
end
3648

@@ -40,7 +52,8 @@
4052
it do
4153
should \
4254
contain_file('/etc/ssl/certs/meta').
43-
with(file_meta_params)
55+
with(file_meta_params).
56+
that_comes_before('ssl::cert[certname]')
4457
end
4558
end
4659
end

0 commit comments

Comments
 (0)