ansible privilege escalation - shekharshamra/ansible-playbooks GitHub Wiki
-
hosts: all
remote_user: shekhar
tasks:
-
name: taking backup
command: touch /tmp/test
become: yes
become_method: sudo
-
run ansible playbook with --ask-sudo-pass
ansible-playbook --ask-sudo-pass become.yml