From 93fe0a4826a4f45c08895fdfecefce46a4de5edb Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Tue, 10 May 2022 14:06:13 +0200 Subject: [PATCH] fix: enable includedir directive --- tasks/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 9620cb8..389747e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,6 +9,17 @@ state: present with_items: "{{ sudo_users_package_names }}" +- name: Enable includedir directive + lineinfile: + dest: /etc/sudoers + state: present + regexp: "^(#)+(\\s)*includedir(\\s)*/etc/sudoers.d" + line: "#includedir /etc/sudoers.d" + validate: 'visudo --check --file %s' + mode: 0440 + owner: root + group: root + - name: Flush drop-in files of sudoers.d file: state: "{{ item }}"