vars_files: - /path/to/foo.yaml Would be the most idiomatic way to read a YAML file in a playbook.
On Sun, Aug 31, 2014 at 2:42 AM, Darup tek <[email protected]> wrote: > Thanks, I solved the problem by using extra-vars. > > > On Saturday, August 30, 2014 12:05:18 PM UTC-7, Henry Finucane wrote: > >> 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. >> >> On Fri, Aug 29, 2014 at 11:43 PM, Darup tek <[email protected]> wrote: >> > 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) >> > >> > Thank you in advance. >> > >> > >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Ansible Project" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to [email protected]. >> > To post to this group, send email to [email protected]. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msgid/ansible-project/ >> 3dde3d79-10b2-4623-9a7c-8634e1c91b32%40googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> ----------------------- >> | Henry Finucane >> | "I hear aphorisms are popular" >> ----------------------- >> > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/a280890d-9538-44fe-8456-1182ff970d10%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/a280890d-9538-44fe-8456-1182ff970d10%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyeH19w2a1Y_BvTS9%3D_LpHAe2r3yyJhQ_V1zBaoavnDug%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
