Ansible Host_Vars vs Group_Vars?

preview_player
Показать описание
In this video I will be explaining Ansible Variables and mainly Ansible Host_Vars and Ansible Group_Vars and how they relate to using Ansible as a Network Engineer.

Ansible group_vars vs hosts_vars

Whilst the video is focussed on configuring Network devices, the theory of Ansible Host_Vars and Ansible Group_Vars is the same for using Ansible for any purpose.

You define host vars in Ansible by creating a YAML file with the filename the same as the host you want to define variables for, this file then lives in the host_vars folder
Same with the group vars, you create a YAML file with the filename being the same as the group you want to define variables for and this file then lives in the group_vars folder

#ansible #networkautomation #cisco
Рекомендации по теме
Комментарии
Автор

Very clear example you saved my time !

iliassaek
Автор

Thank you very much for the video! The explanation and the example are easy to follow!!

AdnanShahidOpi
Автор

Hi roger great stuff ! Just confused do we got to creat the host vars and group_vars directory manually .. If yes we have to keep that in same directory where playbook reside right

saifu