Skip to content

Commit 51878bb

Browse files
authored
Merge pull request #309 from deric/cleanup
Remove unnecessary exec
2 parents 3e2621e + 52ff532 commit 51878bb

File tree

4 files changed

+1
-21
lines changed

4 files changed

+1
-21
lines changed

manifests/certonly.pp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@
270270
environment => $environment,
271271
provider => 'shell',
272272
require => [
273-
Exec['initialize letsencrypt'],
274273
File['/usr/local/sbin/letsencrypt-domain-validation'],
275274
],
276275
}

manifests/init.pp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,17 @@
8181
) {
8282
if $manage_install {
8383
contain letsencrypt::install # lint:ignore:relative_classname_inclusion
84-
Class['letsencrypt::install'] ~> Exec['initialize letsencrypt']
8584
Class['letsencrypt::install'] -> Class['letsencrypt::renew']
8685
}
8786

8887
$command = $package_command
8988

9089
if $manage_config {
9190
contain letsencrypt::config # lint:ignore:relative_classname_inclusion
92-
Class['letsencrypt::config'] -> Exec['initialize letsencrypt']
9391
}
9492

9593
contain letsencrypt::renew
9694

97-
# TODO: do we need this command when installing from package?
98-
exec { 'initialize letsencrypt':
99-
command => "${package_command} -h",
100-
path => $facts['path'],
101-
environment => $environment,
102-
refreshonly => true,
103-
}
104-
10595
$certificates.each |$certificate, $properties| {
10696
letsencrypt::certonly { $certificate: * => $properties }
10797
}

spec/classes/letsencrypt_spec.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
it 'contains the correct resources' do
2323
is_expected.to contain_class('letsencrypt::install').
2424
with(configure_epel: epel).
25-
that_notifies('Exec[initialize letsencrypt]').
2625
that_comes_before('Class[letsencrypt::renew]')
27-
is_expected.to contain_exec('initialize letsencrypt').with_command('certbot -h')
28-
is_expected.to contain_class('letsencrypt::config').that_comes_before('Exec[initialize letsencrypt]')
26+
is_expected.to contain_class('letsencrypt::config')
2927
is_expected.to contain_class('letsencrypt::renew').
3028
with(pre_hook_commands: [],
3129
post_hook_commands: [],
@@ -87,12 +85,6 @@
8785
end
8886
end
8987

90-
describe 'with custom environment variables' do
91-
let(:additional_params) { { environment: ['FOO=bar', 'FIZZ=buzz'] } }
92-
93-
it { is_expected.to contain_exec('initialize letsencrypt').with_environment(['FOO=bar', 'FIZZ=buzz']) }
94-
end
95-
9688
describe 'with custom package_ensure' do
9789
let(:additional_params) { { package_ensure: '0.3.0-1.el7' } }
9890

spec/defines/letsencrypt_certonly_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
it { is_expected.to contain_ini_setting('/etc/letsencrypt/cli.ini email [email protected]') }
4343
it { is_expected.to contain_ini_setting('/etc/letsencrypt/cli.ini server https://acme-v02.api.letsencrypt.org/directory') }
4444
end
45-
it { is_expected.to contain_exec('initialize letsencrypt') }
4645
it { is_expected.to contain_exec('letsencrypt certonly foo.example.com') }
4746
it { is_expected.to contain_exec('letsencrypt certonly foo.example.com').with_unless(['test ! -f /usr/local/sbin/letsencrypt-domain-validation', "/usr/local/sbin/letsencrypt-domain-validation #{pathprefix}/etc/letsencrypt/live/foo.example.com/cert.pem 'foo.example.com'"]) }
4847
end

0 commit comments

Comments
 (0)