-
read and write to a keepass/keepassxc file from within an ansible playbook
-
-
#!/bin/bash pip install pykeepass --user
-
#!/bin/bash ansible-galaxy collection install git+https://github.com/dszryan/ansible-keepass.git,main
-
--- keepass: ansible: location: ~/keepass/readonly.kbdx password: !vault | $ANSIBLE_VAULT;1.1;AES256 .... scratch: location: ~/keepass/updateable.kbdx keyfile: ~/keepass/keyfile updatable: true configuration: first_secret_password: database: "{{ keepass.ansible }}" lookup: get://first_secret?password
--- - hosts: host_that_can_access_the_keepass_databases_at_said_locations collections: - dszryan.keepass tasks: - name: using the lookup plugin debug: msg: "{{ lookup('dszryan.keepass.lookup', 'get://first_secret', 'get://second/secret', database=keepass.ansible, fail_silently=true) }}" - name: using the filter plugin debug: msg: "{{ configuration.first_secret_password | dszryan.keepass.lookup }}" - name: using the action plugin keepass: database: "{{ keepass.scratch }}" action: put path: dummy value: '{ "custom": "value" }' register: register_keepass - name: debug debug: msg: "{{ register_keepass }}"
-
-
available in detail as part of the module definition
-
- checkout to your local ansible project as submodule
#!/bin/bash mkdir -p ./submodule && \ git submodule add -f https://github.com/dszryan/ansible-keepass.git ./submodule
- build locally
#!/bin/bash cd ./submodule/ansible-keepassxc/src/main/ansible_collections/dszryan/keepass && \ ansible-galaxy collection build -f && \ cd -
- install locally
#!/bin/bash cd ./submodule/ansible-keepassxc/src/main/ansible_collections/dszryan/keepass && \ mkdir -p ./collection && \ ansible-galaxy collection install -f $(ls -t dszryan-keepass-*.tar.gz | head -n1) -p ./collection && \ cd -
- configure ansible collections path
# ./ansible.cfg [defaults] collections_paths = submodule/ansible-keepassxc/src/main/ansible_collections/dszryan/keepass/collection:~/.ansible/collections:/usr/share/ansible/collections
- checkout to your local ansible project as submodule
-
Notifications
You must be signed in to change notification settings - Fork 0
License
dszryan/ansible-keepassxc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published