We have 3 vaults -- one each for dev, staging, and production. They contain all the same variables, just with different values. We gave them all different passwords so that our dev/staging playbooks can be deployed by "untrusted" agents (untrusted relatively speaking -- e.g., CI server, temporary contractors, etc.) without revealing production secrets.
You can see why it might be confusing to me, then, to hear that ansible must include all group_vars as a sort of insurance policy. I'm new to ansible, and I haven't seen a project laid out any other way than what I've described thus far. In this pattern, when the user runs the staging.yml playbook, they do not need group_vars/production/*. Indeed it would be potentially harmful if it were included, possibly resulting in broken configurations if values from group_vars/staging/* were overwritten.
It sounds like I'm not the only person using ansible in this way, and I find it to be extremely convenient. I think it's a great solution for the problem of managing secrets for multiple environments; certainly seems like an issue that's in ansible's wheelhouse.
If there's a more efficient way to deal with the problem of managing secrets for multiple environments, I'd be interested in learning. I guess for now I will convert to using var_files on all my plays. I view this as a subpar solution, though, because it is considerably less maintainable.
Is there a better way to solve my issue of secrets for multiple environments, and if not would you consider reopening this as an issue, so that the workflow I described can be used?
Thanks,
Colin