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

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…

Contents