I have a question. I prompt for the vault password with "vars_prompt". I then pass this variable to every role I use so I can use it to encrypt/decrypt. When I do:
- name: Test a static file decrypt
delegate_to: localhost
copy:
content: "{{ lookup('ansible.builtin.file', '/home/ansible/<blah blah blah>/test.txt') | ansible.builtin.unvault(vault_passwd) }}"
dest: "/home/ansible/test.txt"
I get the following error:
"Attempting to decrypt but no vault secrets found"
I tried adding "decrypt: no" to the copy module, as I figured that the copy module tried to decrypt the file even though that should already been done via ansible.builtin.unvault, but it changes nothing.
Still get the same error. I tested that the vault_password variable does indeed carry the password.