Ansible vault : Error: "Attempting to decrypt but no vault secrets found"

Hi Foreman Community :slight_smile:

I got a problem with ansible Vault in Foreman and i don’t understand why… Can you help me ?

Problem:

Error “Attempting to decrypt but no vault secrets found” when a role wich contain vault Variables is launched from Foreman. This same role works well when it is lauched from ansible cli. (With the same user Foreman use)

Expected outcome:
No error. Vault variable are correctly decrypted.

Foreman and Proxy versions:
Last stable releases (1.21.0)

Foreman and Proxy plugin versions:
Last stable releases

Other relevant data:

I add my vault password file to “/etc/ansible/ansible.cfg” and it works well when i use ansible cli on my ansible host. Ansible and foreman are on the same host.

My vault variable in my role is located in “defaults” directory.

Variable is correctly decrypted if i call my role from ansible CLI but not when i launch my role from Foreman.

How can i work around that error ?

Thanks for help

I don’t believe Foreman would be reading anything from /etc/ansible/ansible.cfg.
You may want to try setting your vault password in ~foreman-proxy/.ansible.cfg instead.