summaryrefslogtreecommitdiff
path: root/roles/install_monitoring/tasks
diff options
context:
space:
mode:
authorNiklas Yann Wettengel <niyawe@niyawe.de>2018-03-04 17:50:19 +0100
committerNiklas Yann Wettengel <niyawe@niyawe.de>2018-03-04 17:50:19 +0100
commita85999dbacc7d6a26332955e6518ae495797e85e (patch)
tree1488bf5a94103b44cfad86dc9ef8f656a61e84a0 /roles/install_monitoring/tasks
parentaa0593233ec2470120b2655f3ba2ac28d7a4c5ee (diff)
install vnstat
Diffstat (limited to 'roles/install_monitoring/tasks')
-rw-r--r--roles/install_monitoring/tasks/install_vnstat.yml29
-rw-r--r--roles/install_monitoring/tasks/main.yml23
2 files changed, 26 insertions, 26 deletions
diff --git a/roles/install_monitoring/tasks/install_vnstat.yml b/roles/install_monitoring/tasks/install_vnstat.yml
index 9113331..e737d74 100644
--- a/roles/install_monitoring/tasks/install_vnstat.yml
+++ b/roles/install_monitoring/tasks/install_vnstat.yml
@@ -10,15 +10,28 @@
enabled: yes
state: started
-- name: add interfaces to vnstat
- command: /usr/bin/vnstat -u -i {{ item }}
+- name: add interfaces to vnstat for batman interfaces
+ command: /usr/bin/vnstat -u -i bat{{ item.name }}
args:
- creates: '/var/lib/vnstat/{{ item }}'
+ creates: '/var/lib/vnstat/bat{{ item.name }}'
+ with_items: "{{ sites }}"
+
+- name: add interfaces to vnstat for uplink interfaces
+ command: /usr/bin/vnstat -u -i bb{{ hostvars[item]['wireguard_bb_name'] }}
+ args:
+ creates: "/var/lib/vnstat/bb{{ hostvars[item]['wireguard_bb_name'] }}"
with_items:
- - bat0
- - ens3
- - ffmyk-mesh-vpn
- - mullvad
+ - "{{ groups['uplink'] }}"
+
+- name: add interfaces to vnstat for outgoing v4 interface
+ command: /usr/bin/vnstat -u -i {{ ansible_default_ipv4.interface }}
+ args:
+ creates: '/var/lib/vnstat/{{ ansible_default_ipv4.interface }}'
+
+- name: add interfaces to vnstat for outgoing v6 interface
+ command: /usr/bin/vnstat -u -i {{ ansible_default_ipv6.interface }}
+ args:
+ creates: '/var/lib/vnstat/{{ ansible_default_ipv6.interface }}'
- name: add output folder for vnstat graphs
file:
@@ -41,7 +54,7 @@
name: vnstat
minute: '*/5'
user: root
- cron_file: fastd-api
+ cron_file: vnstat
job: '/usr/local/bin/vnstat.sh'
- name: add vnstat nginx config
diff --git a/roles/install_monitoring/tasks/main.yml b/roles/install_monitoring/tasks/main.yml
index 726d890..0b63792 100644
--- a/roles/install_monitoring/tasks/main.yml
+++ b/roles/install_monitoring/tasks/main.yml
@@ -1,22 +1,9 @@
---
- name: install vnstat
- include: install_vnstat.yml
+ import_tasks: install_vnstat.yml
-- name: add bash script to check internet
- copy:
- src: check_internet.sh
- dest: /usr/local/bin/check_internet.sh
- mode: 0744
+#- name: install ffmyk-influx
+# include: install_ffmyk-influx.yml
-- name: add cronjob to check internet
- cron:
- name: check_internet
- user: root
- cron_file: fastd-api
- job: '/usr/local/bin/check_internet.sh'
-
-- name: install ffmyk-influx
- include: install_ffmyk-influx.yml
-
-- name: install munin
- include: install_munin.yml
+#- name: install munin
+# include: install_munin.yml