I'm trying to restart Supervisor through my Ansible Playbook but I seem to be stumbling into an issue with the supervisor module for Ansible.

In my Supervisor config I have defined a program:


And this works fine. However, when I try to restart Supervisor through Ansible I get the following error:

failed: [box1] => {"failed": true}
msg: program:process: ERROR (no such process)
program:process: ERROR (no such process)

My Ansible task configuration looks like this:

- name: Restart Supervisor
  sudo: yes
  supervisorctl: name=program:process state=restarted config=/etc/supervisor/supervisord.conf

For the name parameter I have tried program:process, program, program: and process but none seem to work. I'm currently on Ansible 1.5.4.

  • 1
    The first thing to do is to update Ansible. There's virtually no reason why you should be on such an old version. Mar 14, 2016 at 4:55
  • It's the out of the box version that comes with Ubuntu 14.04 LTS. I understand it's a bit dated but nothing in the Ansible manual in regards to the Supervisor module indicates I should update (apart from the group name thing which I'm not interested in). Granted, a newer version might have bug fixes but, what I'm trying seems pretty rudimentary that not a latest version should be able to handle it.
    – Luke
    Mar 14, 2016 at 5:29
  • I'm fairly sure you need Ansible 1.6 or later for this, as that's when group support was added. Even Red Hat is tracking the latest stable version (they're currently on 1.9.4), so I don't know what the deal is with Ubuntu here. Of course on Red Hat you could just use systemd and forget about all this supervisor stuff. Mar 14, 2016 at 5:32
  • No worries. This is the documentation I'm going off: docs.ansible.com/ansible/supervisorctl_module.html
    – Luke
    Mar 14, 2016 at 6:08
  • Right, and that's the very same page that notes you need 1.6! Mar 14, 2016 at 6:09

1 Answer 1


The supervisorctl Ansible module does not support the reload command (see here), which is needed for supervisor to pick up new configuration entries.

You can do it yourself like this:

- command: supervisorctl reread
  sudo: yes
- supervisorctl: name=program:process state=restarted config=/etc/supervisor/supervisord.conf
  sudo: yes

The documentation on reload/reread/update/restart seems to be missing, and this blog post is out of date; you can experiment to make sure reload does what you expect.

Finally, don't put your program definitions in supervisord.conf. Instead, put them as individual files in /etc/supervisor/conf.d/*.conf. That makes installation and maintenance much easier.

  • 2
    Thanks for that. Much appreciated, however, it doesn't make a difference. The supervisorctl task is still failing because it can't reference/find the program:process. This seems to be an issue in this Ansible module (and yes, I don't place my program definitions inside the supervisord.conf and they are loaded from external conf files). In the end I went with a simple Ansible command, bypassing the Supervisor module altogether: command: supervisorctl -c /etc/supervisor/supervisord.conf restart and this works perfectly.
    – Luke
    Mar 14, 2016 at 21:51
  • does it work without the -c, @luke ?
    – tedder42
    Mar 14, 2016 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.