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

Error when ~/.vault-token has a newline #32

Closed
xiongchiamiov opened this issue Jan 27, 2017 · 0 comments
Closed

Error when ~/.vault-token has a newline #32

xiongchiamiov opened this issue Jan 27, 2017 · 0 comments

Comments

@xiongchiamiov
Copy link

vault auth puts a token in ~/.vault-token, with no newline. However, if you change the token manually, it's easy to add a newline at the end (echo does this by default, as do most text editors).

The vault cli handles this gracefully, but ansible-vault sends the entire contents of the file along, including the newline, producing errors like this one:

fatal: [localhost]: FAILED! => {
    "failed": true, 
    "msg": "An unhandled exception occurred while running the lookup plugin 'vault'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Unable to read secret/hello from vault: Invalid header value '<my token here>\\n'"
}

It would be great if ansible-vault just did a strip() on the data it reads in.

@jhaals jhaals closed this as completed in 4d07076 Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant