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 certbot-dns-ovh plugin support #195

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
5fa826a
enable acceptance with debian10
Dan33l Jul 29, 2019
accaa4b
:tada: Add certbot-dns-ovh plugin support
aellert Aug 8, 2019
1175fcc
format using puppet-strings style
aellert Aug 8, 2019
6858d7b
Remove hardcoded dns-ovh.ini file name (replace $config_dir by $confi…
aellert Aug 8, 2019
ebafaaf
:white_check_mark: Add tests for dns-ovh plugin
aellert Aug 22, 2019
584f525
:books: Add dns-ovh documentation
aellert Aug 22, 2019
837a6c9
:bug: Fix syntax error
aellert Aug 22, 2019
dec410b
:books: Add warning about Debian based distros compatibility
aellert Aug 22, 2019
4f72803
:bug: Fix version compared as number
aellert Aug 22, 2019
a496736
:bug: Fix Travis CI warnings
aellert Aug 22, 2019
780ebec
limit tests with puppet6 on debian10
Dan33l Aug 28, 2019
de788f5
Merge pull request #194 from Dan33l/acceptance_debian10
bastelfreak Sep 3, 2019
c81c410
fix modulesync config file
bastelfreak Sep 11, 2019
7b809d3
Merge pull request #201 from bastelfreak/bugfix
bastelfreak Sep 11, 2019
ab69094
Raise upper bound version of stdlib & vcsrepo
mfaure Sep 20, 2019
4a687e2
Merge pull request #202 from mfaure/Raise_upper_bound_dependencies_ve…
ekohl Sep 20, 2019
d974790
use puppet strings
Dan33l Oct 4, 2019
faf8f9a
Merge pull request #204 from Dan33l/puppet-strings
bastelfreak Oct 5, 2019
4a7ff77
use ACME API v2
Dan33l Oct 9, 2019
c3a43cb
Merge pull request #206 from Dan33l/defaults_to_apiv2
Dan33l Oct 9, 2019
7b295cf
remove params.pp
Dan33l Oct 5, 2019
07e1d55
fix Datatype for package_name
bastelfreak Oct 8, 2019
2a3fe69
fix package_name entry in hiera for Debian family
bastelfreak Oct 8, 2019
d57a798
fix datatype for configure_epel
bastelfreak Oct 8, 2019
d48ccbb
mock facts in rspec tests
bastelfreak Oct 8, 2019
c3f53e2
update REFERENCE.md
Dan33l Oct 9, 2019
8fd5300
update hierarchy and update plugin dns_rfc2136 tests
Dan33l Oct 9, 2019
c8f9f60
Merge pull request #205 from Dan33l/params_pp
Dan33l Oct 9, 2019
dcb0a12
update version shiped with vcs method to 0.39.0
Dan33l Oct 9, 2019
1b09d8e
Merge pull request #207 from Dan33l/update_vcs_shiped_version
Dan33l Oct 9, 2019
70e097f
release 5.0.0
Dan33l Oct 9, 2019
6488357
Merge pull request #208 from Dan33l/release_5.0.0
Dan33l Oct 9, 2019
9705a11
[blacksmith] Bump version to 5.0.1-rc0
Dan33l Oct 9, 2019
6f0faca
allow puppetlabs/inifile 4.x
bastelfreak Nov 14, 2019
ef86ad2
Merge pull request #210 from bastelfreak/inifile
igalic Nov 14, 2019
d7392da
add --keep-until-expiring closer to letsencrypt command in cron
pulecp Nov 21, 2019
3e4f86e
Merge pull request #211 from pulecp/master
Dan33l Nov 26, 2019
d4ed5a8
modulesync 2.9.0
dhoppe Dec 6, 2019
4b2842d
Fix build jobs for Debian 10
dhoppe Dec 13, 2019
a51b3b1
Remove obsolete check
dhoppe Dec 17, 2019
53b8ae3
Fix Travis CI pipeline
dhoppe Dec 17, 2019
5976b4e
modulesync 2.10.0
bastelfreak Dec 22, 2019
b996e6c
drop FreeBSD 10 / Add FreeBSD 12
bastelfreak Dec 31, 2019
da899e0
fix facter version for local Puppet 6 tests
bastelfreak Dec 31, 2019
55c4ab4
pin facterdb to get latest fedora fact sets
bastelfreak Dec 31, 2019
d9d7e94
Merge pull request #213 from voxpupuli/modulesync
bastelfreak Dec 31, 2019
56b636f
delete legacy travis directory
bastelfreak Dec 16, 2019
e6ba89b
Merge pull request #214 from bastelfreak/travis
bastelfreak Dec 31, 2019
ec0d0f5
Allow setting parameters on the OS level
ekohl Dec 31, 2019
cbf92e3
Add Fedora 31, drop Fedora 29
ekohl Dec 31, 2019
ba8fff9
Ensure EPEL is configured before installing plugin
alexjfisher Mar 29, 2020
7519fc6
Merge pull request #222 from alexjfisher/missing_dependency
alexjfisher Mar 29, 2020
1ba9341
stahnma-epel has been transfered to voxpupuli
kallies Mar 28, 2020
eccdbe3
Merge pull request #221 from kallies/218_add_puppet-epel
alexjfisher Mar 29, 2020
eaa8050
allow to override --cert-name
saimonn Mar 30, 2020
a29bb84
Merge pull request #216 from ekohl/fedora
ekohl Apr 2, 2020
77fba52
modulesync 2.12.0
bastelfreak Apr 4, 2020
9ce7c89
Merge pull request #223 from voxpupuli/modulesync
bastelfreak Apr 4, 2020
4834332
Use voxpupuli-acceptance
ekohl Apr 6, 2020
aeffa57
Merge pull request #224 from voxpupuli/rewrite-acceptance-tests
bastelfreak Apr 7, 2020
e4edf1d
add manifest to install dns-route53 plugin, along with tests
aripringle May 15, 2020
76b300a
Merge pull request #225 from aripringle/install-route53-plugin
ekohl May 21, 2020
3d3d62b
fix typo in renew example
milesstoetzner Jun 25, 2020
c16fe95
Merge pull request #228 from milesstoetzner/patch-1
ekohl Jun 25, 2020
c18cac1
modulesync 3.0.0
bastelfreak Jul 25, 2020
eba8147
puppet-lint: autofix
bastelfreak Jul 25, 2020
f9e346e
Merge pull request #229 from voxpupuli/modulesync
bastelfreak Aug 15, 2020
fe14295
release 6.0.0
msalway Sep 11, 2020
e12fb11
Merge pull request #233 from msalway/release_6.0.0
alexjfisher Sep 11, 2020
6cde54f
[blacksmith] Bump version to 6.0.1-rc0
alexjfisher Sep 11, 2020
13fe0b7
modulesync 3.1.0
bastelfreak Oct 24, 2020
5a6cb1a
Merge pull request #234 from voxpupuli/modulesync
bastelfreak Oct 24, 2020
ecffac4
:tada: Add certbot-dns-ovh plugin support
aellert Aug 8, 2019
e7ff0ed
format using puppet-strings style
aellert Aug 8, 2019
201022d
Remove hardcoded dns-ovh.ini file name (replace $config_dir by $confi…
aellert Aug 8, 2019
d1afcca
:white_check_mark: Add tests for dns-ovh plugin
aellert Aug 22, 2019
f36088e
:books: Add dns-ovh documentation
aellert Aug 22, 2019
02d6a82
:bug: Fix syntax error
aellert Aug 22, 2019
1d204a0
:books: Add warning about Debian based distros compatibility
aellert Aug 22, 2019
cc40ee9
:bug: Fix version compared as number
aellert Aug 22, 2019
42d82ec
:bug: Fix Travis CI warnings
aellert Aug 22, 2019
67ae204
Fix merge conflicts
aellert Mar 13, 2021
110473c
Fix merge conflicts
aellert Mar 13, 2021
6f3ecf5
Fix merge conflicts
aellert Mar 13, 2021
805f91d
Fix travis
aellert Mar 13, 2021
2138e4f
Revert "Fix travis"
aellert Mar 13, 2021
80466a5
Fix travis
aellert Mar 13, 2021
d23b242
Fix travis
aellert Mar 13, 2021
4bc934b
Fix travis
aellert Mar 13, 2021
eea9eb5
Fix travis
aellert Mar 13, 2021
62327f0
Fix travis
aellert Mar 13, 2021
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
11 changes: 11 additions & 0 deletions manifests/certonly.pp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@
]
}

