Ansible playbook to set passwordless sudo code example
Example: Ansible playbook to set passwordless sudo
---
- hosts: all
tasks:
- lineinfile:
path: /etc/sudoers
state: present
regexp: '^%sudo'
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'