Sorry if I have this wrong - the nested YAML quote thing is hurting my
eyes - but I think you can do what you want with group_vars - have a
look at the docs for that.


On 22 March 2016 at 17:55, Roy <[email protected]> wrote:
> Hi,
>
>
> I am trying to use include_vars based on when condition as follows:
>
> - include_vars: clouderamanager.yml
>   when: "'{{ inventory_hostname }}' in groups['hadoop-clouderamanager']"
>
> - include_vars: hadoop-namenode.yml
>   when: "'{{ inventory_hostname }}' in groups['hadoop-namenode']"
>
> - include_vars: resourcemanager.yml
>   when: "'{{ inventory_hostname }}' in groups['hadoop-resourcemanager']"
>
> - include_vars: spark-history-server.yml
>   when: "'{{ inventory_hostname }}' in groups['spark-history-server']"
>
> I am getting ERROR! Syntax Error while loading YAML.
>
> The error appears to have been in
> '~/ansible/roles/hadoop-master/tasks/main.yml': line 4, column 36, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
> - include_vars: clouderamanager.yml
>   when: '{{ inventory_hostname }}' in groups['hadoop-clouderamanager']
>                                    ^ here
>
> What I am missing here ?
>
> Thanks
>
> --
> 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/e8963782-dc02-46b5-98b2-3833312b64c2%40googlegroups.com.
> 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/CAK5eLPTFdJUd%3DXVxeAsT7_ACx7kwL3Ky2eL2eL9Mn5LQ2SLRmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to