Skip to content

Commit e2a9e66

Browse files
committed
Ensure register-unsafely-without-email key is absent when attempt to safely register
1 parent c15411e commit e2a9e66

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

manifests/config.pp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,23 @@
2929
$_config = $config
3030
}
3131

32+
$ensure_unsafe_registration = $unsafe_registration ? {
33+
true => present,
34+
false => absent,
35+
}
36+
37+
ini_setting { "${config_file} register-unsafely-without-email true":
38+
ensure => $ensure_unsafe_registration,
39+
path => $config_file,
40+
section => '',
41+
setting => 'register-unsafely-without-email',
42+
value => true,
43+
require => File[$config_dir],
44+
}
45+
3246
unless 'email' in $_config {
3347
if $unsafe_registration {
3448
warning('No email address specified for the letsencrypt class! Registering unsafely!')
35-
ini_setting { "${config_file} register-unsafely-without-email true":
36-
ensure => present,
37-
path => $config_file,
38-
section => '',
39-
setting => 'register-unsafely-without-email',
40-
value => true,
41-
require => File[$config_dir],
42-
}
4349
} else {
4450
fail("Please specify an email address to register with Let's Encrypt using the \$email parameter on the letsencrypt class")
4551
}

0 commit comments

Comments
 (0)