This is a fragment of a playbook that I\'m using (server.yml):
server.yml
- name: Determine Remote User hosts: web gather_facts: false roles: - {
If you want to run a task that's associated with a host, but on different host, you should try delegate_to.
In your case, you should delegate to your localhost (ansible master) and calling ansible-playbook command
ansible-playbook