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

Allow setting file group owner #231

Closed
wants to merge 8 commits into from
Closed
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
1 change: 1 addition & 0 deletions data/OpenBSD-family.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
letsencrypt::cron_owner_group: 'wheel'
letsencrypt::root_file_owner_group: 'wheel'
6 changes: 4 additions & 2 deletions manifests/hook.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
# @param type Hook type.
# @param hook_file Path to deploy hook script.
# @param commands Bash commands to execute when the hook is run by certbot.
# @param hook_file_group Group owner of the hook file
#
define letsencrypt::hook (
Enum['pre', 'post', 'deploy'] $type,
String[1] $hook_file,
# hook.sh.epp will validate this
Variant[String[1],Array[String[1]]] $commands,
String[1] $hook_file,
String[1] $hook_file_group = $letsencrypt::root_file_owner_group,
) {
$validate_env = $type ? {
'deploy' => true,
Expand All @@ -20,7 +22,7 @@
file { $hook_file:
ensure => file,
owner => 'root',
group => 'root',
group => $hook_file_group,
mode => '0755',
content => epp('letsencrypt/hook.sh.epp', {
commands => $commands,
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# @param config A hash representation of the letsencrypt configuration file.
# @param cron_scripts_path The path for renewal scripts called by cron
# @param cron_owner_group Group owner of cron renew scripts.
# @param root_file_owner_group Group owner for the shipped files
# @param manage_config A feature flag to toggle the management of the letsencrypt configuration file.
# @param manage_install A feature flag to toggle the management of the letsencrypt client installation.
# @param manage_dependencies A feature flag to toggle the management of the letsencrypt dependencies.
Expand Down Expand Up @@ -72,6 +73,7 @@
Hash $config = { 'server' => 'https://acme-v02.api.letsencrypt.org/directory' },
String $cron_scripts_path = "${facts['puppet_vardir']}/letsencrypt",
String $cron_owner_group = 'root',
String $root_file_owner_group = 'root',
arthurbarton marked this conversation as resolved.
Show resolved Hide resolved
Boolean $manage_config = true,
Boolean $manage_install = true,
Boolean $manage_dependencies = true,
Expand Down Expand Up @@ -124,7 +126,7 @@
file { '/usr/local/sbin/letsencrypt-domain-validation':
ensure => file,
owner => 'root',
group => 'root',
group => $root_file_owner_group,
mode => '0500',
source => "puppet:///modules/${module_name}/domain-validation.sh",
}
Expand Down
2 changes: 2 additions & 0 deletions manifests/plugin/dns_rfc2136.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# @param manage_package Manage the plugin package.
# @param package_name The name of the package to install when $manage_package is true.
# @param config_dir The path to the configuration directory.
# @param ini_file_owner_group Group owner of the generated ini file
#
class letsencrypt::plugin::dns_rfc2136 (
Stdlib::Host $server,
Expand All @@ -23,6 +24,7 @@
Integer $propagation_seconds = 10,
Stdlib::Absolutepath $config_dir = $letsencrypt::config_dir,
Boolean $manage_package = true,
String $ini_file_owner_group = $letsencrypt::root_file_owner_group,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
String $ini_file_owner_group = $letsencrypt::root_file_owner_group,
String[1] $ini_file_owner_group = $letsencrypt::root_file_owner_group,

) {
require letsencrypt

Expand Down
21 changes: 12 additions & 9 deletions manifests/renew.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@
# @param cron_monthday
# Optional string, integer or array of monthday(s) the renewal command should
# run. E.g. '2-30/2' to run on even days. Default: Every day.
# @param hook_file_owner_group
# Set the group ownership of the pushed hook files
#
class letsencrypt::renew (
Variant[String[1], Array[String[1]]] $pre_hook_commands = $letsencrypt::renew_pre_hook_commands,
Variant[String[1], Array[String[1]]] $post_hook_commands = $letsencrypt::renew_post_hook_commands,
Variant[String[1], Array[String[1]]] $deploy_hook_commands = $letsencrypt::renew_deploy_hook_commands,
Array[String[1]] $additional_args = $letsencrypt::renew_additional_args,
Enum['present', 'absent'] $cron_ensure = $letsencrypt::renew_cron_ensure,
Letsencrypt::Cron::Hour $cron_hour = $letsencrypt::renew_cron_hour,
Letsencrypt::Cron::Minute $cron_minute = $letsencrypt::renew_cron_minute,
Letsencrypt::Cron::Monthday $cron_monthday = $letsencrypt::renew_cron_monthday,
Variant[String[1], Array[String[1]]] $pre_hook_commands = $letsencrypt::renew_pre_hook_commands,
Variant[String[1], Array[String[1]]] $post_hook_commands = $letsencrypt::renew_post_hook_commands,
Variant[String[1], Array[String[1]]] $deploy_hook_commands = $letsencrypt::renew_deploy_hook_commands,
Array[String[1]] $additional_args = $letsencrypt::renew_additional_args,
Enum['present', 'absent'] $cron_ensure = $letsencrypt::renew_cron_ensure,
Letsencrypt::Cron::Hour $cron_hour = $letsencrypt::renew_cron_hour,
Letsencrypt::Cron::Minute $cron_minute = $letsencrypt::renew_cron_minute,
Letsencrypt::Cron::Monthday $cron_monthday = $letsencrypt::renew_cron_monthday,
String $hook_file_owner_group = $letsencrypt::root_file_owner_group,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
String $hook_file_owner_group = $letsencrypt::root_file_owner_group,
String[1] $hook_file_owner_group = $letsencrypt::root_file_owner_group,

) {
# Directory used for Puppet-managed renewal hooks. Make sure old unmanaged
# hooks in this directory are purged. Leave custom hooks in the default
Expand All @@ -44,7 +47,7 @@
ensure => directory,
path => "${letsencrypt::config_dir}/renewal-hooks-puppet",
owner => 'root',
group => 'root',
group => $hook_file_owner_group,
mode => '0755',
recurse => true,
purge => true,
Expand Down
5 changes: 3 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-letsencrypt",
"version": "5.0.1-rc0",
"version": "6.0.1-rc0",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is a major version.

Copy link
Member

Choose a reason for hiding this comment

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

yes. please don't update the version. we do this during the next release.

"author": "Vox Pupuli",
"summary": "Manages lets-encrypt and certbot + related certs",
"license": "Apache-2.0",
Expand Down Expand Up @@ -50,7 +50,8 @@
{
"operatingsystem": "OpenBSD",
"operatingsystemrelease": [
"6.2"
"6.6",
Copy link
Member

Choose a reason for hiding this comment

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

mhm, is this a backwards incompatible change if we drop 6.2?

Copy link
Contributor

Choose a reason for hiding this comment

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

i reckon that the latest supported versions are the last two, so it's more like a cleanup

Copy link
Member

Choose a reason for hiding this comment

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

Indeed. I think it also didn't really break compatibility with 6.2. That's just an EOL OS.

"6.7"
]
},
{
Expand Down