Team, I have two vars that map to two environments. I want to use them in playbook but only one value should be applied based on env playbook runs on.
ex:
var = test1 > should be loaded when env1
var = test2 > should be loaded when env2
any hint how can i achieve this in ansible?
I want to write my task in such a way that this variables var carries test1 value when it is run on env1 and vice versa. is there a login I can use at task level? my task is below and when am running my playbook on clusterA it should use var=test1 and when running on clusterB it should use var=test2
- name: Add persistent ddn volume
mount:
path: "{{ lustre_client_path }}"
src: "{{ var }}"
fstype: lustre
state: mounted