diff options
-rw-r--r-- | manifests/config.pp | 21 | ||||
-rw-r--r-- | manifests/init.pp | 9 | ||||
-rw-r--r-- | manifests/install.pp | 11 |
3 files changed, 22 insertions, 19 deletions
diff --git a/manifests/config.pp b/manifests/config.pp index 49e5230..fdd808f 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -6,18 +6,19 @@ 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', + } } } - } diff --git a/manifests/init.pp b/manifests/init.pp index c4e469d..574573b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -35,10 +35,11 @@ # class python ( $version = 'system', - $pip = false, - $dev = false, - $virtualenv = false, - $gunicorn = false + $pip = false, + $dev = false, + $virtualenv = false, + $gunicorn = false, + $manage_gunicorn = false ) { # Module compatibility check diff --git a/manifests/install.pp b/manifests/install.pp index 415092e..caead49 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -32,11 +32,12 @@ class python::install { package { 'python-virtualenv': ensure => $venv_ensure } - $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 } - } |