From b53a8cf2283b2d6debb94cd399a72d25da0d7c82 Mon Sep 17 00:00:00 2001 From: Niklas Yann Wettengel Date: Sun, 12 Dec 2021 15:15:03 +0100 Subject: merge fastd and uplink nodes --- roles/install_monitoring/tasks/install_munin.yml | 55 +++------------------- roles/install_monitoring/tasks/main.yml | 1 - .../templates/ffmyk-influx/traffic.php.j2 | 3 -- .../templates/munin-node.conf.j2 | 2 +- 4 files changed, 8 insertions(+), 53 deletions(-) (limited to 'roles/install_monitoring') diff --git a/roles/install_monitoring/tasks/install_munin.yml b/roles/install_monitoring/tasks/install_munin.yml index ee81639..c843bfe 100644 --- a/roles/install_monitoring/tasks/install_munin.yml +++ b/roles/install_monitoring/tasks/install_munin.yml @@ -14,7 +14,6 @@ pacman: name: perl-json state: present - when: "'fastd' in group_names" - name: copy fastd peers plugin copy: @@ -22,7 +21,6 @@ dest: /usr/lib/munin/plugins/fastd_peers_ mode: 0755 notify: restart munin-node - when: "'fastd' in group_names" - name: copy fastd traffic plugin copy: @@ -30,7 +28,6 @@ dest: /usr/lib/munin/plugins/fastd_traffic_ mode: 0755 notify: restart munin-node - when: "'fastd' in group_names" - name: enable munin plugins for fastd peers file: @@ -39,7 +36,6 @@ state: link with_items: "{{ sites }}" notify: restart munin-node - when: "'fastd' in group_names" - name: enable munin plugins for fastd traffic file: @@ -48,14 +44,12 @@ state: link with_items: "{{ sites }}" notify: restart munin-node - when: "'fastd' in group_names" - name: copy fastd plugin config template: src: munin_fastd_conf.j2 dest: /etc/munin/plugin-conf.d/fastd notify: restart munin-node - when: "'fastd' in group_names" - name: copy wg peers plugin copy: @@ -63,7 +57,6 @@ dest: /usr/lib/munin/plugins/wg_peers_ mode: 0755 notify: restart munin-node - when: "'fastd' in group_names" - name: copy wg peers plugin config copy: @@ -71,7 +64,6 @@ dest: /etc/munin/plugin-conf.d/wg mode: 0644 notify: restart munin-node - when: "'fastd' in group_names" - name: enable munin plugins for wg peers file: @@ -80,7 +72,6 @@ state: link with_items: "{{ sites }}" notify: restart munin-node - when: "'fastd' in group_names" - name: copy dhcp-pool plugin copy: @@ -88,7 +79,6 @@ dest: /usr/lib/munin/plugins/dhcp-pool mode: 0755 notify: restart munin-node - when: "'fastd' in group_names" - name: enable munin plugins for dhcp file: @@ -96,7 +86,6 @@ src: /usr/lib/munin/plugins/dhcp-pool state: link notify: restart munin-node - when: "'fastd' in group_names" - name: copy fw_conntrack plugin copy: @@ -128,21 +117,21 @@ name: perl-lwp-protocol-https state: present -- name: enable munin plugins for network monitoring (1/9) +- name: enable munin plugins for network monitoring (1/6) file: path: /etc/munin/plugins/if_{{ ansible_default_ipv4.interface }} src: /usr/lib/munin/plugins/if_ state: link notify: restart munin-node -- name: enable munin plugins for network monitoring (2/9) +- name: enable munin plugins for network monitoring (2/6) file: path: /etc/munin/plugins/if_{{ ansible_default_ipv6.interface }} src: /usr/lib/munin/plugins/if_ state: link notify: restart munin-node -- name: enable munin plugins for network monitoring (3/9) +- name: enable munin plugins for network monitoring (3/6) file: path: /etc/munin/plugins/if_{{ item[0] }}{{ item[1].name }} src: /usr/lib/munin/plugins/if_ @@ -151,60 +140,30 @@ with_nested: - [ 'bat', 'vpn', 'wg', 'vx' ] - "{{ sites }}" - when: "'fastd' in group_names" -- name: enable munin plugins for network monitoring (4/9) - file: - path: /etc/munin/plugins/if_bb{{ hostvars[item]['wireguard_bb_name'] }} - src: /usr/lib/munin/plugins/if_ - state: link - notify: restart munin-node - with_items: "{{ groups['uplink'] }}" - when: "'fastd' in group_names" - -- name: enable munin plugins for network monitoring (5/9) - file: - path: /etc/munin/plugins/if_bb{{ hostvars[item]['wireguard_bb_name'] }} - src: /usr/lib/munin/plugins/if_ - state: link - notify: restart munin-node - with_items: "{{ groups['fastd'] }}" - when: "'uplink' in group_names" - -- name: enable munin plugins for network monitoring (6/9) +- name: enable munin plugins for network monitoring (4/6) file: path: /etc/munin/plugins/if_bb{{ item.name }} src: /usr/lib/munin/plugins/if_ state: link notify: restart munin-node with_items: "{{ wireguard_bb_peers|default([]) }}" - when: "'uplink' in group_names" -- name: enable munin plugins for network monitoring (7/9) +- name: enable munin plugins for network monitoring (5/6) file: path: /etc/munin/plugins/if_bb{{ hostvars[item]['wireguard_bb_name'] }} src: /usr/lib/munin/plugins/if_ state: link notify: restart munin-node - with_items: "{{ groups['uplink'] | difference([inventory_hostname]) }}" - when: "'uplink' in group_names" + with_items: "{{ groups['fastd'] | difference([inventory_hostname]) }}" -- name: enable munin plugins for network monitoring (8/9) +- name: enable munin plugins for network monitoring (6/6) file: path: /etc/munin/plugins/if_{{ item.name }} src: /usr/lib/munin/plugins/if_ state: link notify: restart munin-node with_items: "{{ ffrl_peers }}" - when: "'ffrl_uplink' in group_names" - -- name: enable munin plugins for network monitoring (9/9) - file: - path: /etc/munin/plugins/if_mullvad - src: /usr/lib/munin/plugins/if_ - state: link - notify: restart munin-node - when: "'mullvad_uplink' in group_names" - name: enable munin plugins file: diff --git a/roles/install_monitoring/tasks/main.yml b/roles/install_monitoring/tasks/main.yml index 6600e0c..dc3c445 100644 --- a/roles/install_monitoring/tasks/main.yml +++ b/roles/install_monitoring/tasks/main.yml @@ -1,7 +1,6 @@ --- - name: install ffmyk-influx include: install_ffmyk-influx.yml - when: "'fastd' in group_names" - name: install munin import_tasks: install_munin.yml diff --git a/roles/install_monitoring/templates/ffmyk-influx/traffic.php.j2 b/roles/install_monitoring/templates/ffmyk-influx/traffic.php.j2 index dde5dba..9a848da 100644 --- a/roles/install_monitoring/templates/ffmyk-influx/traffic.php.j2 +++ b/roles/install_monitoring/templates/ffmyk-influx/traffic.php.j2 @@ -24,8 +24,5 @@ function traffic($iface, $alias=false) { (traffic('vpn{{ site.name }}')); (traffic('wg{{ site.name }}')); {% endfor %} -{% for uplink in groups['uplink'] %} -(traffic('bb{{ hostvars[uplink]['wireguard_bb_name'] }}')); -{% endfor %} ?> diff --git a/roles/install_monitoring/templates/munin-node.conf.j2 b/roles/install_monitoring/templates/munin-node.conf.j2 index 6dda88c..e7a1610 100644 --- a/roles/install_monitoring/templates/munin-node.conf.j2 +++ b/roles/install_monitoring/templates/munin-node.conf.j2 @@ -38,7 +38,7 @@ host_name {{ ansible_fqdn }} # may repeat the allow line as many times as you'd like allow ^127\.0\.0\.1$ -allow ^2a01:4f8:151:13cd:1::35$ +allow ^2a01:4f8:272:3d5f:1::35$ allow ^::1$ # Which address to bind to; -- cgit v1.2.3-54-g00ecf