Hello,
I'm looking for advice on how to improve my implementation of my playbook. I know the way I have designed it is very different from the normal way of doing playbooks. I have a playbook that controls deploying configuration to 4 different kubernetes clusters. I use kubectl in a command shell to execute the commands to do deployments. Here is my inventory file:
# Inventory File
#
[east.k.tropo.com]
localhost ansible_connection=local
[east2.k.tropo.com]
localhost ansible_connection=local
[k8s.int.ops.tropo.com]
localhost ansible_connection=local
[k8s.k.dub.tropo.com]
localhost ansible_connection=local
#[test.c.tropo.com]
#localhost ansible_connection=local
I have each cluster setup in it's own group, each group has it's variables in it's own file under inventory/group_vars/ so that when I want to deploy an job to that cluster I would do something like this:
ansible-playbook create.yaml -l k8s.k.dub.tropo.com --tags foo
My problem is ( I think ) that because each group just has localhost in it, than localhost gets all the variables from the other groups. This really does break things. Is there some sort of flag I can set to change this behavior or is there a better way to do what I'm doing?
Thanks,
Matt