Commit a692ae54f17eb641c17a050475e1ada2c24df6a8

Authored by Sergio Oliveira
1 parent 9640afa7

Giving colab sudo rights and adding supervisor task

puppet/modules/colab/files/colab-sudoers 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +colab ALL = (root) NOPASSWD: /usr/local/bin/supervisorctl
  2 +colab ALL = (root) NOPASSWD: /etc/init.d/supervisord
  3 +
  4 +# Keep a blank line at the end of the file
... ...
puppet/modules/colab/manifests/init.pp
... ... @@ -11,14 +11,35 @@ class colab {
11 11 include supervisor
12 12 include colab::requirements
13 13  
  14 + group { 'colab':
  15 + ensure => present,
  16 + }
  17 +
14 18 user { 'colab':
15 19 ensure => present,
16 20 managehome => true,
17 21 shell => '/bin/bash',
  22 + gid => 'colab',
  23 + groups => ['sudo'],
18 24 }
19 25  
20 26 mailalias { 'colab':
21 27 ensure => present,
22 28 recipient => 'root',
23 29 }
  30 +
  31 + file { 'colab-sudoers':
  32 + ensure => present,
  33 + path => '/etc/sudoers.d/colab-sudoers',
  34 + source => 'puppet:///modules/colab/colab-sudoers',
  35 + mode => '0440',
  36 + owner => root,
  37 + group => root,
  38 + }
  39 +
  40 + supervisor::app { 'colab':
  41 + command => '/home/colab/.virtualenvs/colab/bin/gunicorn_django colab/src/colab',
  42 + directory => '/home/colab/',
  43 + user => 'colab',
  44 + }
24 45 }
... ...