Provide method for non-SSHFS machines to report.
This commit is contained in:
parent
cbb567cbf2
commit
1a43936c6b
@ -25,7 +25,31 @@
|
||||
- name: Facts | General | System | 1337
|
||||
set_fact:
|
||||
leet_drive: /mnt/leet
|
||||
heartbeat_report: "/mnt/leet/Temp/ansible/{{ ansible_hostname }}.txt"
|
||||
lynis_report: "/mnt/leet/Temp/ansible/{{ ansible_hostname }}_lynis.txt"
|
||||
nmap_report: "/mnt/leet/Temp/ansible/{{ ansible_hostname }}_nmap.txt"
|
||||
ansible_pull_report: "/mnt/leet/Temp/ansible/{{ ansible_hostname }}_last_pull_times.txt"
|
||||
|
||||
- name: Facts | General | System | 1337 Mounted?
|
||||
stat:
|
||||
path: "{{ leet_drive }}"/ansible
|
||||
register: leet_drive_details
|
||||
|
||||
- name: Facts | General | System | 1337 Mounted? DEBUG
|
||||
debug:
|
||||
variable: leet_drive_details
|
||||
|
||||
|
||||
- name: Facts | General | System | Report Location = 1337
|
||||
set_fact:
|
||||
report_location: "{{ leet_drive }}/Temp/ansible"
|
||||
when: leet_drive_details.stat.exists
|
||||
|
||||
- name: Facts | General | System | Report Location = /root
|
||||
set_fact:
|
||||
report_location: "/root"
|
||||
report_scp_location: "Temp/ansible/"
|
||||
when: not leet_drive_details.stat.exists
|
||||
|
||||
- name: Facts | General | System | Reports
|
||||
set_fact:
|
||||
heartbeat_report: "{{ report_location }}/{{ ansible_hostname }}.txt"
|
||||
lynis_report: "{{ report_location }}/{{ ansible_hostname }}_lynis.txt"
|
||||
nmap_report: "{{ report_location }}/{{ ansible_hostname }}_nmap.txt"
|
||||
ansible_pull_report: "{{ report_location }}/{{ ansible_hostname }}_last_pull_times.txt"
|
@ -10,3 +10,22 @@
|
||||
state: present
|
||||
disabled: no
|
||||
when: ansible_system == "FreeBSD"
|
||||
|
||||
- name: General | Cron | Root | Enable Secure Copy Reports
|
||||
cron:
|
||||
user: root
|
||||
name: "Copy Reports"
|
||||
minute: "05,20,35,50"
|
||||
job: "scp {{ ansible_pull_report }} {{ heartbeat_report }} {{ lynis_report }} {{ nmap_report }} ling@leet:{{ report_scp_location }}"
|
||||
state: present
|
||||
disabled: no
|
||||
when: not leet_drive_details.stat.exists
|
||||
|
||||
- name: General | Cron | Root | Disable Secure Copy Reports
|
||||
cron:
|
||||
user: root
|
||||
name: "Copy Reports"
|
||||
job: "As a wise man once said, I'm disabled."
|
||||
state: present
|
||||
disabled: yes
|
||||
when: leet_drive_details.stat.exists
|
@ -4,11 +4,14 @@
|
||||
|
||||
- name: General | Start | Ansible Pull Report | Start File
|
||||
shell: "echo 'START' > {{ ansible_pull_report }}"
|
||||
when: leet_drive_details.stat.exists
|
||||
|
||||
- name: General | Start | Ansible Pull Report | Make Viewable
|
||||
- name: General | Start | Ansible Pull Report | Make Viewable (SSHFS)
|
||||
file:
|
||||
path: "{{ ansible_pull_report }}"
|
||||
mode: '0777'
|
||||
when: leet_drive_details.stat.exists
|
||||
|
||||
- name: General | Start | Ansible Pull Report | Add Date Entry
|
||||
shell: "date >> {{ ansible_pull_report }}"
|
||||
when: leet_drive_details.stat.exists
|
Loading…
x
Reference in New Issue
Block a user