Open jchannon opened 6 years ago
I am trying to add a supervisorctl config so that it starts consul
This is exactly what the run-consul module already does. Any reason you can't just use that?
However, if I set my scripts to use sudo supervisorctl, the root user then can't see consul for some reason
By "see", do you mean find the consul
binary? If so, it's in /opt/consul/bin
by default, so you can either add that to $PATH
or call Consul via an absolute path (i.e., /opt/consul/bin/consul
).
Ah interesting I've just checked and we're using 0.1.0
so I'm guessing some improvements have been made. Here's what we use to execute:
- "git clone --branch v{{user `consul_module_version`}} https://github.com/hashicorp/terraform-aws-consul.git /tmp/terraform-aws-consul"
- "/tmp/terraform-aws-consul/modules/install-consul/install-consul --version {{user `consul_version`}}"
Looking at your links I could upload my json and conf files and hopefully all will be well when the agent starts
Yup understood, the above sample code of mine is in a packer yml file
I am trying to add a
supervisorctl
config so that it startsconsul
as part of a packer image however the packer image is run asec2-user
which can't seem to runsupervisorctl
and results inerror: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib64/python2.7/socket.py line: 228
so I could fix thesupervisorctl
permissions. However, if I set my scripts to usesudo supervisorctl
, the root user then can't seeconsul
for some reason so I was wondering what your recommendation would be?Thanks