Skip to content

Ansible lookup plugin error #291

Closed
@gruebel

Description

After upgrading to the latest credstash Version 0.17.0 on our Ansibel deployment server we get following error:

{
    "changed": false,
    "msg": "AnsibleError: An unhandled exception occurred while templating '{{ lookup('credstash', 'xxx') }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'credstash'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Encountered exception while fetching xxx: Could not connect to the endpoint URL: \"https://kms.credential-store.amazonaws.com/\""
}

After digging in deeper into the mechanism of the Ansible lookup plugin and how it calls credstash, I found the culprit. With the PR #268 the parameter order of getSecret() was changed and the Ansible plugin uses positional arguments instead of named. So, basically the latest version breaks the usage of positional arguments for everyone. I think it would be a good idea to move the new parameter kms_region to the end of the function call. Same goes for all the other functions probably too. I'm happy to add a PR to fix the problem, but I don't want to waste my time, if you are not willing to apply that change.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions