Add example
This commit is contained in:
parent
fa0ea46dc7
commit
14a17e0181
|
@ -45,6 +45,7 @@ Use `ansible-vault encrypt_string` to encrypt it and use it like below
|
||||||
|
|
||||||
ansible_user : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'username') }}"
|
ansible_user : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'username') }}"
|
||||||
ansible_become_pass : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'password') }}"
|
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') }}"
|
custom_field : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'custom_properties', 'a_custom_property_name') }}"
|
||||||
|
attachment : "{{ lookup('viczem.keepass.keepass', 'path/to/entry', 'attachments', 'a_file_name') }}"
|
||||||
|
|
||||||
More examples see in [/doc/examples](/doc/examples).
|
More examples see in [/doc/examples](/doc/examples).
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
slash_login: "{{ lookup('viczem.keepass.keepass', 'slash\\/group/slash\\/title', 'username') }}"
|
slash_login: "{{ lookup('viczem.keepass.keepass', 'slash\\/group/slash\\/title', 'username') }}"
|
||||||
slash_url: "{{ lookup('viczem.keepass.keepass', 'slash\\/group/slash\\/title', 'url') }}"
|
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')}}"
|
pork_custom_property: "{{ lookup('viczem.keepass.keepass', 'example/pork', 'custom_properties', 'pork_custom_property')}}"
|
||||||
|
attachment: "{{ lookup('viczem.keepass.keepass', 'example/pork', 'attachments', 'test.txt')}}"
|
||||||
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -19,6 +20,9 @@
|
||||||
- debug:
|
- debug:
|
||||||
msg: "fetch entry: '/examples/ham'; username: '{{ ham_login }}'; password: '{{ ham_password }}'"
|
msg: "fetch entry: '/examples/ham'; username: '{{ ham_login }}'; password: '{{ ham_password }}'"
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "fetch entry: '/examples/port'; attachments: 'text.txt' - '{{ attachment }}'"
|
||||||
|
|
||||||
- name: pause to emulate long time operation (greater than keepass_ttl)
|
- name: pause to emulate long time operation (greater than keepass_ttl)
|
||||||
pause:
|
pause:
|
||||||
seconds: 5
|
seconds: 5
|
||||||
|
|
|
@ -39,6 +39,7 @@ DOCUMENTATION = """
|
||||||
- "{{ lookup('keepass', 'path/to/entry', 'username') }}"
|
- "{{ lookup('keepass', 'path/to/entry', 'username') }}"
|
||||||
- "{{ lookup('keepass', 'path/to/entry', 'password') }}"
|
- "{{ lookup('keepass', 'path/to/entry', 'password') }}"
|
||||||
- "{{ lookup('keepass', 'path/to/entry', 'custom_properties', 'my_prop_name') }}"
|
- "{{ lookup('keepass', 'path/to/entry', 'custom_properties', 'my_prop_name') }}"
|
||||||
|
- "{{ lookup('keepass', 'path/to/entry', 'attachments', 'my_file_name') }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
display = Display()
|
display = Display()
|
||||||
|
@ -303,7 +304,7 @@ def _keepass_socket(kdbx, kdbx_key, sock_path, ttl=60, kdbx_password=None):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
if prop == "attachment":
|
if prop == "attachments":
|
||||||
if arg_len == 2:
|
if arg_len == 2:
|
||||||
conn.send(
|
conn.send(
|
||||||
_resp(
|
_resp(
|
||||||
|
|
Loading…
Reference in New Issue