https://github.com/runejuhl/ansible-simplevault
https://github.com/runejuhl/ansible-simplevault
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/runejuhl/ansible-simplevault
- Owner: runejuhl
- License: agpl-3.0
- Created: 2024-03-21T09:03:34.000Z (about 1 year ago)
- Default Branch: dev
- Last Pushed: 2024-04-10T11:14:26.000Z (about 1 year ago)
- Last Synced: 2025-02-28T17:08:39.352Z (3 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Collection - runejuhl.simplevault
An Ansible filter plugin to `vault` and `unvault` using
`DEFAULT_VAULT_PASSWORD_FILE` (e.g. set using `vault_password_file` in the
`defaults` section in `ansible.cfg`).## Usage
``` yaml
- name: 'Read shadow file'
ansible.builtin.slurp:
src: '/etc/shadow
register: 'shadow'- name: 'Write vaulted shadow to local file'
ansible.builtin.copy:
content: |
{{
{
'shadow': shadow.content
| b64decode
| runejuhl.simplevault.vault(wrap_object=true)
} | to_nice_yaml
}}
dest: '/tmp/vaulted_shadow.yml'
delegate_to: 'localhost'
``````yaml
- name: 'vault and unvault'
ansible.builtin.debug:
msg: |-
{{
'omg'
| runejuhl.simplevault.vault(wrap_object=true)
| runejuhl.simplevault.unvault
}}
delegate_to: 'localhost'
```