Shankar:
Hi Guys. I need a small clarification.
---
- name: "Testing in localserver"
hosts: test_server
tasks:
- name: 'Get the Hostname'
command: echo ${HOSTNAME} >> ~/hostname_test
- name: 'Create a test file'
command: echo "this is a test file created by ansible" >> ~/ansible_file.txt
This is my test playbook. Following is the output I get when I run this playbook…(The ansible_user is testuser
)
PLAY [Testing in localserver] ****************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************************
ok: [test_server]
TASK [Get the Hostname] **********************************************************************************************************************************************************
changed: [test_server]
TASK [Create a test file] ********************************************************************************************************************************************************
changed: [test_server]
PLAY RECAP ***********************************************************************************************************************************************************************
test_server : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
But when I login to the test_server, I couldn’t find the files under the home of testuser
Can someone point out what I’m missing?