This is a simple lookup plugin that search for secrets in a local 1Password database (B5.sqlite format). It uses the onepassword-local-search python module that greatly improve performance over querying directly the 1Password servers.
Project description
1Password Local Lookup Plugin
This is a simple lookup plugin that search for secrets in a local 1Password database (B5.sqlite format). It uses the onepassword-local-search python module that greatly improve performance over querying directly the 1Password servers.
Requirements
You require:
- python 3.7
- onepassword-local-search module
pip3 install onepassword-local-search
Example Playbook
- hosts: servers
roles:
- role: mickaelperrin.ansible-onepassword-local-lookup-plugin
tasks
- debug:
msg: "{{ lookup('onepassword_local', 'p6iyvjqv4xdxw52hsacpkq4rgi', field='name') }}"
- debug:
msg: "{{ lookup('onepassword_local', 'c3264cef-1e5e-4c96-a192-26729539f3f5', field='your_custom_field') }}"
- debug:
msg: "{{ lookup('onepassword_local', '1234567890', field='password') }}"
Custom uuid feature
uuid in 1Password changes when you move an item from one vault to another. To prevent this issue, a custom uuid mapping feature has been implemented.
You need to add on each item a field named UUID
(in capitals).
Then run op-local mapping update
to generate the mapping table relationship.
You can display UUID mapping by running op-local mapping list
.
As we migrated from Lastpass to 1Password, we have also implemented a UUID mapping feature
related to a field named LASTPASS_ID
. If the uuid given is 100% numeric, the search query will be performed over this field.
Tests
Tests are managed by pytest
for the python part and molecule
for the ansible part with docker
as driver.
mkvirtualenv3 ansible-onepassword-local-lookup-plugin
pip install -r requirements/dev.txt
Pytest
pytest
Molecule
Ensure that docker
service is up and running
molecule test
License
GPLv3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ansible 1password lookup plugin-0.2.2.tar.gz
.
File metadata
- Download URL: ansible 1password lookup plugin-0.2.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ebb64ed09d96a1c90df03e565dab0c2468c4fd648bc89fbc6e39e6690bc8137 |
|
MD5 | 169bf70bd4807459c48a5ea4bcb6b1ad |
|
BLAKE2b-256 | ac5a6a5243dd77ae87a13a1c6df1c4b61a5fbb4e3260e2d2baf8dd356df32478 |
File details
Details for the file ansible_1password_lookup_plugin-0.2.2-py2.py3-none-any.whl
.
File metadata
- Download URL: ansible_1password_lookup_plugin-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a9878e55bb8044d9289883f1c6e1e50439e0fef5d71ff2a419f8fce341257a1 |
|
MD5 | 5eb1c965ab7fa9c75f0e0ffc9c94e32f |
|
BLAKE2b-256 | c216c0c73cefc6cbf6ee2cc0ea0889e36556c54498193515c1c31ec9442cf8b3 |