Skip to content

Allow both @includedir and #includedir in sudoers.conf #76

Open
@martbhell

Description

@martbhell

Hello :)

Both work. No need to add a duplicate? Also nice to not modify sudoers.conf if not needed

    - name: Ensure /etc/sudoers.d is scanned by sudo
      lineinfile:
        dest: '/etc/sudoers'
        regexp: '#includedir\s+/etc/sudoers.d'
        line: '#includedir /etc/sudoers.d'
      when: admin_sudoers|bool

https://www.sudo.ws/docs/man/sudoers.man/#Including_other_files_from_within_sudoers

TASK [ansible-role-users : Ensure /etc/sudoers.d is scanned by sudo] *******************************
--- before: /etc/sudoers (content)
+++ after: /etc/sudoers (content)
@@ -52,3 +52,4 @@
 # See sudoers(5) for more information on "@include" directives:
 
 @includedir /etc/sudoers.d
+#includedir /etc/sudoers.d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions