Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo = true
- sudo_user = root
- ask_sudo_pass = True
- ask_pass = True
- ...
- gathering = smart
- ....
- # change this for alternative sudo implementations
- sudo_exe = sudo
- # what flags to pass to sudo
- #sudo_flags = -H
- ...
- # remote_user = ansible
- sudo = true
- sudo_user = root
- ask_sudo_pass = True
- ask_pass = True
- ...
- gathering = smart
- ....
- # change this for alternative sudo implementations
- sudo_exe = sudo
- # what flags to pass to sudo
- #sudo_flags = -H
- ...
- # remote_user = ansible
- sudo = true
- sudo_user = root
- ask_sudo_pass = True
- ask_pass = True
- ...
- gathering = smart
- ....
- # change this for alternative sudo implementations
- sudo_exe = sudo
- # what flags to pass to sudo
- #sudo_flags = -H
- ...
- # remote_user = ansible
- ---
- - hosts: Server1:Server2
- vars:
- - test_file: '/tmp/ansible_test_file.txt'
- sudo: yes
- tasks:
- - name: create empty file to test connectivity and sudo access
- file: dest={{ test_file }}
- state=touch
- owner=root group=root mode=0600
- notify:
- - clean
- handlers:
- - name: clean
- file: dest={{ test_file }}
- state=absent
- Host_Alias SRV = Server1, Server2
- User_Alias SUPPORT = User1, User2, User3
- SUPPORT SRV=(root) ALL
- while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
- continue
- done
- strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
- while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
- continue
- done
- strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
- while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
- continue
- done
- strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
- while [[ -z $(ps -fu root|grep [a]nsible|awk '{print $2}') ]]; do
- continue
- done
- strace -vfp $(ps -fu root|grep [a]nsible|awk '{print $2}') -o /root/strace.out`
- md5sum [file]
- md5sum [file]
- ansible
- strace -vfp `pidof sshd`
- while [[ -z $(ps -eaf|grep 'sshd: [U]ser1@pts/1') ]]; do
- continue
- done
- strace -ff -vfp $(ps -eaf|grep 'sshd: [U]ser1@pts/1'|awk '{print $2}') -o /root/strace_sshd1_2.out
- [example]
- web1.example.com
- [example-with-passwords]
- web1.example.com ansible_sudo_pass=abc123
- ---
- - hosts: example
- become: true
- tasks:
- - command: cat /etc/shadow
- $ ansible-playbook test-sudo.yml -K
Add Comment
Please, Sign In to add comment