Interview Prep/Ansible/Cloud, AWX, Windows and Molecule

An AWX job fails with `Decryption failed (no vault secrets were found that could decrypt)` although a Vault credential is attached

AdvancedTroubleshootingCloud, AWX, Windows and Molecule
Answer

Likely causes → The project mixes vault IDs (dev, prod), and the attached credential has no Vault Identifier, or a different one, from the label in the file header. Another cause is that the credential holds a different password than the one used to encrypt.

Diagnose → head -1 on the vault file in the repository shows the label it was encrypted with. Compare it with the credential's "Vault Identifier" field.

Fix → Create one Vault credential per ID (Vault Identifier: prod) and attach all the ones the job needs. AWX allows several Vault credentials as long as their IDs differ.

Prevent → Use one vault ID per environment, the same ones in the CLI and AWX, and document them in the repo README.

All Ansible questions Roadmap: Ansible

More on Cloud, AWX, Windows and Molecule