Hi all a few weeks back I posted some stuff in slack regarding the need to do a hab config apply in run hook to gather some information or allow variable information in the default.toml.
First Use Case
Variables in toml
My case comes from a situation of an unknown fqdn. We currently have multiple domain suffixes and based on the model we make no assumptions where the hab package will be used. Currently we can only return a host name from the habitat help information and not the fqdn for the host. if we were able to source hostname -f
or some equivalent inside the default.toml. That would allow us to gather the fqdn from the bind to setup connections. Currently connecting haproxy to an ip vs a hostname - which poses it own issues because 127.0.0.1 Issue.
Second Case
hab config apply in hook
This one is related to a service that is brand new and has no prior configuration. We use an app that secures all communication with a certificate and shares that cert with the members of it service group. The current method is - stand up the servers and app with no cert present for the app. Wait for leader election to occur. Once a leader is elected the leader generates a cert and writes it to a toml file and uses that toml as the input to a config apply for the service group. This scenario also satisfies the first case where we seed an empty field in the toml and when the server stands up with fill in the fqdn. And source that as a bind export.
I believe there are some more cases and hopefully that gives a enough of a rough idea with what we are looking for.