From a53ec10a99854339f17e2d010362ac35161d542d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 31 Jan 2021 13:50:27 -0600 Subject: [PATCH] Fix quotes so that I can remove lynis_exec variable. --- facts/filesystem_names.yml | 3 --- tasks/hardness_check_lynis.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/facts/filesystem_names.yml b/facts/filesystem_names.yml index fd25a34..606c414 100644 --- a/facts/filesystem_names.yml +++ b/facts/filesystem_names.yml @@ -5,7 +5,6 @@ ansible.builtin.set_fact: lynis_install_dir: /usr/local/lynis lynis_report: /home/ling/lynis.log - lynis_exec: /usr/local/lynis/lynis sudoers_install_dir: /etc/sudoers.d/ansible when: ansible_distribution == "Pop!_OS" @@ -15,7 +14,6 @@ ansible.builtin.set_fact: lynis_install_dir: /usr/local/lynis lynis_report: /root/lynis.log - lynis_exec: /usr/local/lynis/lynis sudoers_install_dir: /etc/sudoers.d/ansible when: ansible_distribution == "Ubuntu" @@ -24,6 +22,5 @@ ansible.builtin.set_fact: lynis_install_dir: /usr/local/lynis lynis_report: /root/lynis.log - lynis_exec: /usr/local/lynis/lynis sudoers_install_dir: /usr/local/etc/sudoers.d/ansible when: ansible_distribution == "FreeBSD" \ No newline at end of file diff --git a/tasks/hardness_check_lynis.yml b/tasks/hardness_check_lynis.yml index 350df06..54d2d5f 100644 --- a/tasks/hardness_check_lynis.yml +++ b/tasks/hardness_check_lynis.yml @@ -6,7 +6,7 @@ force: yes - name: Run Lynis Audit System - shell: "{{ lynis_exec }}" --no-colors audit system > "{{ lynis_report }}" 2>&1 + shell: "{{ lynis_install_dir }}/lynis --no-colors audit system > {{ lynis_report }} 2>&1" - name: Make Lynis Report Readable shell: chmod 444 "{{ lynis_report }}" \ No newline at end of file