Including vars_files based on a condition is getting failed

Hi All,

I am trying to include vars_Files based on a condition but it is getting failed. Could somone please help.

PLAYBOOK:

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.

You will need to place quotation marks around the value you’re comparing to if it is a string.

This is what worked for me:

  • include_vars: /etc/ansible/anusha/hr/vars/main.yml
    when: components == “xyz”

Thank you, that worked for me… :slight_smile: