Skip to content

Commit 103bcc2

Browse files
committed
Install dev packages in python::install::dev
1 parent 5bd8f1b commit 103bcc2

File tree

3 files changed

+46
-15
lines changed

3 files changed

+46
-15
lines changed

REFERENCE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#### Public Classes
1010

1111
* [`python`](#python): Installs and manages python, python-dev and gunicorn.
12+
* [`python::install::dev`](#python--install--dev): Installs python development packages
1213
* [`python::pip::bootstrap`](#python--pip--bootstrap): allow to bootstrap pip when python is managed from other module
1314

1415
#### Private Classes
@@ -289,6 +290,10 @@ Data type: `Stdlib::Absolutepath`
289290

290291
Default value: `'/opt/python'`
291292

293+
### <a name="python--install--dev"></a>`python::install::dev`
294+
295+
Installs python development packages
296+
292297
### <a name="python--pip--bootstrap"></a>`python::pip::bootstrap`
293298

294299
allow to bootstrap pip when python is managed from other module

manifests/install.pp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@
5454
}
5555

5656
if $python::manage_dev_package and $pythondev {
57-
package { 'python-dev':
58-
ensure => $python::dev,
59-
name => $pythondev,
60-
}
57+
include python::install::dev
6158
}
6259

6360
# Respect the $python::pip setting
@@ -180,12 +177,7 @@
180177
}
181178

182179
if $python::manage_dev_package and $pythondev {
183-
package { 'python-dev':
184-
ensure => $python::dev,
185-
name => $pythondev,
186-
alias => $pythondev,
187-
provider => 'yum',
188-
}
180+
include python::install::dev
189181
}
190182
}
191183
default: {
@@ -197,11 +189,7 @@
197189
}
198190

199191
if $python::manage_dev_package and $pythondev {
200-
package { 'python-dev':
201-
ensure => $python::dev,
202-
name => $pythondev,
203-
alias => $pythondev,
204-
}
192+
include python::install::dev
205193
}
206194
}
207195
}

manifests/install/dev.pp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# @summary Installs python development packages
2+
class python::install::dev {
3+
include python
4+
5+
case $python::provider {
6+
'pip': {
7+
package { 'python-dev':
8+
ensure => $python::dev,
9+
name => $python::install::pythondev,
10+
}
11+
}
12+
'scl': {
13+
}
14+
'rhscl': {
15+
}
16+
'anaconda': {
17+
}
18+
default: {
19+
case $facts['os']['family'] {
20+
'AIX': {
21+
package { 'python-dev':
22+
ensure => $python::dev,
23+
name => $python::install::pythondev,
24+
alias => $python::install::pythondev,
25+
provider => 'yum',
26+
}
27+
}
28+
default: {
29+
package { 'python-dev':
30+
ensure => $python::dev,
31+
name => $python::install::pythondev,
32+
alias => $python::install::pythondev,
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)