-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding the Consul executable #311
Comments
What does your wrapper cookbook look like? There are a few ways we could go about this. Adding in an optional symlink is okay, but not always preferable if there needs to be multiple versions. |
I always found managing symlinks for this type of stuff to be a pain in the providers. Since we're auto-generating the scripts that run these services (consul, vault, consul template). It's easier to just reference the direct path of the versioning we're managing. |
It is also worth nothing that you can grab the resource object and get the path to the executable. I think that this syntax is correct. include_recipe 'consul::default'
consul = node.run_context.resource_collection.find('consul_installation[0.6.4]')
puts consul.consul_program You would probably want to do this within a ruby block so that its done at convergence time instead of compile time. I'm not sure if that's lazily evaluated. |
Thanks, that does the trick! I didn't know you could do that. It doesn't appear to need to be in a ruby block, but I'll do some more testing. It's actually an application cookbook for |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
With the changes in version 2, the Consul executable will be at
/opt/consul/<version>/consul
if installed usingbinary,
/usr/local/src/consul/bin/consulif installed via git, or
/usr/local/bin/consulin installed using a package manager .
/optis not typically in the
PATH`.I have a downstream cookbook that needs to reference the Consul executable. I used to be able to reference it using
consul
and it would find it on the path. I could re-create the path to consul myself, but that requires knowledge of the internal workings of this cookbook, which could potentially change.I'd suggest either symlinking all Consul executables to a single location, such as
/usr/local/bin
, or "publishing" the location using node attributes or therun_state
.Thoughts?
The text was updated successfully, but these errors were encountered: