You need to pull a secret from AWS Secrets Manager at run time rather than keep it in Git.
AdvancedScenarioVariables, Facts and Templates
Answer
Situation read → Dynamic secret lookup.
What I'd do →
db_password: "{{ lookup('amazon.aws.secretsmanager_secret', 'prod/db/password', region='ap-south-1') }}"
Mark consuming tasks no_log: true, and give the controller an IAM role with secretsmanager:GetSecretValue on that ARN only.
Why → Lookups run on the controller, so targets never need AWS permissions.
Interview tip → Compare with Vault (file-based), HashiCorp Vault lookup and AWX credential injection.
More on Variables, Facts and Templates
A variable you set in `group_vars` is being overridden and you do not know where. How do you find the source?IntermediateYou need different values per environment without copying playbooks.BeginnerYou must render an Nginx config with one `server` block per site from a list.IntermediateA template needs the IPs of all hosts in the `db` group, for example for a replication config.IntermediateNothing should be rendered unless a mandatory variable is supplied.BeginnerPer-host values, like `server_id` for MySQL, must be unique and stable.Intermediate