Enable passwordless sudo for a specific user

From wikieduonline
Revision as of 10:54, 11 December 2019 by Welcome (talk | contribs) (Created page with " == Passwordless sudo using Ansible == <pre> #!/usr/bin/env ansible-playbook - hosts: YOUR_MACHINE tasks: - lineinfile: path: /etc/sudoers...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search



Passwordless sudo using Ansible

#!/usr/bin/env ansible-playbook

- hosts: YOUR_MACHINE
  tasks:
    - lineinfile:
        path: /etc/sudoers
        state: present
        regexp: '^%sudo'
        line: '%sudo ALL=(ALL) NOPASSWD: ALL'
        validate: 'visudo -cf %s'


See also

Advertising: