Changing variable depending on the host within a role

9 views
Skip to first unread message

Adnan Arab

unread,
Nov 22, 2016, 12:07:15 PM11/22/16
to Ansible Project
Hi,

I want to be able to change the value of a variable depending on a host.

What I tried was roles/x/vars/host_vars/<host>/main.yml but this does not seem to work.

Could you please let me know how I can change a variable depending on a host within a role?

Thanks

Kai Stian Olstad

unread,
Nov 22, 2016, 1:03:10 PM11/22/16
to ansible...@googlegroups.com
host_vars is a feature of the top level, not in the roles

https://docs.ansible.com/ansible/playbooks_best_practices.html#directory-layout

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages