From 81592c1288d8848bf8989c7cb03bfe910bea559b Mon Sep 17 00:00:00 2001 From: Pi Date: Tue, 6 Aug 2019 10:21:48 -0400 Subject: [PATCH] - add proc_chec - kills off extraneous chrome processes and restarts ntopng --- reboot.yaml | 1 + roles/common/files/proc_check.sh | 6 ++++++ roles/common/tasks/main.yaml | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 roles/common/files/proc_check.sh diff --git a/reboot.yaml b/reboot.yaml index 300eac3..4a19fb1 100644 --- a/reboot.yaml +++ b/reboot.yaml @@ -1,5 +1,6 @@ --- - hosts: all,!ansible-hosts + gather_facts: no tasks: - name: reboot become: yes diff --git a/roles/common/files/proc_check.sh b/roles/common/files/proc_check.sh new file mode 100644 index 0000000..ead18ce --- /dev/null +++ b/roles/common/files/proc_check.sh @@ -0,0 +1,6 @@ +#!/bin/bash +/usr/bin/killall chromium-browser +/usr/bin/killall chromium-browser +/usr/bin/killall chromium-browser +systemctl restart ntopng + diff --git a/roles/common/tasks/main.yaml b/roles/common/tasks/main.yaml index c214e74..8b7b459 100644 --- a/roles/common/tasks/main.yaml +++ b/roles/common/tasks/main.yaml @@ -72,6 +72,20 @@ # become: yes #- name: set keyboard to us # command: raspi-config nonint do_configure_keyboard us +- name: copy proc_check script and set exec + template: + src: "{{ role_path }}/files/proc_check.sh" + dest: /home/pi/scripts/proc_check.sh + owner: pi + group: pi + mode: a+x +- name: schedule proc_check script to run at 12:30am + cron: + name: "prock_check" + minute: "30" + hour: "0" + weekday: "*" + job: /home/pi/scripts/proc_check.sh - name: pi become: yes user: