i've found this useful for debugging ansible modules and syntax without having to use VMs or test in dev environments.
pip install ansible
~/.ansible.cfg
:
[defaults]
hostfile = ~/.ansible-hosts
~/.ansible-hosts
:
localhost ansible_connection=local
helloworld.yml
:
---
- hosts: all
tasks:
- shell: echo 'hello world'
run!
$ ansible-playbook helloworld.yml
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [shell echo 'hello world'] **********************************************
changed: [localhost]
PLAY RECAP ********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0
I am using ansible v-2.16.3.
echo
seems not working for me: I do not seeTASK: [shell echo 'hello world']
. Instead, this is my output:TASK [shell] *********