Advertisement
Guest User

Untitled

a guest
Jan 9th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. /etc/ansible/ansible.cfg
  2. [defaults]
  3. inventory = /etc/ansible/hosts
  4. #library = /usr/share/my_modules/
  5. remote_tmp = $HOME/.ansible/tmp
  6. local_tmp = $HOME/.ansible/tmp
  7. #forks = 5
  8. #poll_interval = 15
  9. #sudo_user = root
  10. #ask_sudo_pass = True
  11. ask_pass = True
  12. #transport = smart
  13. remote_port = 22
  14. remote_user = root
  15.  
  16. /etc/ansible/hosts
  17. #[dev-cassandra]
  18. #10.32.6.106
  19. #10.32.6.107
  20.  
  21. #[ops-centos-7]
  22. #10.32.15.112
  23.  
  24. #[ams-app]
  25. #10.32.6.138
  26.  
  27. #[ams-db]
  28. #10.32.6.139
  29.  
  30. #[ams-web]
  31. #10.32.6.140
  32.  
  33. #[dev-ws]
  34. #10.32.6.[1:50]
  35.  
  36. #[telco-ws]
  37. #10.32.9.[1:21]
  38.  
  39. #[ga-ws]
  40. #10.32.11.[1:6]
  41.  
  42. [inside]
  43. 10.32.100.1
  44. 10.32.7.253
  45. 10.32.5.69
  46.  
  47. [intranet]
  48. 10.32.16.185
  49. 10.32.16.182
  50. 10.32.16.232
  51. 10.32.15.190
  52. 10.32.16.249
  53. 10.32.16.237
  54.  
  55. [me]
  56. 10.32.5.4
  57.  
  58. ;;execute
  59. ansible -m ping all --extra-vars "ansible_ssh_user=root ansible_ssh_pass=@1rstSTATION!"
  60. ansible-playbook playbook.yml --extra-vars "ansible_ssh_user=root ansible_ssh_pass=password"
  61. ansible -m command -a "df -h" me --extra-vars "ansible_ssh_user=ardi ansible_ssh_pass=pol8k09"
  62. ansible -m shell -a 'free -m' -k me
  63.  
  64. ;;Alternatively, if you run the playbook with the -k option, ansible will prompt you for the ssh password
  65.  
  66.  
  67. ;;playbooks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement