Puppet Class: letsencrypt::plugin::dns_cloudflare
- Defined in:
- manifests/plugin/dns_cloudflare.pp
Summary
Installs and configures the dns-cloudflare pluginOverview
This class installs and configures the Let’s Encrypt dns-cloudflare plugin. certbot-dns-cloudflare.readthedocs.io
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'manifests/plugin/dns_cloudflare.pp', line 17
class letsencrypt::plugin::dns_cloudflare (
Optional[String[1]] $package_name = undef,
Optional[String[1]] $api_key = undef,
Optional[String[1]] $api_token = undef,
Optional[String[1]] $email = undef,
Stdlib::Absolutepath $config_path = "${letsencrypt::config_dir}/dns-cloudflare.ini",
Boolean $manage_package = true,
Integer $propagation_seconds = 10,
) {
require letsencrypt::install
if ! $api_key and ! $api_token {
fail('No authentication method provided, please specify either api_token or api_key and api_email.')
}
if $manage_package {
if ! $package_name {
fail('No package name provided for certbot dns cloudflare plugin.')
}
package { $package_name:
ensure => installed,
}
}
if $api_token {
$ini_vars = {
dns_cloudflare_api_token => $api_token,
}
}
else {
if ! $email {
fail('Cloudflare email not provided for specified api_key.')
}
$ini_vars = {
dns_cloudflare_api_key => $api_key,
dns_cloudflare_email => $email,
}
}
file { $config_path:
ensure => file,
owner => 'root',
group => 'root',
mode => '0400',
content => epp('letsencrypt/ini.epp', {
vars => { '' => $ini_vars },
}),
}
}
|