From the course: Ansible Essential Training
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Running tasks against localhost - Ansible Tutorial
From the course: Ansible Essential Training
Running tasks against localhost
- [Instructor] In this video, we're going to see something interesting. We're going to see how we can most efficiently run tasks against the Ansible control node, and as you're going to see, we're going to use the connection local value inside of our playbook to make this happen. So let's take a look at a playbook that we have here, and I do believe I named that playbook. Let's see, this will be our control node playbook. So we're going to go ahead and cat that controlnode.yml playbook. And what we can see in this playbook is that we are running the task, or in fact, the entire playbook here, very briefly but consisting of one task, we're running this entire thing against the hosts entry for local host. Now I did not define that in the inventory. I am leveraging that automatic local host that Ansible knows. Now notice our task, we love to have fun with our tasks in these different videos so we can see more great…
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)
-
-
-
-
-