using 'supervisorctl' in ansible playbook; Error "Failed to find executable supervisorctl"

1.2k Views Asked by At

Overview: I'm trying to install supervisor and run program process within an ansible playbook.

I'm able to install supervisor and such but when I try to get into supervisorctl to run a simple program, it's unable to find the executable supervisorctl.

This is the portion of the code that fails:

- supervisorctl:
      name=program:CAT
      state=started
      config=/etc/supervisor/supervisord.conf

with the resulting error:

TASK [supervisorctl] ***********************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to find required executable supervisorctl"}

However, when I run the simple command in my terminal, it works:

supervisord -c /etc/supervisord.conf

and I can view the program running by going into 'supervisorctl' in the terminal and typing 'status':

$ supervisorctl
CAT                              STOPPED   Dec 27 04:12 PM
supervisor> 

Can anyone point me to what/where my error most likely is?

I would guess the error message is suggesting I did not correctly install supervisor but the fact that I can do these things out of the playbook makes me think I can. I tried specifiying the path to the executable 'supervisorctl' but I don't think that's legal syntax in the playbook because that creates other errors.

*Worth noting, I'm in a virtualenv that runs python2.7

1

There are 1 best solutions below

0
On

I realized that there is a parameter option in the configure documentation that allows me to specify the path to the supervisorctl executable and that worked! (in that I now have a different error)

Modified the above script to look like:

- supervisorctl:
      name=program:CAT
      state=started
      config=/etc/supervisor/supervisord.conf
      supervisorctl_path=/usr/bin/supervisorctl