Interview Prep/Ansible/Security: Vault, Become and Compliance

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.

All Ansible questions Roadmap: Ansible

More on Security: Vault, Become and Compliance