'dns-ovh': {
require letsencrypt::plugin::dns_ovh
$_domains = join($domains, '\' -d \'')
$plugin_args = [
"--cert-name '${title}' -d",
"'${_domains}'",
"--dns-ovh-credentials ${letsencrypt::plugin::dns_ovh::config_dir}/dns-ovh.ini",
Copy link
Member

Choose a reason for hiding this comment

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

Should the plugin declare a $config_file variable? Can be inside the body of the class. That way you don't rely on these two matching but can statically check it.

Copy link
Author

Choose a reason for hiding this comment

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

I don't know exactly what you mean. Can you give me more details ?

Copy link
Member

Choose a reason for hiding this comment

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

I meant something like (very shortened):

class letsencrypt::plugin::dns_ovh {
  $config_file = "${letsencrypt::plugin::dns_ovh::config_dir}/dns-ovh.ini"

  file { $config_file:
    # ...
  }
}

Then you can use it here:

"--dns-ovh-credentials ${letsencrypt::plugin::dns_ovh::config_file}",

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I changed $config_dir by $config_file in this PR

"--dns-ovh-propagation-seconds ${letsencrypt::plugin::dns_ovh::propagation_seconds}",
]
}

default: {
if $ensure == 'present' {
$_domains = join($domains, '\' -d \'')
Expand Down
10 changes: 10 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,47 @@
$package_command = 'certbot'
$config_dir = '/etc/letsencrypt'
$dns_rfc2136_package_name = 'python3-certbot-dns-rfc2136'
$dns_ovh_package_name = 'python3-certbot-dns-ovh'
} elsif $facts['osfamily'] == 'RedHat' {
$install_method = 'package'
$package_name = 'certbot'
$package_command = 'certbot'
$config_dir = '/etc/letsencrypt'
if $facts['operatingsystemmajrelease'] == '7' {
$dns_rfc2136_package_name = 'python2-certbot-dns-rfc2136'
$dns_ovh_package_name = 'python2-certbot-dns-ovh'
} else {
$dns_rfc2136_package_name = 'python3-certbot-dns-rfc2136'
$dns_ovh_package_name = 'python3-certbot-dns-ovh'
}
} elsif $facts['osfamily'] == 'Gentoo' {
$install_method = 'package'
$package_name = 'app-crypt/certbot'
$package_command = 'certbot'
$config_dir = '/etc/letsencrypt'
$dns_rfc2136_package_name = undef
$dns_ovh_package_name = undef
} elsif $facts['osfamily'] == 'OpenBSD' {
$install_method = 'package'
$package_name = 'certbot'
$package_command = 'certbot'
$config_dir = '/etc/letsencrypt'
$dns_rfc2136_package_name = undef
$dns_ovh_package_name = undef
} elsif $facts['osfamily'] == 'FreeBSD' {
$install_method = 'package'
$package_name = 'py27-certbot'
$package_command = 'certbot'
$config_dir = '/usr/local/etc/letsencrypt'
$dns_rfc2136_package_name = undef
$dns_ovh_package_name = undef
} else {
$install_method = 'vcs'
$package_name = 'letsencrypt'
$package_command = 'letsencrypt'
$config_dir = '/etc/letsencrypt'
$dns_rfc2136_package_name = undef
$dns_ovh_package_name = undef
}

$config_file = "${config_dir}/cli.ini"
Expand All @@ -82,4 +89,7 @@
$dns_rfc2136_algorithm = 'HMAC-SHA512'
$dns_rfc2136_propagation_seconds = 10

$dns_ovh_manage_package = true
$dns_ovh_propagation_seconds = 30

}
59 changes: 59 additions & 0 deletions manifests/plugin/dns_ovh.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# == Class: letsencrypt::plugin::dns_ovh
Copy link
Member

