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

Mark install.pp as private #338

Merged
merged 1 commit into from
Nov 26, 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
38 changes: 1 addition & 37 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#### Public Classes

* [`letsencrypt`](#letsencrypt): Install and configure Certbot, the LetsEncrypt client
* [`letsencrypt::install`](#letsencrypt--install): Installs the Let's Encrypt client.
* [`letsencrypt::plugin::dns_cloudflare`](#letsencrypt--plugin--dns_cloudflare): Installs and configures the dns-cloudflare plugin
* [`letsencrypt::plugin::dns_rfc2136`](#letsencrypt--plugin--dns_rfc2136): Installs and configures the dns-rfc2136 plugin
* [`letsencrypt::plugin::dns_route53`](#letsencrypt--plugin--dns_route53): Installs and configures the dns-route53 plugin
Expand All @@ -19,6 +18,7 @@
#### Private Classes

* `letsencrypt::config`: Configures the Let's Encrypt client.
* `letsencrypt::install`: Installs the Let's Encrypt client.
* `letsencrypt::scripts`: Deploy helper scripts scripts

### Defined types
Expand Down Expand Up @@ -328,42 +328,6 @@ certificate. Two environmental variables are supplied by certbot:

Default value: `[]`

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

Installs the Let's Encrypt client.

#### Parameters

The following parameters are available in the `letsencrypt::install` class:

* [`configure_epel`](#-letsencrypt--install--configure_epel)
* [`package_ensure`](#-letsencrypt--install--package_ensure)
* [`package_name`](#-letsencrypt--install--package_name)

##### <a name="-letsencrypt--install--configure_epel"></a>`configure_epel`

Data type: `Boolean`

A feature flag to include the 'epel' class and depend on it for package installation.

Default value: `$letsencrypt::configure_epel`

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

Data type: `String`

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

Default value: `$letsencrypt::package_ensure`

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

Data type: `String`

Name of package to use when installing the client package.

Default value: `$letsencrypt::package_name`

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

This class installs and configures the Let's Encrypt dns-cloudflare plugin.
Expand Down
10 changes: 7 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
# @param package_ensure The value passed to `ensure` when installing the client package.
# @param package_name Name of package to use when installing the client package.
#
# @api private
#
class letsencrypt::install (
Boolean $configure_epel = $letsencrypt::configure_epel,
String $package_name = $letsencrypt::package_name,
String $package_ensure = $letsencrypt::package_ensure,
Boolean $configure_epel = $letsencrypt::configure_epel,
String $package_name = $letsencrypt::package_name,
String $package_ensure = $letsencrypt::package_ensure,
) {
assert_private()

package { 'letsencrypt':
ensure => $package_ensure,
name => $package_name,
Expand Down
50 changes: 0 additions & 50 deletions spec/classes/letsencrypt_install_spec.rb

This file was deleted.

8 changes: 4 additions & 4 deletions spec/classes/letsencrypt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,25 @@
end
is_expected.to contain_class('letsencrypt::install').with(package_name: 'certbot')
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
is_expected.to contain_package('letsencrypt').with(name: 'certbot')
is_expected.to contain_package('letsencrypt').with(name: 'certbot').with_ensure('installed')
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
elsif facts[:osfamily] == 'Debian'
is_expected.to contain_class('letsencrypt::install').with(package_name: 'certbot')
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
elsif facts[:operatingsystem] == 'Gentoo'
is_expected.to contain_class('letsencrypt::install').with(package_name: 'app-crypt/certbot')
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
is_expected.to contain_package('letsencrypt').with(name: 'app-crypt/certbot')
is_expected.to contain_package('letsencrypt').with(name: 'app-crypt/certbot').with_ensure('installed')
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
elsif facts[:operatingsystem] == 'OpenBSD'
is_expected.to contain_class('letsencrypt::install').with(package_name: 'certbot')
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
is_expected.to contain_package('letsencrypt').with(name: 'certbot')
is_expected.to contain_package('letsencrypt').with(name: 'certbot').with_ensure('installed')
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
elsif facts[:operatingsystem] == 'FreeBSD'
is_expected.to contain_class('letsencrypt::install').with(package_name: 'py39-certbot')
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
is_expected.to contain_package('letsencrypt').with(name: 'py39-certbot')
is_expected.to contain_package('letsencrypt').with(name: 'py39-certbot').with_ensure('installed')
is_expected.to contain_file('/usr/local/etc/letsencrypt').with(ensure: 'directory')
else
is_expected.to contain_class('letsencrypt::install')
Expand Down