Skip to content

Commit

Permalink
(voxpupuli#236) Enable python module stream on EL8
Browse files Browse the repository at this point in the history
  • Loading branch information
yachub committed Oct 23, 2021
1 parent d2497f8 commit f5e24f4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
18 changes: 18 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The following parameters are available in the `letsencrypt` class:
* [`environment`](#environment)
* [`package_name`](#package_name)
* [`package_ensure`](#package_ensure)
* [`dnfmodule_version`](#dnfmodule_version)
* [`package_command`](#package_command)
* [`config_file`](#config_file)
* [`config`](#config)
Expand Down Expand Up @@ -116,6 +117,14 @@ The value passed to `ensure` when installing the client with the `package` metho

Default value: `'installed'`

##### <a name="dnfmodule_version"></a>`dnfmodule_version`

Data type: `String`

The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.

Default value: `'python36'`

##### <a name="package_command"></a>`package_command`

Data type: `String`
Expand Down Expand Up @@ -302,6 +311,7 @@ The following parameters are available in the `letsencrypt::install` class:
* [`configure_epel`](#configure_epel)
* [`package_ensure`](#package_ensure)
* [`package_name`](#package_name)
* [`dnfmodule_version`](#dnfmodule_version)

##### <a name="configure_epel"></a>`configure_epel`

Expand All @@ -327,6 +337,14 @@ Name of package to use when installing the client with the `package` method.

Default value: `$letsencrypt::package_name`

##### <a name="dnfmodule_version"></a>`dnfmodule_version`

Data type: `String`

The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.

Default value: `$letsencrypt::dnfmodule_version`

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

This class installs and configures the Let's Encrypt dns-rfc2136 plugin.
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# @param environment An optional array of environment variables
# @param package_name Name of package and command to use when installing the client with the `package` method.
# @param package_ensure The value passed to `ensure` when installing the client with the `package` method.
# @param dnfmodule_version The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.
# @param package_command Path or name for letsencrypt executable when installing the client with the `package` method.
# @param config_file The path to the configuration file for the letsencrypt cli.
# @param config A hash representation of the letsencrypt configuration file.
Expand Down Expand Up @@ -57,6 +58,7 @@
Array $environment = [],
String $package_name = 'certbot',
$package_ensure = 'installed',
String $dnfmodule_version = 'python36',
String $package_command = 'certbot',
Stdlib::Unixpath $config_dir = '/etc/letsencrypt',
String $config_file = "${config_dir}/cli.ini",
Expand Down
10 changes: 10 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
# @param configure_epel A feature flag to include the 'epel' class and depend on it for package installation.
# @param package_ensure The value passed to `ensure` when installing the client with the `package` method.
# @param package_name Name of package to use when installing the client with the `package` method.
# @param dnfmodule_version The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.
#
class letsencrypt::install (
Boolean $configure_epel = $letsencrypt::configure_epel,
String $package_name = $letsencrypt::package_name,
String $package_ensure = $letsencrypt::package_ensure,
String $dnfmodule_version = $letsencrypt::dnfmodule_version,
) {
if ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] >= '8') {
package { 'enable python module stream':
name => $dnfmodule_version,
enable_only => true,
provider => 'dnfmodule',
}
}

package { 'letsencrypt':
ensure => $package_ensure,
name => $package_name,
Expand Down
10 changes: 9 additions & 1 deletion spec/classes/letsencrypt_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
{
configure_epel: false,
package_ensure: 'installed',
package_name: 'letsencrypt'
package_name: 'letsencrypt',
dnfmodule_version: 'python36'
}
end
let(:additional_params) { {} }
Expand Down Expand Up @@ -42,6 +43,13 @@
is_expected.to contain_package('letsencrypt').that_requires('Class[epel]')
end
end

case facts[:operatingsystemmajrelease]
when '7'
it { is_expected.not_to contain_package('enable python module stream').with_name('python36') }
when '8'
it { is_expected.to contain_package('enable python module stream').with_name('python36').with_enable_only('true').with_provider('dnfmodule') }
end
end
end
end
Expand Down

0 comments on commit f5e24f4

Please sign in to comment.