add_sudonopsswd_group.playbook.yaml 462 B

123456789101112131415161718192021
  1. ---
  2. - name: Add the special group "sudonopsswd" to the system, then to the sudoers file
  3. hosts: all
  4. gather_facts: true
  5. become: True
  6. tasks:
  7. - name: "Add group w/ GID 1999"
  8. group:
  9. name: sudonopsswd
  10. state: present
  11. gid: 1999
  12. - name: "Add sudonopsswd line to sudoers file"
  13. sudoers:
  14. name: "sudonopsswd-group"
  15. group: sudonopsswd
  16. state: present
  17. commands: ALL
  18. nopassword: true
  19. validation: detect