You need different values per environment without copying playbooks.
BeginnerScenarioVariables, Facts and Templates
Answer
Situation read → One code, many configurations.
What I'd do → One inventory per environment, each with group_vars/all.yml and group files.
inventories/
staging/group_vars/all.yml # app_replicas: 2
prod/group_vars/all.yml # app_replicas: 6
Run ansible-playbook -i inventories/prod site.yml.
Why → Environment data lives with the inventory; the playbook stays generic.
Interview tip → Avoid if env == 'prod' branches in tasks; use variables.
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 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.IntermediateA fact you need is not collected by default, such as a custom application version.Intermediate