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

(doc) Correct order for config file precedence #295

Merged
merged 1 commit into from
Dec 15, 2019

Conversation

crayfishx
Copy link
Contributor

The documentation states that the file /etc/eyaml/config.yaml is read first, and then falls to ~/.eyaml/config.yaml. This would be an odd way to resolve config as local users normally take priority over global settings, and a quick test proves this isn't the case and the README is wrong....

Using just a global config.yaml

[vagrant@puppet .eyaml]$ cat /etc/eyaml/config.yaml
pkcs7_private_key: /etc/puppetlabs/puppet/eyaml/private_key.pkcs7.pem
pkcs7_public_key: /etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem

[vagrant@puppet .eyaml]$ /opt/puppetlabs/puppet/bin/eyaml encrypt -s foo
string: ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCA......

Placing a (broken) config.yaml in ~/.eyaml

[vagrant@puppet .eyaml]$ mv ~/.eyaml/config.yaml_ ~/.eyaml/config.yaml && cat ~/.eyaml/config.yaml
pkcs7_private_key: /etc/puppetlabs/puppet/eyaml/private_key.pkcs7.pem_HOMEDIR
pkcs7_public_key: /etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem_HOMEDIR

[vagrant@puppet .eyaml]$ /opt/puppetlabs/puppet/bin/eyaml encrypt -s foo
[hiera-eyaml-core] No such file or directory @ rb_sysopen - /etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem_HOMEDIR

Conclusion

The config.yaml in my homedir is being read first and takes priority which contradicts the docs.

@bastelfreak
Copy link
Member

thansk for figuring this out @crayfishx !

@bastelfreak bastelfreak merged commit 554c2f5 into voxpupuli:master Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants