From the course: Ansible Essential Training
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Creating dynamic inventory files - Ansible Tutorial
From the course: Ansible Essential Training
Creating dynamic inventory files
- [Instructor] Inventory files are great, but they do lack in one major area. They are static. What if we have a cloud infrastructure as a service environment that we want to run Ansible against? This inventory, by the very nature of rapid elasticity in the cloud, might be changing all the time. The answer to this problem, of course, is dynamic inventory files Thanks to APIs, we can have the cloud provider produce a dynamic inventory for us. We can then use this inventory file like we do our static files. Let me demonstrate this using AWS as an example. This is very easy to do now, thanks to an AWS inventory plugin that we can call upon for EC2, the virtual machine service of AWS. Now, keep in mind, I'm doing an AWS example here, but you could be following the instructions for whatever cloud provider that you're working with. You are not going to be surprised to discover that there's dynamic inventory processes now for…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Using host groups4m 31s
-
(Locked)
Using tags4m 27s
-
(Locked)
Running tasks against localhost5m 25s
-
(Locked)
Using the command line to control execution5m 2s
-
(Locked)
Specifying variables in the inventory file5m 51s
-
(Locked)
Creating dynamic inventory files7m 5s
-
(Locked)
Using templates6m 15s
-
(Locked)
Conditional execution4m 25s
-
(Locked)
Using loops7m 45s
-
(Locked)
Testing plays with check mode3m 27s
-
(Locked)
-
-
-
-
-