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 missing datatypes and documentation #315

Merged
merged 5 commits into from
Apr 4, 2023
Merged
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
2 changes: 0 additions & 2 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
--fail-on-warnings
--no-parameter_documentation-check
--no-parameter_types-check
5 changes: 5 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
.puppet-lint.rc:
enabled_lint_checks:
- parameter_documentation
- parameter_types
43 changes: 19 additions & 24 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Default value: `'certbot'`

##### <a name="-letsencrypt--package_ensure"></a>`package_ensure`

Data type: `Any`
Data type: `String[1]`

The value passed to `ensure` when installing the client package.

Expand Down Expand Up @@ -226,23 +226,23 @@ Default value: `{}`

##### <a name="-letsencrypt--renew_pre_hook_commands"></a>`renew_pre_hook_commands`

Data type: `Any`
Data type: `Variant[String[1], Array[String[1]]]`

Array of commands to run in a shell before obtaining/renewing any certificates.

Default value: `[]`

##### <a name="-letsencrypt--renew_post_hook_commands"></a>`renew_post_hook_commands`

Data type: `Any`
Data type: `Variant[String[1], Array[String[1]]]`

Array of commands to run in a shell after attempting to obtain/renew certificates.

Default value: `[]`

##### <a name="-letsencrypt--renew_deploy_hook_commands"></a>`renew_deploy_hook_commands`

Data type: `Any`
Data type: `Variant[String[1], Array[String[1]]]`

Array of commands to run in a shell once for each successfully issued/renewed
certificate. Two environmental variables are supplied by certbot:
Expand All @@ -255,23 +255,23 @@ Default value: `[]`

##### <a name="-letsencrypt--renew_additional_args"></a>`renew_additional_args`

Data type: `Any`
Data type: `Variant[String[1], Array[String[1]]]`

Array of additional command line arguments to pass to 'certbot renew'.

Default value: `[]`

##### <a name="-letsencrypt--renew_cron_ensure"></a>`renew_cron_ensure`

Data type: `Any`
Data type: `String[1]`

Intended state of the cron resource running certbot renew.

Default value: `'absent'`

##### <a name="-letsencrypt--renew_cron_hour"></a>`renew_cron_hour`

Data type: `Any`
Data type: `Letsencrypt::Cron::Hour`

Optional string, integer or array of hour(s) the renewal command should run.
E.g. '[0,12]' to execute at midnight and midday.
Expand All @@ -281,7 +281,7 @@ Default value: `fqdn_rand(24)`

##### <a name="-letsencrypt--renew_cron_minute"></a>`renew_cron_minute`

Data type: `Any`
Data type: `Letsencrypt::Cron::Minute`

Optional string, integer or array of minute(s) the renewal command should
run. E.g. 0 or '00' or [0,30].
Expand All @@ -290,7 +290,7 @@ Default value: `fqdn_rand(60)`

##### <a name="-letsencrypt--renew_cron_monthday"></a>`renew_cron_monthday`

