diff --git a/bin/run_sigi b/bin/run_sigi index 6ddfde4..a6ddc73 100755 --- a/bin/run_sigi +++ b/bin/run_sigi @@ -2,6 +2,7 @@ NAME="sigi" DJANGODIR=/srv/sigi +VENVDIR=/srv/.virtualenvs/sigi/bin SOCKFILE=/var/run/sigi/sigi.sock USER=sigi GROUP=sigi @@ -18,7 +19,7 @@ export PYTHONPATH=$DJANGODIR:$PYTHONPATH RUNDIR=$(dirname $SOCKFILE) test -d $RUNDIR || mkdir -p $RUNDIR -exec gunicorn ${DJANGO_WSGI_MODULE}:application \ +exec ${VENVDIR}/gunicorn ${DJANGO_WSGI_MODULE}:application \ --name $NAME \ --workers $NUM_WORKERS \ --user=$USER --group=$GROUP \ diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index f6c5788..34f8ce7 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -1,3 +1,7 @@ +Exec { + path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', +} + group { 'sigi': ensure => 'present', } @@ -97,6 +101,26 @@ exec { 'collectstatic': # TODO local_settings.py ... +########################################################################### +# SUPERVISOR + +# XXX trocar isso por algum plugin do puppet? + +$supervisor_conf = '/etc/supervisor/conf.d/sigi.conf' + +file { $supervisor_conf: + ensure => link, + target => "${sigi_dir}/etc/supervisor/conf.d/sigi.conf", + require => [ + Vcsrepo[$sigi_dir], + Package['supervisor'] ] +} + +exec { 'supervisor_update': + command => 'supervisorctl reread && supervisorctl update', + refreshonly => true, + subscribe => [ File[$supervisor_conf], Vcsrepo[$sigi_dir]], +} ########################################################################### # NGINX