ajcrowe / puppet-supervisord

Puppet Module to install and configure applications under supervisord
MIT License
37 stars 104 forks source link

Parameter issues #9

Closed rchrd2 closed 10 years ago

rchrd2 commented 10 years ago

Hello, thanks for writing this library. It ended up working for me instead of the more popular puppet-module-supervisor library. I found a couple issues that I want to point out.

Issue 1: autorestart requires the value to be a string, but autostart expects a bool. I think they should both expect bools.

Issue 2: stopwaitsecs isn't supported, but it could be useful implement

Here is an example puppet configuration:

  $supervisord_directory = '/var/www/django/venv/lib/python2.7/site-packages/myapp'
  $supervisord_environment = {
    'C_FORCE_ROOT' => true
  }
 supervisord::program { 'django-celery-indexers':
      directory    => $supervisord_directory,
      environment => $supervisord_environment,
      command     => '/var/www/django/venv/bin/honcho run /var/www/django/venv/bin/celery worker -Q indexers -P prefork --concurrency=2 --loglevel=info',
      user        => 'root',
      #group       => 'root',
      autostart => true,
      autorestart => 'true', ## this needs to be a string for some reason (06/05/2014)
      startsecs => 10,
      ###stopwaitsecs => 60, #gave me invalid parameter
      killasgroup => true,
      stopasgroup => true,
      numprocs => 1,
  }

Thanks.

ajcrowe commented 10 years ago

Hi rchrd2,

Thanks for the report. The first issue you raise is because autorestart can actually be three values, true, false and unexpected you can see the regex check here: here.

Given that unexpected is the default it could become a bool, but this would break configurations with it explicitly set, the other option would be to change all the bool fields to strings and regex match true and false. but I think this is probably not worth the disruption.

I've fixed the stopwaitsecs it was a typo on my part, it was there as stopwaitsec. I've fixed this and will push out 0.3.3 today.

Once again thanks for the feedback much appreciated!

rchrd2 commented 10 years ago

I see. Thanks for responding so quickly. I'll upgrade my module to grab the fix!