hiera-eyaml
hiera-eyaml copied to clipboard
Add support for system wide config file
You can make a user config file like so
~/.eyaml/config.yaml
You can additionally create environment variables to override this file
hiera-eyaml should also support a system wide config file.
/etc/eyaml/config.yaml
@sihil @TomPoulton this is a fairly trivial 1-2 line implementation - do you think the order should be:
Environment variable ---> /etc/eyaml/config.yaml ---> ~/.eyaml/config.yaml or Environment variable ---> ~/.eyaml/config.yaml ---> /etc/eyaml/config.yaml?
Any other locations in the mix whilst we are at it?
Is there any concern that we dont ever create /etc/eyaml directory and that would be left up to the user?
+1
it's irritating for eyaml
to check in the current working directory for it's keys.
In actual fact, you can already do this, as it well documented in the README, so this is a non-issue. but I have added /etc/eyaml/config.yaml as a default place to look for config in the pull request above
apologies for missing that in the README. either way, I'm happy to have support for /etc/eyaml/config.yaml
. it's easier to drop a system-wide config than configure ENV variables for every shell/sysadmin/login method.
I'm curious where this is stated in the readme, so I read it again. This is the only phrase I can find which refers to the config file is the following.
Default parameters for the eyaml command line tool can be provided by creating a configuration YAML file.
The location of the file defaults to ~/.eyaml/config.yaml but can be overriden by setting EYAML_CONFIG environment variable.
I'm not seeing where this is mentioned. However gtmtech's pull request should clarify this.
8d682989d80796f62e74c82731b5d5801ffd6ecc
Hi @spuder, the main README.md on the main project page says the following:
The location of the file defaults to `~/.eyaml/config.yaml` but can be overriden by setting `EYAML_CONFIG` environment variable.
Hence if you wanted /etc/eyaml/config.yaml, you could just pop export EYAML_CONFIG=/etc/eyaml/config.yaml
into your /etc/profile.d/eyaml or something equivalent to get the results you desire.
However, my latest pull request makes it explicitly look in /etc/eyaml/config.yaml as well, so when that gets merged, it'll all be a little clearer.
Speaking of which , can I get a merge @sihil, @TomPoulton