FreeKB - Ansible Run tasks on the control node
Ansible - Run tasks on the control node

By default, certain tasks will be run against the control node (that's your Ansible server) or against your managed nodes (the target systems). For example:

  • Lookup is run against the control node
  • Modules are run against managed nodes

There are different ways to modify this behavior. The following can be used to invoke a module on the control node (that's your Ansible server). 

Or, it you can set -hosts: localhost in your playbook to run the playbook against the control node.

---
- hosts: localhost
  tasks:
  - debug:
      msg: Hello World
...

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 5eb35 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |