]> gitweb.fluxo.info Git - puppet-nginx.git/commitdiff
Fix ssl/certbot absence behavior
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 5 Feb 2018 13:00:49 +0000 (11:00 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 5 Feb 2018 13:00:49 +0000 (11:00 -0200)
manifests/site.pp

index 9997e975997fbaf6147b7ade3fe2b0c3d4eee4ff..983fc88e9bd8177011b82a5d5ef3b1a377ed82f1 100644 (file)
@@ -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,
     }
   }