sudo.yml 335 B

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