I noticed that you ARE sending the "-e components=xyz" on the command 
line.  Please ignore my other response - Google Groups isn't letting me 
delete it.

On Saturday, November 10, 2018 at 11:00:03 PM UTC-6, anushake...@gmail.com 
wrote:
>
> Hi All,
>
>
> I am trying to include vars_Files based on a condition but it is getting 
> failed. Could somone please help.
>
>
>
> *PLAYBOOK:*
>
> ---
>
> - hosts: all
>
>   gather_facts: no
>
>   pre_tasks:
>
>      - include_vars: /etc/ansible/anusha/hr/vars/main.yml
>
>        when: components == xyz
>
>
> *EXECUTION:*
>
> ansible-playbook main.yml -e components=xyz
>
>
> *ERROR:*
>
> FAILED! => {"msg": "The conditional check 'components == XYZ' failed. The 
> error was: error while evaluating conditional (components == XYZ): 
> 'components' is undefined\n\nThe error appears to have been in 
> '/etc/ansible/tesr/xyz/tasks/main.yml': line 6, column 8, but may\nbe 
> elsewhere in the file depending on the exact syntax problem.\n\nThe 
> offending line appears to be:\n\n  pre_tasks:\n     - include_vars: 
> /etc/ansible/anusha/hr/vars/main.yml\n       ^ here\n"}
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4e03c4dc-a641-432c-9282-9c55a5464bd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to