Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is My PlayBook:
- ---
- - hosts: webservers
- remote_user: root
- tasks:
- - name: 'Copy top.sh to remote machine'
- synchronize: mode=push src=top.sh dest=/home/raj/Ansible
- - name: collecting top result
- command: sh /home/raj/Ansible/top.sh
- async: 45
- poll: 0
- - name: 'Copy top command result to local machine'
- synchronize: mode=pull src=/home/raj/Ansible/Top.txt dest=/home/raj2/Documents/Ansible
- This is My execution:
- [raj2@raj Ansible]$ ansible-playbook Top.yml
- PLAY [webservers] **************************************************************
- TASK [setup] *******************************************************************
- ok: [192.168.1.7]
- TASK [Copy top.sh to remote machine] *******************************************
- raj@192.168.1.7's password:
- changed: [192.168.1.7]
- TASK [collecting top result] ***************************************************
- ok: [192.168.1.7]
- TASK [Copy top command result to local machine] ********************************
- raj@192.168.1.7's password:
- changed: [192.168.1.7]
- PLAY RECAP *********************************************************************
- 192.168.1.7 : ok=4 changed=2 unreachable=0 failed=0
- [raj2@raj Ansible]$
Add Comment
Please, Sign In to add comment