For anyone not following along, the story so far… I’ve been doing some work over the past couple weeks to learn Habitat and to improve the
core/consul plan to allow for server autodiscovery. With a ton of help from everyone especially @Defilan and @adam we’ve successed!!!111
Once that was complete I needed to figure out how to run
client (aka “agent”) mode, such that consul could communicate with the master cluster but isn’t participating in the raft consensus, as Hashicorp recommends against communicating directly with the Consul API. (as to why, frankly, I’m not certain, but let’s just push the “I believe button” for now). After a bit of struggle, I think I have it working too! (would love any feedback, maybe I can convince the powers that be to accept it into core! Wouldn’t that be a trip)
So. That brings us to today.
Basically I want to run Vault and Consul and say that "
core/vault depends on
qubitrenegade/consul-client", I think… The way
core/vault is written it uses the consul backend by default and expects there to be a consul endpoint listening on the loopback.
I can conceivably see two ways to run this.
core/consulplan to bind to the consul-client service. I think, however, that this would cause the
core/vaultpackage to find ANY consul-client, not necessarily just the consul-client listening on localhost.
Use a composite package that actually installs/starts both
core/vault. But that means that
core/vaultcan’t be run “out of the box” (except for running in “dev” mode), which I don’t know if that’s a good or a bad thing…
Can I modify config files in a composite package of dependent packages? If I create a
qubitrenegade/vault-ha package can I create a
/hab/user/vault/config/user.toml and override settings in the
default.toml? Essentially saying “when you run core/vault alone run it this way, when you run it with other services/hab packages run it that way”. Is it ok to have a package that doesn’t really work by itself and only works as part of a larger/composite package? I feel like the answer is maybe yes…