diff options
-rw-r--r-- | manifests/site.pp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/manifests/site.pp b/manifests/site.pp index 9997e97..983fc88 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -20,7 +20,10 @@ define nginx::site( aliases => $aliases, } - if $certbot == true { + # We should discover the best practices' way to + # stop managing a certificate using certbot so + # we can implement an ensurable properly. + if $certbot == true and $ensure == 'present' { certbot::manage { $name: aliases => $aliases, pre_hook => '/usr/sbin/service nginx restart', @@ -30,13 +33,19 @@ define nginx::site( nginx::site::config { "${name}-ssl": server_name => $name, - ensure => $ssl, + ensure => $ensure ? { + 'present' => $ssl, + default => absent, + }, source => $source, template => "${template}-ssl", backend => $backend, aliases => $aliases, require => $certbot ? { - true => Certbot::Manage[$name], + true => $ensure ? { + 'present' => Certbot::Manage[$name], + default => undef, + }, default => undef, } } |