diff --git a/puppet/modules/colab/files/colab-sudoers b/puppet/modules/colab/files/colab-sudoers new file mode 100644 index 0000000..9a5faf2 --- /dev/null +++ b/puppet/modules/colab/files/colab-sudoers @@ -0,0 +1,4 @@ +colab ALL = (root) NOPASSWD: /usr/local/bin/supervisorctl +colab ALL = (root) NOPASSWD: /etc/init.d/supervisord + +# Keep a blank line at the end of the file diff --git a/puppet/modules/colab/manifests/init.pp b/puppet/modules/colab/manifests/init.pp index 869406b..270ddf6 100644 --- a/puppet/modules/colab/manifests/init.pp +++ b/puppet/modules/colab/manifests/init.pp @@ -11,14 +11,35 @@ class colab { include supervisor include colab::requirements + group { 'colab': + ensure => present, + } + user { 'colab': ensure => present, managehome => true, shell => '/bin/bash', + gid => 'colab', + groups => ['sudo'], } mailalias { 'colab': ensure => present, recipient => 'root', } + + file { 'colab-sudoers': + ensure => present, + path => '/etc/sudoers.d/colab-sudoers', + source => 'puppet:///modules/colab/colab-sudoers', + mode => '0440', + owner => root, + group => root, + } + + supervisor::app { 'colab': + command => '/home/colab/.virtualenvs/colab/bin/gunicorn_django colab/src/colab', + directory => '/home/colab/', + user => 'colab', + } } -- libgit2 0.21.2