Skip to content

Commit 042f4ee

Browse files
author
Sergey Stankevich
committed
Merging master
2 parents 9d019a6 + fdf8101 commit 042f4ee

5 files changed

Lines changed: 32 additions & 22 deletions

File tree

Modulefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name 'stankevich-python'
2-
version '1.5.0'
2+
version '1.6.0'
33

44
author 'Sergey Stankevich'
55
license 'Apache License, Version 2.0'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Installs and manages python, python-dev, python-virtualenv and Gunicorn.
3737

3838
**gunicorn** - Install Gunicorn. Default: false
3939

40+
**manage_gunicorn** - Allow Installation / Removal of Gunicorn. Default: true
41+
4042
class { 'python':
4143
version => 'system',
4244
dev => true,

manifests/config.pp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@
2121

2222
Python::Virtualenv <| |> -> Python::Pip <| |>
2323

24-
if $python::gunicorn {
25-
Class['python::install'] -> Python::Gunicorn <| |>
24+
if $python::manage_gunicorn {
25+
if $python::gunicorn {
26+
Class['python::install'] -> Python::Gunicorn <| |>
2627

27-
Python::Gunicorn <| |> ~> Service['gunicorn']
28+
Python::Gunicorn <| |> ~> Service['gunicorn']
2829

29-
service { 'gunicorn':
30-
ensure => running,
31-
enable => true,
32-
hasrestart => true,
33-
hasstatus => false,
34-
pattern => '/usr/bin/gunicorn',
30+
service { 'gunicorn':
31+
ensure => running,
32+
enable => true,
33+
hasrestart => true,
34+
hasstatus => false,
35+
pattern => '/usr/bin/gunicorn',
36+
}
3537
}
3638
}
37-
}
39+
40+
}

manifests/init.pp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# [*gunicorn*]
2121
# Install Gunicorn. Default: false
2222
#
23+
# [*manage_gunicorn*]
24+
# Allow Installation / Removal of Gunicorn. Default: true
25+
#
2326
# === Examples
2427
#
2528
# class { 'python':
@@ -35,12 +38,13 @@
3538
# Sergey Stankevich
3639
#
3740
class python (
38-
$version = 'system',
39-
$pip = false,
40-
$dev = false,
41-
$virtualenv = false,
42-
$gunicorn = false,
43-
$provider = undef,
41+
$version = 'system',
42+
$pip = false,
43+
$dev = false,
44+
$virtualenv = false,
45+
$gunicorn = false,
46+
$manage_gunicorn = true,
47+
$provider = undef
4448
) {
4549

4650
# Module compatibility check

manifests/install.pp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@
5656
}
5757
}
5858

59-
$gunicorn_ensure = $python::gunicorn ? {
60-
true => present,
61-
default => absent,
59+
if $python::manage_gunicorn {
60+
$gunicorn_ensure = $python::gunicorn ? {
61+
true => present,
62+
default => absent,
63+
}
64+
package { 'gunicorn': ensure => $gunicorn_ensure }
6265
}
6366

64-
package { 'gunicorn': ensure => $gunicorn_ensure }
65-
6667
}

0 commit comments

Comments
 (0)