Interview Prep/Ansible/Architecture Decisions and Tool Comparisons

Should Ansible push secrets to servers, or should apps fetch them at runtime?

AdvancedProductionArchitecture Decisions and Tool Comparisons
Answer

Runtime fetching is better for most secrets. When Ansible writes a secret into a config file, the secret sits on disk, rotation requires a playbook run on every host, and anyone with file read access has it.

Runtime patterns: the app reads from Vault or AWS Secrets Manager with its instance identity, Vault Agent renders and renews files, or an IAM role replaces the static credential completely.

Ansible's job becomes configuring the identity and the agent (instance profile, Vault Agent config, policies), not the secret itself.

Pushing with Ansible is still acceptable for software that only reads a static file and cannot integrate with a secret store (legacy apps, appliances). Then use no_log, strict file modes, and a rotation playbook you actually run.

All Ansible questions Roadmap: Ansible

More on Architecture Decisions and Tool Comparisons