Skip to content
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

add profile::core::letsencrypt #195

Merged
merged 9 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ mod 'simp/gnome', '8.1.1'
mod 'simp/polkit', '6.2.0'
mod 'simp/simplib', '3.15.3'

# latest puppet/letsencrypt release does not include dns_route53 plugin support
mod 'puppet/letsencrypt',
git: 'https://github.com/voxpupuli/puppet-letsencrypt',
ref: 'c16fe95a432564a3ac62eb7f56dfafb06d207218'

mod 'lsst/ccs_database',
git: 'https://github.com/lsst-it/puppet-ccs_database.git',
ref: 'v0.1.0'
Expand Down
2 changes: 2 additions & 0 deletions hieradata/org/lsst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,5 @@ rsyslog::config::actions:
yum::plugin::versionlock:
# trigger `yum clean all`
clean: true

letsencrypt::email: "rubinobs-it-las@lsst.org"
2 changes: 2 additions & 0 deletions hieradata/site/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,5 @@ accounts::user_list:
# Stop iptables by default - the default rules are highly restrictive to the
# point of harm and we don't have a meaningful permission set to make this useful.
firewall::ensure: "stopped"

letsencrypt::server: "https://acme-staging.api.letsencrypt.org/directory" # testing url
Copy link
Contributor

Choose a reason for hiding this comment

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

I know is a better practice, but you plan to merge the "staging" server? Also, I thought the server was https://acme-v02.api.letsencrypt.org/directory

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this only applies to the dev site.

62 changes: 62 additions & 0 deletions site/profile/manifests/core/letsencrypt.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# @summary Support for dns auth letsencrypt certs
#
# @example
# class profile::core::perfsonar {
# include profile::core::letsencrypt
# include augeas # needed by perfsonar
#
# $fqdn = $facts['fqdn']
# $le_root = "/etc/letsencrypt/live/${fqdn}"
#
# letsencrypt::certonly { $fqdn:
# plugin => 'dns-route53',
# manage_cron => true,
# } ->
# class { '::perfsonar':
# manage_apache => true,
# remove_root_prompt => true,
# ssl_cert => "${le_root}/cert.pem",
# ssl_chain_file => "${le_root}/fullchain.pem",
# ssl_key => "${le_root}/privkey.pem",
# }
# }
#
# @param certonly
# Hash of `letsencrypt::certonly` defined types to create.
# See: https://github.com/voxpupuli/puppet-letsencrypt/blob/master/manifests/certonly.pp
#
# @param aws_credentials
# `.aws/credentials` format string for aws route53 credentials
class profile::core::letsencrypt(
Optional[Hash[String, Hash]] $certonly = undef,
Optional[String] $aws_credentials = undef,
) {
include ::letsencrypt
include ::letsencrypt::plugin::dns_route53

# XXX https://github.com/voxpupuli/puppet-letsencrypt/issues/230
ensure_packages(['python2-futures.noarch'])

if ($certonly) {
ensure_resources('letsencrypt::certonly', $certonly)
}

if ($aws_credentials) {
file {
'/root/.aws':
ensure => directory,
mode => '0700',
backup => false,
;
'/root/.aws/credentials':
ensure => file,
mode => '0600',
backup => false,
content => $aws_credentials,
;
}

# aws credentials required by dns_route53 plugin.
File['/root/.aws/credentials'] -> Letsencrypt::Certonly<| |>
hreinking marked this conversation as resolved.
Show resolved Hide resolved
}
}