summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <sergey.stankevich@gmail.com>2014-01-04 10:24:07 +0300
committerSergey Stankevich <sergey.stankevich@gmail.com>2014-01-04 10:24:07 +0300
commit042f4eed2e15834a3c49abab485e5037ab805ca3 (patch)
tree912cc2c4dd17317561427e0e4cf09cff076a1cef
parent9d019a6cba04f95a14a8d57fc2510732e9a5b53e (diff)
parentfdf81012ea5f3d8124c86f41d91e4e97f769bc80 (diff)
Merging master
-rw-r--r--Modulefile2
-rw-r--r--README.md2
-rw-r--r--manifests/config.pp23
-rw-r--r--manifests/init.pp16
-rw-r--r--manifests/install.pp11
5 files changed, 32 insertions, 22 deletions
diff --git a/Modulefile b/Modulefile
index 3e205cf..4f2424b 100644
--- a/Modulefile
+++ b/Modulefile
@@ -1,5 +1,5 @@
name 'stankevich-python'
-version '1.5.0'
+version '1.6.0'
author 'Sergey Stankevich'
license 'Apache License, Version 2.0'
diff --git a/README.md b/README.md
index 751376a..6aa0c98 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,8 @@ Installs and manages python, python-dev, python-virtualenv and Gunicorn.
**gunicorn** - Install Gunicorn. Default: false
+**manage_gunicorn** - Allow Installation / Removal of Gunicorn. Default: true
+
class { 'python':
version => 'system',
dev => true,
diff --git a/manifests/config.pp b/manifests/config.pp
index 52c10be..c7196f2 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -21,17 +21,20 @@ class python::config {
Python::Virtualenv <| |> -> Python::Pip <| |>
- if $python::gunicorn {
- Class['python::install'] -> Python::Gunicorn <| |>
+ if $python::manage_gunicorn {
+ if $python::gunicorn {
+ Class['python::install'] -> Python::Gunicorn <| |>
- Python::Gunicorn <| |> ~> Service['gunicorn']
+ Python::Gunicorn <| |> ~> Service['gunicorn']
- service { 'gunicorn':
- ensure => running,
- enable => true,
- hasrestart => true,
- hasstatus => false,
- pattern => '/usr/bin/gunicorn',
+ service { 'gunicorn':
+ ensure => running,
+ enable => true,
+ hasrestart => true,
+ hasstatus => false,
+ pattern => '/usr/bin/gunicorn',
+ }
}
}
-} \ No newline at end of file
+
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index 451bdda..4797b11 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -20,6 +20,9 @@
# [*gunicorn*]
# Install Gunicorn. Default: false
#
+# [*manage_gunicorn*]
+# Allow Installation / Removal of Gunicorn. Default: true
+#
# === Examples
#
# class { 'python':
@@ -35,12 +38,13 @@
# Sergey Stankevich
#
class python (
- $version = 'system',
- $pip = false,
- $dev = false,
- $virtualenv = false,
- $gunicorn = false,
- $provider = undef,
+ $version = 'system',
+ $pip = false,
+ $dev = false,
+ $virtualenv = false,
+ $gunicorn = false,
+ $manage_gunicorn = true,
+ $provider = undef
) {
# Module compatibility check
diff --git a/manifests/install.pp b/manifests/install.pp
index b2debcc..c4914f7 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -56,11 +56,12 @@ class python::install {
}
}
- $gunicorn_ensure = $python::gunicorn ? {
- true => present,
- default => absent,
+ if $python::manage_gunicorn {
+ $gunicorn_ensure = $python::gunicorn ? {
+ true => present,
+ default => absent,
+ }
+ package { 'gunicorn': ensure => $gunicorn_ensure }
}
- package { 'gunicorn': ensure => $gunicorn_ensure }
-
}