Skip to content

Commit

Permalink
add profile::core::letsencrypt::aws_credentials param
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Aug 4, 2020
1 parent 69b6329 commit 10422a8
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions site/profile/manifests/core/letsencrypt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
# @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[Hash[String, Hash]] $certonly = undef,
Optional[String] $aws_credentials = undef,
) {
include ::letsencrypt
include ::letsencrypt::plugin::dns_route53
Expand All @@ -37,6 +41,22 @@
ensure_resources('letsencrypt::certonly', $certonly)
}

# aws credentials required by dns_route53 plugin.
File['/root/.aws/credentials'] -> Letsencrypt::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<| |>
}
}

0 comments on commit 10422a8

Please sign in to comment.