sudo

Passwordless Sudo with Ansible

Sudo without password, automatically. Short example role for ansible.

The role

  • creates a new user in "sudoless" group
  • adds a sudoers.d/ NOPASSWD rule for the group

Sudo without password

Ansible needs root on the slave. One way is to allow 'sudo' without password.

Summary for gurus (the rest of us can read the article):

$ cat /etc/sudoers.d/sudoless
%sudoless ALL = (ALL) NOPASSWD: ALL

Linux Palvelimet 2026 alkukevät online

Tux the Linux penguin

Learn to manage your own Linux server – in 8 weeks.

100% remote. Weekly video conference + a lot of individual work. Beginners welcome. Excellent feedback. In Finnish.