Anton Shestakov <av6@dwimlabs.net>, Sat, 25 Jun 2016 14:34:47 +0800
drop some defaults and unrelated config directives from supervisor config
- process_name defaults to the part after "program:"
- stopsignal defaults to SIGTERM, which also works fine for hgweb
- numprocs defaults to 1
- autorestart defaults to "unexpected", which is fine and is less surprising
playbook-example.yml
Permissions: -rw-r--r--
# NOTE: you probably don't want to run these commands on a real box. But # bear in mind that to be able to access hgweb from inside the box, you # need to use the virtual host name (i.e. http://127.0.0.1/ won't work). # Make sure you have DNS records for hg.mydomain or add it to /etc/hosts. hostname: name={{ hostname }} - name: Update /etc/hosts lineinfile: dest=/etc/hosts line="127.0.0.1 {{ hostname }} hg.{{ hostname }}" # NOTE: this role depends on nginx and supervisor packages being installed, # and also it uses two handlers: # This role doesn't have the handlers, so this playbook restarts the # services in post_tasks instead. apt: package=nginx-full state=installed update_cache=yes cache_valid_time=3600 - name: Disable default Nginx site file: path=/etc/nginx/sites-enabled/default state=absent - name: Install Supervisor apt: package=supervisor state=installed service: name=nginx state=restarted - name: Restart Supervisor service: name=supervisor state=restarted sleep=1