Ansible playbook for test local_action
---
- hosts: all
tasks:
- name: Remote action test.
shell: cat /etc/hostname
register: rr
- debug: msg="{{rr.stdout}}"
- name: Local action test.
local_action: shell cat /etc/hostname
register: rr
- debug: msg="{{rr.stdout}}"