Update documentation according to the collection previously created.

This commit is contained in:
Daniel Gonçalves 2022-07-09 18:20:50 +02:00
parent 7eb7ba7dbf
commit df3e696702
No known key found for this signature in database
GPG Key ID: C68ED5C91CB6576C
2 changed files with 14 additions and 15 deletions

View File

@ -1,6 +1,6 @@
# Ansible KeePass Lookup Plugin
The plugin allows to read data from KeePass file (modifying is not supported)
This collection provides a plugin that allows to read data from KeePass file (modifying is not supported)
## How it works
@ -15,8 +15,7 @@ The UNIX socket file is stored in a temporary folder according to OS.
Requirements: `python 3`, `pykeepass==4.0.2`
pip install 'pykeepass==4.0.2' --user
mkdir -p ~/.ansible/plugins/lookup && cd "$_"
curl https://raw.githubusercontent.com/viczem/ansible-keepass/main/keepass.py -o ./keepass.py
ansible-galaxy install viczem.keepass
## Variables
@ -44,8 +43,8 @@ Use `ansible-vault encrypt_string` to encrypt it and use it like below
### Example
ansible_user : "{{ lookup('keepass', 'path/to/entry', 'username') }}"
ansible_become_pass : "{{ lookup('keepass', 'path/to/entry', 'password') }}"
ansible_custom_field : "{{ lookup('keepass', 'path/to/entry', 'custom_properties', 'a_custom_property_name') }}"
ansible_user : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'username') }}"
ansible_become_pass : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'password') }}"
ansible_custom_field : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'custom_properties', 'a_custom_property_name') }}"
More examples see in [/examples](/examples).
More examples see in [/doc/examples](/doc/examples).

View File

@ -3,13 +3,13 @@
hosts: 127.0.0.1
connection: local
vars:
spam_login: "{{ lookup('keepass', 'spam', 'username') }}"
spam_password: "{{ lookup('keepass', 'spam', 'password') }}"
ham_login: "{{ lookup('keepass', 'example/ham', 'username') }}"
ham_password: "{{ lookup('keepass', 'example/ham', 'password') }}"
slash_login: "{{ lookup('keepass', 'slash\\/group/slash\\/title', 'username') }}"
slash_url: "{{ lookup('keepass', 'slash\\/group/slash\\/title', 'url') }}"
pork_custom_property: "{{ lookup('keepass', 'example/pork', 'custom_properties', 'pork_custom_property')}}"
spam_login: "{{ lookup('viczem.keepass.keepass', 'spam', 'username') }}"
spam_password: "{{ lookup('viczem.keepass.keepass', 'spam', 'password') }}"
ham_login: "{{ lookup('viczem.keepass.keepass', 'example/ham', 'username') }}"
ham_password: "{{ lookup('viczem.keepass.keepass', 'example/ham', 'password') }}"
slash_login: "{{ lookup('viczem.keepass.keepass', 'slash\\/group/slash\\/title', 'username') }}"
slash_url: "{{ lookup('viczem.keepass.keepass', 'slash\\/group/slash\\/title', 'url') }}"
pork_custom_property: "{{ lookup('viczem.keepass.keepass', 'example/pork', 'custom_properties', 'pork_custom_property')}}"
tasks:
@ -29,4 +29,4 @@
- debug:
msg: "fetch entry: '/slash\\/group/slash\\/title'; username: '{{ slash_login }}'; url: '{{ slash_url }}'"
- debug: "{{ lookup('keepass', 'close') }}"
- debug: "{{ lookup('viczem.keepass.keepass', 'close') }}"