Skip to content

Commit f4206b1

Browse files
committed
(#236) Enable python module stream on EL8. Bump minimum puppet version
The certbot package on EL8 currently requires `/usr/bin/python3.6`, which is part of the `python36` module stream, and needs enabled in order to install. Bump the minimum puppet version to 6.15.0 since the enable_only feature of the dnfmodule provider was added in https://tickets.puppetlabs.com/browse/PUP-10235
1 parent 94ebf72 commit f4206b1

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

REFERENCE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The following parameters are available in the `letsencrypt` class:
6464
* [`environment`](#environment)
6565
* [`package_name`](#package_name)
6666
* [`package_ensure`](#package_ensure)
67+
* [`dnfmodule_version`](#dnfmodule_version)
6768
* [`package_command`](#package_command)
6869
* [`config_file`](#config_file)
6970
* [`config`](#config)
@@ -119,6 +120,14 @@ The value passed to `ensure` when installing the client package.
119120

120121
Default value: `'installed'`
121122

123+
##### <a name="dnfmodule_version"></a>`dnfmodule_version`
124+
125+
Data type: `String`
126+
127+
The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.
128+
129+
Default value: `'python36'`
130+
122131
##### <a name="package_command"></a>`package_command`
123132

124133
Data type: `String`
@@ -305,6 +314,7 @@ The following parameters are available in the `letsencrypt::install` class:
305314
* [`configure_epel`](#configure_epel)
306315
* [`package_ensure`](#package_ensure)
307316
* [`package_name`](#package_name)
317+
* [`dnfmodule_version`](#dnfmodule_version)
308318

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

@@ -330,6 +340,14 @@ Name of package to use when installing the client package.
330340

331341
Default value: `$letsencrypt::package_name`
332342

343+
##### <a name="dnfmodule_version"></a>`dnfmodule_version`
344+
345+
Data type: `String`
346+
347+
The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.
348+
349+
Default value: `$letsencrypt::dnfmodule_version`
350+
333351
### <a name="letsencryptplugindns_cloudflare"></a>`letsencrypt::plugin::dns_cloudflare`
334352

335353
This class installs and configures the Let's Encrypt dns-cloudflare plugin.

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# @param environment An optional array of environment variables
1717
# @param package_name Name of package and command to use when installing the client package.
1818
# @param package_ensure The value passed to `ensure` when installing the client package.
19+
# @param dnfmodule_version The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.
1920
# @param package_command Path or name for letsencrypt executable.
2021
# @param config_file The path to the configuration file for the letsencrypt cli.
2122
# @param config A hash representation of the letsencrypt configuration file.
@@ -57,6 +58,7 @@
5758
Array $environment = [],
5859
String $package_name = 'certbot',
5960
$package_ensure = 'installed',
61+
String[1] $dnfmodule_version = 'python36',
6062
String $package_command = 'certbot',
6163
Stdlib::Unixpath $config_dir = '/etc/letsencrypt',
6264
String $config_file = "${config_dir}/cli.ini",

manifests/install.pp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,23 @@
33
# @param configure_epel A feature flag to include the 'epel' class and depend on it for package installation.
44
# @param package_ensure The value passed to `ensure` when installing the client package.
55
# @param package_name Name of package to use when installing the client package.
6+
# @param dnfmodule_version The yum module stream version to enable on EL8 and greater variants using the `package` method with the `dnfmodule` provider.
67
#
78
class letsencrypt::install (
89
Boolean $configure_epel = $letsencrypt::configure_epel,
910
String $package_name = $letsencrypt::package_name,
1011
String $package_ensure = $letsencrypt::package_ensure,
12+
String[1] $dnfmodule_version = $letsencrypt::dnfmodule_version,
1113
) {
14+
if ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] >= '8') {
15+
package { 'enable python module stream':
16+
name => $dnfmodule_version,
17+
enable_only => true,
18+
provider => 'dnfmodule',
19+
before => Package['letsencrypt']
20+
}
21+
}
22+
1223
package { 'letsencrypt':
1324
ensure => $package_ensure,
1425
name => $package_name,

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"requirements": [
7171
{
7272
"name": "puppet",
73-
"version_requirement": ">= 6.1.0 < 8.0.0"
73+
"version_requirement": ">= 6.15.0 < 8.0.0"
7474
}
7575
],
7676
"dependencies": [

spec/classes/letsencrypt_install_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
{
1010
configure_epel: false,
1111
package_ensure: 'installed',
12-
package_name: 'letsencrypt'
12+
package_name: 'letsencrypt',
13+
dnfmodule_version: 'python36'
1314
}
1415
end
1516
let(:additional_params) { {} }
@@ -44,6 +45,13 @@
4445
is_expected.to contain_package('letsencrypt').that_requires('Class[epel]')
4546
end
4647
end
48+
49+
case facts[:operatingsystemmajrelease]
50+
when '7'
51+
it { is_expected.not_to contain_package('enable python module stream').with_name('python36') }
52+
when '8'
53+
it { is_expected.to contain_package('enable python module stream').with_name('python36').with_enable_only('true').with_provider('dnfmodule') }
54+
end
4755
end
4856
end
4957
end

0 commit comments

Comments
 (0)