From the course: Ansible Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Specifying variables in the inventory file

Specifying variables in the inventory file - Ansible Tutorial

From the course: Ansible Essential Training

Specifying variables in the inventory file

- [Instructor] Just like in any full blown programming language, variables allow us to really start playing with power in our automation with Ansible. There are many different flexible ways in which we can pass variables using the inventory file. This really adds even more value to the inventory file which is already a critical component in Ansible. So let's take a look at some of the ways in which we can do this. Again remember, there are many ways to do things in Ansible, so we were just seeing some of the most popular methodologies. But let's first go ahead and take a look at our inventory file. So we're going to cat to our etc Ansible hosts location. Notice we are using the default inventory location in this demonstration and here's our inventory file. And if you look under the backup servers, you will see that target6 has a variable specified for the backup file. And notice the backup file is going to be test1…

Contents