Guest User

Untitled

a guest
Nov 10th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. sudo = true
  2. sudo_user = root
  3. ask_sudo_pass = True
  4. ask_pass = True
  5. ...
  6. gathering = smart
  7. ....
  8. # change this for alternative sudo implementations
  9. sudo_exe = sudo
  10.  
  11. # what flags to pass to sudo
  12. #sudo_flags = -H
  13. ...
  14. # remote_user = ansible
  15.  
  16. sudo = true
  17. sudo_user = root
  18. ask_sudo_pass = True
  19. ask_pass = True
  20. ...
  21. gathering = smart
  22. ....
  23. # change this for alternative sudo implementations
  24. sudo_exe = sudo
  25.  
  26. # what flags to pass to sudo
  27. #sudo_flags = -H
  28. ...
  29. # remote_user = ansible
  30.  
  31. sudo = true
  32. sudo_user = root
  33. ask_sudo_pass = True
  34. ask_pass = True
  35. ...
  36. gathering = smart
  37. ....
  38. # change this for alternative sudo implementations
  39. sudo_exe = sudo
  40.  
  41. # what flags to pass to sudo
  42. #sudo_flags = -H
  43. ...
  44. # remote_user = ansible
  45.  
  46. ---
  47. - hosts: Server1:Server2
  48. vars:
  49. - test_file: '/tmp/ansible_test_file.txt'
  50. sudo: yes
  51. tasks:
  52. - name: create empty file to test connectivity and sudo access
  53. file: dest={{ test_file }}
  54. state=touch
  55. owner=root group=root mode=0600
  56. notify:
  57. - clean
  58. handlers:
  59. - name: clean
  60. file: dest={{ test_file }}
  61. state=absent
  62.  
  63. Host_Alias SRV = Server1, Server2
  64. User_Alias SUPPORT = User1, User2, User3
  65. SUPPORT SRV=(root) ALL
  66.  
  67. while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
  68. continue
  69. done
  70. strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
  71.  
  72. while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
  73. continue
  74. done
  75. strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
  76.  
  77. while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
  78. continue
  79. done
  80. strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
  81.  
  82. while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
  83. continue
  84. done
  85. strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
  86.  
  87. md5sum [file]
  88.  
  89. md5sum [file]
  90.  
  91. ansible
  92.  
  93. strace -vfp `pidof sshd`
  94.  
  95. while [[ -z $(ps -eaf|grep 'sshd: [U]ser1@pts/1') ]]; do
  96. continue
  97. done
  98. strace -ff -vfp $(ps -eaf|grep 'sshd: [U]ser1@pts/1'|awk '{print $2}') -o /root/strace_sshd1_2.out
  99.  
  100. [example]
  101. web1.example.com
  102.  
  103. [example-with-passwords]
  104. web1.example.com ansible_sudo_pass=abc123
  105.  
  106. ---
  107. - hosts: example
  108. become: true
  109. tasks:
  110. - command: cat /etc/shadow
  111.  
  112. $ ansible-playbook test-sudo.yml -K
Add Comment
Please, Sign In to add comment