Skip to content

Add cert_name parameter to letsencrypt::certonly #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2020

Conversation

saimonn
Copy link
Contributor

@saimonn saimonn commented Mar 6, 2020

Pull Request (PR) description

Add the possibility to choose a $cert_name parameter different from $title.

This Pull Request (PR) fixes the following issues

When the $cert_name vary with the $title, this prevents to use two resources to manage the same certificate, as in the following example:

      # First standalone certificate is needed to create the key/certs, _before_ we can start apache with ssl enabled.
      ::letsencrypt::certonly {"${le_domains[0]}-standalone":
          domains     => $le_domains,
          manage_cron => false,
      }
      # this is the long-term cert, managing the cron renewal task
      -> ::letsencrypt::certonly {"${le_domains[0]}-webroot":
          domains              => $le_domains,
          manage_cron          => true,
          cron_success_command => 'apachectl -t && apachectl graceful',
          plugin               => 'webroot',
          webroot_paths        => [
            "/var/www/vhosts/${name}/htdocs",
          ],
      }

@alexjfisher
Copy link
Member

voxpupuli/puppet-epel#116 should fix the build failures. I've restarted the build to see. Same with your other PR.

@saimonn
Copy link
Contributor Author

saimonn commented Mar 30, 2020

Thanks !
I've fixed a trailing space in my spec test, and squashed my commits. it should pass now.

@saimonn saimonn force-pushed the override_cert_name branch from b5877ba to cca23ba Compare March 30, 2020 07:58
@@ -48,6 +48,7 @@
define letsencrypt::certonly (
Enum['present','absent'] $ensure = 'present',
Array[String[1]] $domains = [$title],
Optional[String[1]] $cert_name = $title,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional? I think this should just be String[1]. There's no way to set it to undef and that wouldn't be valid.

@alexjfisher alexjfisher merged commit eaa8050 into voxpupuli:master Mar 30, 2020
@alexjfisher alexjfisher added the enhancement New feature or request label Mar 30, 2020
@alexjfisher alexjfisher changed the title allow to override --cert-name Add cert_name parameter to letsencrypt::certonly Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants