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

Make bitwarden lookup installable with ansible-galaxy and add support for custom fields #1

Merged
merged 6 commits into from Oct 23, 2018

Conversation

Projects
None yet
2 participants
@larsks
Copy link
Contributor

larsks commented Oct 19, 2018

I was just about to write my own bitwarden module for Ansible when I stumbled across yours. It was almost what I wanted, but the directory structure made it difficult to integrate into an existing Ansible project. These commits reorganize the project so that it can be installed with ansible-galaxy (or simply installed as a git submodule).

The bw cli itself makes it a little tricky to get at custom fields, and since I need to access custom fields I added support for that as well.

larsks added some commits Oct 19, 2018

Reorganize as an installable ansible role
With this commit, the bitwarden lookup module can be installed by running
`ansible-galaxy install git+https://github.com/c0sco/ansible-modules-bitwarden`.
Updated README to reflect recent changes
This updates the README to include instructions about installation
with `ansible-galaxy`, and adds several new examples.
teach bitwarden lookup about custom fields
This makes it easier to look up the values of custom fields in a
Bitwarden entry. If the `custom_field` named parameter is true, search
for the named `field` in the list of custom fields rather than the
top-level dictionary.
decode response from bw
Running under python 3, the response from running the `bw` command is a
byte string, so the lookup was returning to ansible values of the form
`b'somestring'`. It is necessary to decode these results.

@larsks larsks force-pushed the larsks:master branch 2 times, most recently from cb1942e to fe0b888 Oct 20, 2018

@larsks larsks changed the title Make bitwarden lookup installable with ansible-galaxy and add support for custom roles Make bitwarden lookup installable with ansible-galaxy and add support for custom fields Oct 20, 2018

teach bitwarden lookup how to sync
set sync=true in the lookup call to call `bw sync` before looking up
data

@larsks larsks force-pushed the larsks:master branch from fe0b888 to c56f7b5 Oct 20, 2018

@c0sco

This comment has been minimized.

Copy link
Owner

c0sco commented Oct 23, 2018

Looks great, thank you!

@c0sco c0sco merged commit b1e36a1 into c0sco:master Oct 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.