What belongs in Ansible variables, and what belongs in a config service such as Consul or SSM Parameter Store?
IntermediateProductionArchitecture Decisions and Tool Comparisons
Answer
Ansible variables are read when the playbook runs, so they suit settings that change with a deploy: package versions, ports, tuning, paths, feature defaults.
A config service suits values that change independently of deploys, or that other systems also read: feature flags, service endpoints, rate limits, anything updated by another team or pipeline.
A practical split:
- Static per-environment settings:
group_varsin Git. - Dynamic or shared values: Parameter Store, Consul, AppConfig; Ansible reads them with lookups when it needs them at deploy time, and apps read them at runtime.
- Secrets: a secret store, never plain variables.
Avoid copying the same value into both places; pick one owner per value.
More on Architecture Decisions and Tool Comparisons
Ansible or Terraform: where do you draw the line?BeginnerHow does Ansible compare with Puppet, Chef and Salt?IntermediateWhy use Ansible instead of shell scripts?BeginnerWhere does Ansible fit once you run Kubernetes?Intermediatecloud-init or Ansible for first boot configuration?IntermediateWhen would you use AWS Systems Manager instead of, or together with, Ansible?Intermediate