Debug looks terrible. Put it in a file and hope that the color codes are ignored.
This commit is contained in:
parent
5b94393359
commit
de7b2ea00c
24
facts/filesystem_names.yml
Normal file
24
facts/filesystem_names.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
# Define what the file and folder names should be on each OS.
|
||||||
|
|
||||||
|
- name: Set Pop!_OS Package Names
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
lynis_install_dir: /usr/local/lynis
|
||||||
|
lynis_report: /home/ling/lynis.log
|
||||||
|
when: ansible_distribution == "Pop!_OS"
|
||||||
|
|
||||||
|
|
||||||
|
# TODO Needs tested
|
||||||
|
- name: Set Ubuntu Package Names
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
lynis_install_dir: /usr/local/lynis
|
||||||
|
lynis_report: /root/lynis.log
|
||||||
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
|
|
||||||
|
# TODO Needs tested
|
||||||
|
- name: Set FreeBSD Package Names
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
lynis_install_dir: /usr/local/lynis
|
||||||
|
lynis_report: /root/lynis.log
|
||||||
|
when: ansible_distribution == "FreeBSD"
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
# Define what the program name is on each OS so we can use package builtin. like this:
|
# Define what the program name is on each OS so we can use package builtin.
|
||||||
|
|
||||||
- name: Set Pop!_OS Package Names
|
- name: Set Pop!_OS Package Names
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
# Define what the program name is on each OS so we can use package builtin. like this:
|
# Define what the program name is on each OS so we can use service builtin.
|
||||||
|
|
||||||
- name: Set Pop!_OS Service Names
|
- name: Set Pop!_OS Service Names
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
cups: cups
|
cups: cups
|
||||||
cups_pattern: cupsd
|
cups_pattern: cupsd
|
||||||
|
|
||||||
cups_browse: cups-browsed
|
cups_browse: cups-browsed
|
||||||
cups_browse_pattern: cups-browsed
|
cups_browse_pattern: cups-browsed
|
||||||
when: ansible_distribution == "Pop!_OS"
|
when: ansible_distribution == "Pop!_OS"
|
||||||
@ -15,6 +16,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
cups: cups
|
cups: cups
|
||||||
cups_pattern: cupsd
|
cups_pattern: cupsd
|
||||||
|
|
||||||
cups_browse: cups-browsed
|
cups_browse: cups-browsed
|
||||||
cups_browse_pattern: cups-browsed
|
cups_browse_pattern: cups-browsed
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
@ -25,6 +27,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
cups: cups
|
cups: cups
|
||||||
cups_pattern: cupsd
|
cups_pattern: cupsd
|
||||||
|
|
||||||
cups_browse: cups-browsed
|
cups_browse: cups-browsed
|
||||||
cups_browse_pattern: cups-browsed
|
cups_browse_pattern: cups-browsed
|
||||||
when: ansible_distribution == "FreeBSD"
|
when: ansible_distribution == "FreeBSD"
|
@ -6,6 +6,7 @@
|
|||||||
become: true
|
become: true
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
- include: facts/filesystem_names.yml
|
||||||
- include: facts/package_names.yml
|
- include: facts/package_names.yml
|
||||||
- include: facts/service_names.yml
|
- include: facts/service_names.yml
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
- name: Install Lynis
|
- name: Install Lynis
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: https://github.com/CISOfy/lynis
|
repo: https://github.com/CISOfy/lynis
|
||||||
dest: /usr/local/lynis
|
dest: "{{ lynis_install_dir }}"
|
||||||
clone: yes
|
clone: yes
|
||||||
force: yes
|
force: yes
|
||||||
|
|
||||||
- name: Run Lynis
|
- name: Run Lynis Audit System
|
||||||
command: /usr/local/lynis/lynis audit system
|
command: /usr/local/lynis/lynis audit system > "{{ lynis_report }}"
|
||||||
register: lynis_report
|
|
||||||
|
|
||||||
- name: Lynis Report
|
- name: Make Lynis Report Readable
|
||||||
debug:
|
command: chmod 444 "{{ lynis_report }}"
|
||||||
var: lynis_report
|
|
Loading…
x
Reference in New Issue
Block a user