'Using variables in Ansible - YAML

I am currently building several environments that contain different variables for each.

As such, i have setup vars directory for each of the environment using tags it pulls from cloud.

`i.e. vars1.yml ip: "tag_test_envnumber_{{ ab_env }}:&tag_test_role_run" url: https://www.test.com load_balancer: https:/env1.com

 Vars2.yml
     ip: "tag_test_envnumber_{{ ab_env }}:&tag_test_role_run"
     url: https://www.test1.com
     load_balancer: https:/env2.com

#main yml 
   main.yml
     ip: '{{ ip }}'

The problem im facing is that the values for the declared tag variable is showing the tag value as oppose to the ip address after deployment?

I have tried various different syntax but still no joy.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source