RajkumarRK

Untitled

Jun 27th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. This is My PlayBook:
  2.  
  3. ---
  4. - hosts: webservers
  5. remote_user: root
  6. tasks:
  7. - name: 'Copy top.sh to remote machine'
  8. synchronize: mode=push src=top.sh dest=/home/raj/Ansible
  9.  
  10. - name: collecting top result
  11. command: sh /home/raj/Ansible/top.sh
  12. async: 45
  13. poll: 0
  14.  
  15. - name: 'Copy top command result to local machine'
  16. synchronize: mode=pull src=/home/raj/Ansible/Top.txt dest=/home/raj2/Documents/Ansible
  17.  
  18.  
  19.  
  20. This is My execution:
  21.  
  22. [raj2@raj Ansible]$ ansible-playbook Top.yml
  23.  
  24. PLAY [webservers] **************************************************************
  25.  
  26. TASK [setup] *******************************************************************
  27. ok: [192.168.1.7]
  28.  
  29. TASK [Copy top.sh to remote machine] *******************************************
  30. raj@192.168.1.7's password:
  31. changed: [192.168.1.7]
  32.  
  33. TASK [collecting top result] ***************************************************
  34. ok: [192.168.1.7]
  35.  
  36. TASK [Copy top command result to local machine] ********************************
  37. raj@192.168.1.7's password:
  38. changed: [192.168.1.7]
  39.  
  40. PLAY RECAP *********************************************************************
  41. 192.168.1.7 : ok=4 changed=2 unreachable=0 failed=0
  42.  
  43. [raj2@raj Ansible]$
Add Comment
Please, Sign In to add comment