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

Updated:   |  Ansible articles

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

  • Lookup is run on the control node
  • Modules are run on your 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
...

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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