Skip to content

Commit 4a4c467

Browse files
authored
Merge pull request #669 from voxpupuli/rework-package-management
Allow to skip management of python dev package
2 parents 2ac598c + 5bd8f1b commit 4a4c467

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

REFERENCE.md

+9
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ The following parameters are available in the `python` class:
7979
* [`umask`](#-python--umask)
8080
* [`manage_gunicorn`](#-python--manage_gunicorn)
8181
* [`manage_python_package`](#-python--manage_python_package)
82+
* [`manage_dev_package`](#-python--manage_dev_package)
8283
* [`manage_venv_package`](#-python--manage_venv_package)
8384
* [`manage_pip_package`](#-python--manage_pip_package)
8485
* [`venv`](#-python--venv)
@@ -192,6 +193,14 @@ manage the state for package python
192193

193194
Default value: `true`
194195

196+
##### <a name="-python--manage_dev_package"></a>`manage_dev_package`
197+
198+
Data type: `Boolean`
199+
200+
manage the state of the python development package
201+
202+
Default value: `true`
203+
195204
##### <a name="-python--manage_venv_package"></a>`manage_venv_package`
196205

197206
Data type: `Boolean`

manifests/init.pp

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# @param umask The default umask for invoked exec calls.
2020
# @param manage_gunicorn manage the state for package gunicorn
2121
# @param manage_python_package manage the state for package python
22+
# @param manage_dev_package manage the state of the python development package
2223
# @param manage_venv_package manage the state for package venv
2324
# @param manage_pip_package manage the state for package pip
2425
#
@@ -45,6 +46,7 @@
4546
Python::Package::Ensure $gunicorn = 'absent',
4647
Boolean $manage_gunicorn = true,
4748
Boolean $manage_python_package = true,
49+
Boolean $manage_dev_package = true,
4850
Boolean $manage_venv_package = $python::params::manage_venv_package,
4951
Boolean $manage_pip_package = $python::params::manage_pip_package,
5052
String[1] $gunicorn_package_name = $python::params::gunicorn_package_name,

manifests/install.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
}
5454
}
5555

56-
if $pythondev {
56+
if $python::manage_dev_package and $pythondev {
5757
package { 'python-dev':
5858
ensure => $python::dev,
5959
name => $pythondev,
@@ -179,7 +179,7 @@
179179
}
180180
}
181181

182-
if $pythondev {
182+
if $python::manage_dev_package and $pythondev {
183183
package { 'python-dev':
184184
ensure => $python::dev,
185185
name => $pythondev,
@@ -196,7 +196,7 @@
196196
}
197197
}
198198

199-
if $pythondev {
199+
if $python::manage_dev_package and $pythondev {
200200
package { 'python-dev':
201201
ensure => $python::dev,
202202
name => $pythondev,

spec/classes/python_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@
3434
let :params do
3535
{
3636
manage_python_package: false,
37+
manage_dev_package: false,
3738
manage_pip_package: false,
3839
manage_venv_package: false
3940
}
4041
end
4142

4243
it { is_expected.to compile.with_all_deps }
4344
it { is_expected.not_to contain_package('python') }
45+
it { is_expected.not_to contain_package('python-dev') }
4446
it { is_expected.not_to contain_package('pip') }
4547
it { is_expected.not_to contain_package('python-venv') }
4648
end

0 commit comments

Comments
 (0)