You want to use HashiCorp Vault instead of Ansible Vault.
AdvancedScenarioSecurity: Vault, Become and Compliance
Answer
Situation read → Central secrets management with dynamic secrets.
What I'd do →
db_password: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=kv/data/prod/db:password auth_method=approle role_id=... secret_id=... url=https://vault.example.com:8200') }}"
Use AppRole/JWT or cloud auth, short TTLs, and no_log. Install hvac on the controller.
Why → Central policy, audit and rotation instead of files in Git.
Interview tip → AWX can inject credentials via credential lookup plugins for Vault.
More on Security: Vault, Become and Compliance
Database passwords are sitting in plain text in `group_vars`. How do you fix it?BeginnerYou need separate vault passwords for staging and prod.IntermediateHow do you change the vault password for all encrypted files?IntermediateA CI pipeline needs the vault password without storing it in the repo.IntermediateYou want to see the value inside an encrypted file without writing a decrypted copy to disk.BeginnerOnly one value in a vars file is secret and you want it in the same file as plain values.Beginner