Files
dotfiles/config/ansible/tests/test-onepassword-lookup.yml
2025-03-11 21:50:40 +01:00

22 lines
654 B
YAML

---
- name: Test 1Password Lookup Plugin
hosts: localhost
connection: local
gather_facts: false
vars:
hoarder_data_dir: /mnt/storage-box/services/hoarder
tasks:
- name: Test lookup with direct reference
ansible.builtin.debug:
msg: "{{ lookup('my_1password', 'op://j7nmhqlsjmp2r6umly5t75hzb4/5j5y5axfjr3f3sn5nixb6htg4y/host') }}"
- name: Template with lookup
ansible.builtin.template:
src: ../tasks/servers/services/hoarder/dotenv.j2
dest: /tmp/.env
register: op_direct
- name: Print out the templated file
ansible.builtin.debug:
msg: "{{ lookup('file', '/tmp/.env') }}"