Data type: `Any`
Data type: `Letsencrypt::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.
Expand All @@ -299,23 +299,23 @@ Default value: `'*'`

##### <a name="-letsencrypt--certonly_pre_hook_commands"></a>`certonly_pre_hook_commands`

Data type: `Any`
Data type: `Array[String[1]]`

Array of commands to run in a shell before obtaining/renewing any certificates.

Default value: `[]`

##### <a name="-letsencrypt--certonly_post_hook_commands"></a>`certonly_post_hook_commands`

Data type: `Any`
Data type: `Array[String[1]]`

Array of commands to run in a shell after attempting to obtain/renew certificates.

Default value: `[]`

##### <a name="-letsencrypt--certonly_deploy_hook_commands"></a>`certonly_deploy_hook_commands`

Data type: `Any`
Data type: `Array[String[1]]`

Array of commands to run in a shell once for each successfully issued/renewed
certificate. Two environmental variables are supplied by certbot:
Expand Down Expand Up @@ -375,10 +375,9 @@ The following parameters are available in the `letsencrypt::plugin::dns_cloudfla
* [`api_key`](#-letsencrypt--plugin--dns_cloudflare--api_key)
* [`api_token`](#-letsencrypt--plugin--dns_cloudflare--api_token)
* [`email`](#-letsencrypt--plugin--dns_cloudflare--email)
* [`config_dir`](#-letsencrypt--plugin--dns_cloudflare--config_dir)
* [`config_path`](#-letsencrypt--plugin--dns_cloudflare--config_path)
* [`manage_package`](#-letsencrypt--plugin--dns_cloudflare--manage_package)
* [`propagation_seconds`](#-letsencrypt--plugin--dns_cloudflare--propagation_seconds)
* [`config_path`](#-letsencrypt--plugin--dns_cloudflare--config_path)

##### <a name="-letsencrypt--plugin--dns_cloudflare--package_name"></a>`package_name`

Expand Down Expand Up @@ -412,10 +411,14 @@ Optional string, cloudflare account email address, used in conjunction with api_

Default value: `undef`

##### <a name="-letsencrypt--plugin--dns_cloudflare--config_dir"></a>`config_dir`
##### <a name="-letsencrypt--plugin--dns_cloudflare--config_path"></a>`config_path`

Data type: `Stdlib::Absolutepath`

The path to the configuration directory.

Default value: `"${letsencrypt::config_dir}/dns-cloudflare.ini"`

##### <a name="-letsencrypt--plugin--dns_cloudflare--manage_package"></a>`manage_package`

Data type: `Boolean`
Expand All @@ -432,14 +435,6 @@ Number of seconds to wait for the DNS server to propagate the DNS-01 challenge.

Default value: `10`

##### <a name="-letsencrypt--plugin--dns_cloudflare--config_path"></a>`config_path`

Data type: `Stdlib::Absolutepath`



Default value: `"${letsencrypt::config_dir}/dns-cloudflare.ini"`

### <a name="letsencrypt--plugin--dns_rfc2136"></a>`letsencrypt::plugin::dns_rfc2136`

This class installs and configures the Let's Encrypt dns-rfc2136 plugin.
Expand Down Expand Up @@ -986,7 +981,7 @@ Default value: `$letsencrypt::certonly_deploy_hook_commands`

Data type: `String[1]`


the common name used for the certificate

Default value: `$title`

Expand Down
2 changes: 2 additions & 0 deletions manifests/certonly.pp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
# - $RENEWED_DOMAINS: A space-delimited list of renewed certificate domains.
# Example: "example.com www.example.com"
#
# @param cert_name the common name used for the certificate
#
define letsencrypt::certonly (
Enum['present','absent'] $ensure = 'present',
Array[String[1]] $domains = [$title],
Expand Down
12 changes: 6 additions & 6 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# @api private
#
class letsencrypt::config (
$config_dir = $letsencrypt::config_dir,
$config_file = $letsencrypt::config_file,
$config = $letsencrypt::config,
$email = $letsencrypt::email,
$unsafe_registration = $letsencrypt::unsafe_registration,
$agree_tos = $letsencrypt::agree_tos,
Stdlib::Absolutepath $config_dir = $letsencrypt::config_dir,
Stdlib::Absolutepath $config_file = $letsencrypt::config_file,
Hash $config = $letsencrypt::config,
Optional[String[1]] $email = $letsencrypt::email,
Boolean $unsafe_registration = $letsencrypt::unsafe_registration,
Boolean $agree_tos = $letsencrypt::agree_tos,
) {
assert_private()

Expand Down
24 changes: 12 additions & 12 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
Optional[String] $email = undef,
Array $environment = [],
String $package_name = 'certbot',
$package_ensure = 'installed',
String[1] $package_ensure = 'installed',
String $package_command = 'certbot',
Stdlib::Unixpath $config_dir = '/etc/letsencrypt',
String $config_file = "${config_dir}/cli.ini",
Expand All @@ -79,18 +79,18 @@
Integer[2048] $key_size = 4096,
Hash[String[1],Hash] $certificates = {},
# $renew_* should only be used in letsencrypt::renew (blame rspec)
$renew_pre_hook_commands = [],
$renew_post_hook_commands = [],
$renew_deploy_hook_commands = [],
$renew_additional_args = [],
$renew_cron_ensure = 'absent',
$renew_cron_hour = fqdn_rand(24),
$renew_cron_minute = fqdn_rand(60),
$renew_cron_monthday = '*',
Variant[String[1], Array[String[1]]] $renew_pre_hook_commands = [],
Variant[String[1], Array[String[1]]] $renew_post_hook_commands = [],
Variant[String[1], Array[String[1]]] $renew_deploy_hook_commands = [],
Variant[String[1], Array[String[1]]] $renew_additional_args = [],
String[1] $renew_cron_ensure = 'absent',
Letsencrypt::Cron::Hour $renew_cron_hour = fqdn_rand(24),
Letsencrypt::Cron::Minute $renew_cron_minute = fqdn_rand(60),
Letsencrypt::Cron::Monthday $renew_cron_monthday = '*',
# define default hooks for all certonly defined resources
$certonly_pre_hook_commands = [],
$certonly_post_hook_commands = [],
$certonly_deploy_hook_commands = [],
Array[String[1]] $certonly_pre_hook_commands = [],
Array[String[1]] $certonly_post_hook_commands = [],
Array[String[1]] $certonly_deploy_hook_commands = [],
) {
if $manage_install {
contain letsencrypt::install # lint:ignore:relative_classname_inclusion
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin/dns_cloudflare.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Optional string, cloudflare api token value for authentication.
# @param email
# Optional string, cloudflare account email address, used in conjunction with api_key.
# @param config_dir The path to the configuration directory.
# @param config_path The path to the configuration directory.
# @param manage_package Manage the plugin package.
# @param propagation_seconds Number of seconds to wait for the DNS server to propagate the DNS-01 challenge.
#
Expand Down