Changing variable depending on the host within a role

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//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

host_vars is a feature of the top level, not in the roles

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