• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Ansible by
Q:

Explain host_vars and group_vars. 

1 Answer

0 votes
by
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.

Related questions

0 votes
asked Aug 24, 2019 in Ansible by rahulsharma
0 votes
asked Aug 24, 2019 in Ansible by rahulsharma
...