hiera-eyaml icon indicating copy to clipboard operation
hiera-eyaml copied to clipboard

Add support for system wide config file

Open spuder opened this issue 10 years ago • 6 comments

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

spuder avatar Aug 27 '14 02:08 spuder

@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?

gtmtech avatar Aug 27 '14 18:08 gtmtech

+1

it's irritating for eyaml to check in the current working directory for it's keys.

neoice avatar Oct 21 '14 14:10 neoice

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

gtmtech avatar Oct 24 '14 21:10 gtmtech

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.

neoice avatar Oct 27 '14 14:10 neoice

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

spuder avatar Oct 27 '14 17:10 spuder

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

gtmtech avatar Oct 29 '14 12:10 gtmtech