Choose a reason for hiding this comment

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

Could you format this using puppet-strings style?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it's done here
Should I do another PR ?

Copy link
Member

Choose a reason for hiding this comment

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

It's fine here. A separate PR to convert the rest of the module would be appreciated though :)

Copy link
Author

Choose a reason for hiding this comment

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

Ok, next week I will probably have some time to do it !

#
# This class installs and configures the Let's Encrypt dns-ovh plugin.
# https://certbot-dns-ovh.readthedocs.io
#
# === Parameters:
Copy link
Member

Choose a reason for hiding this comment

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

This is no longer needed with puppet-strings.

Suggested change
# === Parameters:

#
# [*endpoint*]
# Target OVH DNS endpoint.
# [*application_key*]
# OVH application key.
# [*application_secret*]
# DNS OVH application secret.
# [*consumer_key*]
# DNS OVH consumer key.
# [*manage_package*]
# Manage the plugin package.
# [*package_name*]
# The name of the package to install when $manage_package is true.
# [*config_dir*]
# The path to the configuration directory.
#
class letsencrypt::plugin::dns_ovh (
Enum['ovh-eu', 'ovh-ca'] $endpoint,
String[1] $application_key,
String[1] $application_secret,
String[1] $consumer_key,
Integer $propagation_seconds = $letsencrypt::dns_ovh_propagation_seconds,
Stdlib::Absolutepath $config_dir = $letsencrypt::config_dir,
Boolean $manage_package = $letsencrypt::dns_ovh_manage_package,
String $package_name = $letsencrypt::dns_ovh_package_name,
) {

if $manage_package {
package { $package_name:
ensure => installed,
}
}

$ini_vars = {
dns_ovh_endpoint => $endpoint,
dns_ovh_application_key => $application_key,
dns_ovh_application_secret => $application_secret,
dns_ovh_consumer_key => $consumer_key,
dns_ovh_propagation_seconds => $propagation_seconds,
}

file { "${config_dir}/dns-ovh.ini":
ensure => file,
owner => 'root',
group => 'root',
mode => '0400',
content => epp('letsencrypt/ini.epp', {
vars => { '' => $ini_vars },
}),
require => Class['letsencrypt'],
}

}
2 changes: 1 addition & 1 deletion types/plugin.pp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
type Letsencrypt::Plugin = Enum['apache', 'standalone', 'webroot', 'nginx', 'dns-route53', 'dns-google', 'dns-cloudflare', 'dns-rfc2136']
type Letsencrypt::Plugin = Enum['apache', 'standalone', 'webroot', 'nginx', 'dns-route53', 'dns-google', 'dns-cloudflare', 'dns-rfc2136', 'dns-ovh']