Skip to content

Commit

Permalink
Remove package_name if non existent
Browse files Browse the repository at this point in the history
  • Loading branch information
cible committed Aug 31, 2022
1 parent 37200dc commit f062f57
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 24 deletions.
1 change: 0 additions & 1 deletion data/Debian-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
letsencrypt::plugin::dns_rfc2136::package_name: 'python3-certbot-dns-rfc2136'
letsencrypt::plugin::dns_route53::package_name: 'python3-certbot-dns-route53'
letsencrypt::plugin::dns_cloudflare::package_name: 'python3-certbot-dns-cloudflare'
letsencrypt::plugin::dns_gandi::package_name: 'certbot-plugin-gandi'
1 change: 0 additions & 1 deletion data/FreeBSD-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ letsencrypt::cron_owner_group: 'wheel'
letsencrypt::plugin::dns_rfc2136::package_name: 'py39-certbot-dns-rfc2136'
letsencrypt::plugin::dns_route53::package_name: 'py39-certbot-dns-route53'
letsencrypt::plugin::dns_cloudflare::package_name: 'py39-certbot-dns-cloudflare'
letsencrypt::plugin::dns_gandi::package_name: 'py39-certbot-dns-gandi'
1 change: 0 additions & 1 deletion data/RedHat-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ letsencrypt::configure_epel: true
letsencrypt::plugin::dns_rfc2136::package_name: 'python3-certbot-dns-rfc2136'
letsencrypt::plugin::dns_route53::package_name: 'python3-certbot-dns-route53'
letsencrypt::plugin::dns_cloudflare::package_name: 'python3-certbot-dns-cloudflare'
letsencrypt::plugin::dns_gandi::package_name: 'certbot-plugin-gandi'
22 changes: 5 additions & 17 deletions manifests/plugin/dns_gandi.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#
class letsencrypt::plugin::dns_gandi (
String[1] $api_key,
String[1] $package_name,
Optional[String[1]] $package_provider = undef,
Optional[String[1]] $package_name = undef,
Stdlib::Absolutepath $config_file = "${letsencrypt::config_dir}/dns-gandi.ini",
Boolean $manage_package = true,
) {
Expand All @@ -22,25 +22,13 @@
fail('No package name provided for certbot dns gandi plugin.')
}

if $package_provider {
package { $package_name:
ensure => installed,
provider => $package_provider,
}
}
else {
package { $package_name:
ensure => installed,
}
package { $package_name:
ensure => installed,
}
}

if $api_key {
$ini_vars = {
'certbot_plugin_gandi:dns_api_key' => $api_key,
}
} else {
fail('api_key not provided for certbot dns gandi plugin.')
$ini_vars = {
'certbot_plugin_gandi:dns_api_key' => $api_key,
}

file { $config_file:
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/plugin/dns_gandi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class { 'letsencrypt':
osrelease = facts[:os]['release']['major']
osfull = "#{osname}-#{osrelease}"
case osfull
when 'Debian-10', 'AlmaLinux-8', 'RedHat-8', 'Ubuntu-18.04', 'Fedora-32', 'RedHat-7', 'CentOS-7'
'certbot-plugin-gandi'
when 'FreeBSD-12', 'FreeBSD-13'
'py39-certbot-dns-gandi'
when 'Debian-11', 'Ubuntu-20.04'
'python3-certbot-dns-gandi'
end
Expand Down

0 comments on commit f062f57

Please sign in to comment.