I have this playbook which changes the xml file on a remote server.
This playbook needs to read a value from another yaml file.
For example source yaml file:
main.yml
cluster: onecluster
product: someproduct
…
playbook.yml
-replace: dest=/a/b/cd.xml regexp=something replace=<<< value of cluster from main.yml >>>
The playbook.yml changes the value as per the value from main.yml.
I cannot not hardcode that in the playbook.yml, all the values should come from central place(main.yml)
I'm not 100% sure if I understand the question, but your inventory can
associate extra yaml files with all hosts or with groups of hosts. The
documentation is fairly reasonable: http://docs.ansible.com/intro_inventory.html (group_vars are what you
want, and are discussed at the end)
As an aside, the Ansible convention for global defaults is the "all" group.