sudo.yml 359 B

1234567891011121314
  1. ---
  2. - name: Ensure sudo is installed
  3. apt: name={{ item }} install_recommends=no
  4. with_items:
  5. - sudo
  6. - libnss-myhostname
  7. - name: Disable password based sudo for users in group sudo and enable password less sudo
  8. lineinfile:
  9. dest: "/etc/sudoers"
  10. regexp: '^%sudo'
  11. line: "%sudo ALL=(ALL:ALL) NOPASSWD: ALL"
  12. validate: 'visudo -cf %s'