i am trying to execute my first ansible script and noticing no task executed
here is the playbook used inventory file & groups
I’m under the impression i should see the date & host details as per the two small tasks but nothing showd up
cat first.yml
name: 'Execute command to display date on web_node1'
hosts: nifi_test
tasks:
-
name: 'Execute a date command'
command: date
- name: ‘Execute a command to display hosts file contents on web_node2’
hosts: nifi_test2
tasks:
-
name: ‘Execute a command to display hosts file’
command: cat /etc/hosts
ansible-playbook -i inventory.txt first.yml
PLAY [Execute command to display date on web_node1] ***********************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [nifi_test2]
ok: [nifi_test1]
TASK [Execute a date command] *********************************************************************************************************************************
changed: [nifi_test1]
changed: [nifi_test2]
PLAY [Execute a command to display hosts file contents on web_node2] ******************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [nifi_test2]
TASK [Execute a command to display hosts file] ****************************************************************************************************************
changed: [nifi_test2]
PLAY RECAP ****************************************************************************************************************************************************
nifi_test1 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
nifi_test2 : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
cat inventory.txt
nifi_test1 ansible_host=10.30.abc.abc anisble_ssh_pass=passwd
nifi_test2 ansible_host=10.30.abc.abc ansible_ssh_pass=passwd
#Groups
[nifi_test]
nifi_test1
nifi_test2