Skip to content
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

Add support for a config file #193

Open
gdubicki opened this issue Feb 26, 2021 · 1 comment
Open

Add support for a config file #193

gdubicki opened this issue Feb 26, 2021 · 1 comment

Comments

@gdubicki
Copy link
Member

It would be cool if this library could read the PuppetDB URL, certificate and key paths and all other connect parameters from a config file.

This would allow easier writing of cli tools using this library as they could all share a common configuration, out of the box.

I propose to use the same path and config syntax as Puppet's own PuppetDB cli as this will provide a single configuration place for users of both the Puppet Enterprise and this library or its derivatives.

If this is something that would get merged then I can provide a PR. :)

@gdubicki
Copy link
Member Author

I would extend the pattern of the PuppetDB cli's configuration file order with reading also ./puppetdb.conf, if it is present.

This would allow the users of multiple PuppetDBs (like testing and production instances) to easily switch between them by cd-ing to the appropriate directory with the right config.

(This is a method that we are already successfully using for the multiple sets of keys for hiera-eyaml.)


We could also consider adding support for providing a configuration file path with an env variable - this is probably another popular pattern for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant