From 6e12534299b9284c2bf56b848912e5bffddd67f0 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 6 Feb 2021 09:42:47 -0600 Subject: [PATCH] Fix ansible sudoer permissions. --- facts/general/system.yml | 6 +++--- local.yml | 1 + tasks/general/cron/ansible.yml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/facts/general/system.yml b/facts/general/system.yml index af7855b..d4d3e19 100644 --- a/facts/general/system.yml +++ b/facts/general/system.yml @@ -4,21 +4,21 @@ - name: Facts | General | System | Pop OS set_fact: lynis_install_dir: /usr/local/lynis - sudoers_install_dir: /etc/sudoers.d/ansible + sudoers_install_dir: /etc/sudoers.d/ when: ansible_distribution == "Pop!_OS" - name: Facts | General | System | Debian and Ubuntu set_fact: lynis_install_dir: /usr/local/lynis - sudoers_install_dir: /etc/sudoers.d/ansible + sudoers_install_dir: /etc/sudoers.d/ when: ansible_distribution in ("Debian","Ubuntu") - name: Facts | General | System | FreeBSD set_fact: lynis_install_dir: /usr/local/lynis - sudoers_install_dir: /usr/local/etc/sudoers.d/ansible + sudoers_install_dir: /usr/local/etc/sudoers.d/ when: ansible_system == "FreeBSD" diff --git a/local.yml b/local.yml index 727f974..e57e7f7 100644 --- a/local.yml +++ b/local.yml @@ -65,4 +65,5 @@ - include: tasks/general/tests/nmap.yml - include: tasks/general/tests/lynis.yml + post_tasks: - include: tasks/general/finish.yml \ No newline at end of file diff --git a/tasks/general/cron/ansible.yml b/tasks/general/cron/ansible.yml index 0e3c3df..9f7c6eb 100644 --- a/tasks/general/cron/ansible.yml +++ b/tasks/general/cron/ansible.yml @@ -15,6 +15,6 @@ user: ansible name: "Heartbeat Report" minute: "*/15" - job: "date > {{ heartbeat_report }}; chmod 777 {{ heartbeat_report }}" + job: "sudo date > {{ heartbeat_report }}; chmod 777 {{ heartbeat_report }}" state: present disabled: no