Aug 24, 2019 in Ansible

Explain host_vars and group_vars. 

1 Answer

0 votes
Aug 24, 2019
host_vars and groups_vars helps to manage host and group variables in more systematic way. Host and group variables can be stored in individual files relative to the inventory file. These variable files are in YAML format. Valid file extensions include ‘.yml’, ‘.yaml’, ‘.json’, or no file extension. Let’s say, for example, that you keep your inventory file at /etc/ansible/hosts. You have a host named ‘foosball’ that’s a member of two groups: ‘raleigh’ and ‘webservers’. That host will use variables in YAML files at the following locations: /etc/ansible/group_vars/raleigh,

/etc/ansible/group_vars/webservers, /etc/ansible/host_vars/foosball.
Click here to read more about Ansible
Click here to read more about Insurance