Skip to content

Commit bba0433

Browse files
committed
Replace params.pp with module data in Hiera
Update spec for params.pp to Hiera conversion Remove EL7, remove facts check, replace lookup with variable calls Add pre_condition to spec Add missing newlines
1 parent e947a61 commit bba0433

14 files changed

Lines changed: 52 additions & 64 deletions

File tree

‎REFERENCE.md‎

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
* `python::config`: Optionally installs the gunicorn service
1717
* `python::install`: Installs core python packages
18-
* `python::params`: The python Module default configuration settings.
1918

2019
### Defined types
2120

@@ -83,6 +82,8 @@ The following parameters are available in the `python` class:
8382
* [`manage_dev_package`](#-python--manage_dev_package)
8483
* [`manage_venv_package`](#-python--manage_venv_package)
8584
* [`manage_pip_package`](#-python--manage_pip_package)
85+
* [`group`](#-python--group)
86+
* [`pip_lookup_path`](#-python--pip_lookup_path)
8687
* [`venv`](#-python--venv)
8788
* [`gunicorn_package_name`](#-python--gunicorn_package_name)
8889
* [`python_pips`](#-python--python_pips)
@@ -170,7 +171,7 @@ Data type: `Boolean`
170171

171172
to determine if the epel class is used.
172173

173-
Default value: `$python::params::use_epel`
174+
Default value: `false`
174175

175176
##### <a name="-python--manage_scl"></a>`manage_scl`
176177

@@ -212,15 +213,31 @@ Data type: `Boolean`
212213

213214
manage the state for package venv
214215

215-
Default value: `$python::params::manage_venv_package`
216+
Default value: `true`
216217

217218
##### <a name="-python--manage_pip_package"></a>`manage_pip_package`
218219

219220
Data type: `Boolean`
220221

221222
manage the state for package pip
222223

223-
Default value: `$python::params::manage_pip_package`
224+
Default value: `true`
225+
226+
##### <a name="-python--group"></a>`group`
227+
228+
Data type: `String[1]`
229+
230+
The group owner of the virtulenv and dotfile
231+
232+
Default value: `'root'`
233+
234+
##### <a name="-python--pip_lookup_path"></a>`pip_lookup_path`
235+
236+
Data type: `Array`
237+
238+
The paths used when bootstrapping pip
239+
240+
Default value: `['/bin', '/usr/bin', '/usr/local/bin']`
224241

225242
##### <a name="-python--venv"></a>`venv`
226243

@@ -236,7 +253,7 @@ Data type: `String[1]`
236253

237254

238255

239-
Default value: `$python::params::gunicorn_package_name`
256+
Default value: `'gunicorn'`
240257

241258
##### <a name="-python--python_pips"></a>`python_pips`
242259

@@ -422,7 +439,7 @@ Data type: `String[1]`
422439

423440
group owner of dotfile
424441

425-
Default value: `getvar('python::params::group')`
442+
Default value: `$python::group`
426443

427444
##### <a name="-python--dotfile--config"></a>`config`
428445

@@ -771,7 +788,7 @@ Data type: `Optional[String[1]]`
771788

772789
The group of the virtualenv being manipulated.
773790

774-
Default value: `getvar('python::params::group')`
791+
Default value: `$python::group`
775792

776793
##### <a name="-python--pip--index"></a>`index`
777794

‎data/os/AIX.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
python::group: system
2+
python::pip_lookup_path:
3+
- /bin
4+
- /usr/bin
5+
- /usr/local/bin
6+
- /opt/freeware/bin/

‎data/os/Archlinux.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
python::default_system_version: "3.13"
2+
python::manage_pip_package: false
3+
python::manage_venv_package: false

‎data/os/Fedora.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python::use_epel: false

‎data/os/FreeBSD.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
python::group: wheel
12
python::default_system_version: "3.11"

‎data/os/RedHat.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python::gunicorn_package_name: python3-gunicorn
2+
python::use_epel: true

‎manifests/dotfile.pp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Enum['absent', 'present'] $ensure = 'present',
2727
Stdlib::Absolutepath $filename = $title,
2828
String[1] $owner = 'root',
29-
String[1] $group = getvar('python::params::group'),
29+
String[1] $group = $python::group,
3030
Stdlib::Filemode $mode = '0644',
3131
Hash $config = {},
3232
) {

‎manifests/init.pp‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
# @param manage_dev_package manage the state of the python development package
2424
# @param manage_venv_package manage the state for package venv
2525
# @param manage_pip_package manage the state for package pip
26+
# @param group The group owner of the virtulenv and dotfile
27+
# @param pip_lookup_path The paths used when bootstrapping pip
2628
#
2729
# @example install python from system python
2830
# class { 'python':
@@ -49,20 +51,22 @@
4951
Boolean $manage_gunicorn = true,
5052
Boolean $manage_python_package = true,
5153
Boolean $manage_dev_package = true,
52-
Boolean $manage_venv_package = $python::params::manage_venv_package,
53-
Boolean $manage_pip_package = $python::params::manage_pip_package,
54-
String[1] $gunicorn_package_name = $python::params::gunicorn_package_name,
54+
Boolean $manage_venv_package = true,
55+
Boolean $manage_pip_package = true,
56+
String[1] $gunicorn_package_name = 'gunicorn',
5557
Optional[Python::Provider] $provider = undef,
5658
Hash $python_pips = {},
5759
Hash $python_pyvenvs = {},
5860
Hash $python_requirements = {},
5961
Hash $python_dotfiles = {},
60-
Boolean $use_epel = $python::params::use_epel,
62+
Boolean $use_epel = false,
6163
Boolean $rhscl_use_public_repository = true,
6264
Stdlib::Httpurl $anaconda_installer_url = 'https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh',
6365
Stdlib::Absolutepath $anaconda_install_path = '/opt/python',
6466
Boolean $manage_scl = true,
65-
) inherits python::params {
67+
String[1] $group = 'root',
68+
Array $pip_lookup_path = ['/bin', '/usr/bin', '/usr/local/bin'],
69+
) {
6670
$exec_prefix = $provider ? {
6771
'scl' => "/usr/bin/scl enable ${version} -- ",
6872
'rhscl' => "/usr/bin/scl enable ${version} -- ",

‎manifests/params.pp‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎manifests/pip.pp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
String[1] $pip_provider = 'pip',
5656
Variant[Boolean, String] $url = false,
5757
String[1] $owner = 'root',
58-
Optional[String[1]] $group = getvar('python::params::group'),
58+
Optional[String[1]] $group = $python::group,
5959
Optional[Python::Umask] $umask = undef,
6060
Variant[Boolean,String[1]] $index = false,
6161
Variant[Boolean,String[1]] $extra_index = false,

0 commit comments

Comments
 (0)