Skip to content

Commit

Permalink
yanic: use static config file
Browse files Browse the repository at this point in the history
This uses the current config file taken from actual ffmap server, except
that the (unused) influxdb2 access token was removed.
  • Loading branch information
oliver committed May 26, 2022
1 parent 769a30b commit 722ed70
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 86 deletions.
12 changes: 1 addition & 11 deletions playbooks/ffmapserver.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
---
- hosts: ffmapserver
vars:
yanic_config_file: yanic.conf.ffmapserver
yanic_publisher: true
yanic_respondd_interface: "bat0"
yanic_webserver: false
yanic_nodes_save_interval: "15s"
yanic_nodes_state_path: /opt/yanic/nodes_state.json
yanic_meshviewer_path: /opt/yanic
yanic_meshviewer_nodes: /opt/yanic/nodes_v2.json
yanic_influxdb:
- enable: "true"
host: http://webserver.bremen.freifunk.net:8086
database: "ffhb-nodes"
username: "ffhb-respondd-collector"
password: ""
yanic_nodes_paths: /opt/yanic/v1 /opt/yanic/v2 /opt/yanic/meshviewer.json /opt/yanic/respondd-crashed.json /opt/yanic/nodelist.json /opt/yanic/geojson.json
roles:
- { role: etckeeper-pre, tags: [etckeeper-pre] }
Expand Down
38 changes: 7 additions & 31 deletions roles/yanic/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,12 @@
---
yanic_publisher: false
yanic_respondd: true
yanic_respondd_collect_interval: "1m"
yanic_respondd_interface: "eth0"

yanic_webserver: false
yanic_webserver_bind: "127.0.0.1:8080"
yanic_webserver_webroot: "/var/www/html/meshviewer"

yanic_nodes: true
yanic_nodes_state_path: "/var/lib/yanic.json"
yanic_nodes_save_interval: "5s"
yanic_nodes_offline_after: "10m"
yanic_nodes_prune_after: "7d"
# Config file to use for yanic.
# There is no sensible default for the config file (it _must_ be specified for each host separately).
yanic_config_file:

yanic_meshviewer_version: 2
# Directory for yanic results (will be created by Ansible role):
yanic_meshviewer_path: "/var/www/html/meshviewer/data"
yanic_meshviewer_nodes: "{{yanic_meshviewer_path}}/nodes.json"
yanic_meshviewer_graph: "{{yanic_meshviewer_path}}/graph.json"

yanic_database_delete_after: "7d"
yanic_database_delete_interval: "1h"

yanic_socket:
- enable: false
type: unix
address: "/var/lib/yanic/database.socket"
yanic_influxdb:
- enable: false
host: http://localhost:8086
database: ffhb
username: ""
password: ""

# Whether the yanic results (from yanic_nodes_paths) should be periodically rsync'ed to the webserver.
yanic_publisher: false
# Path(es) to rsync to the webserver.
yanic_nodes_paths: "{{yanic_meshviewer_path}}"
2 changes: 1 addition & 1 deletion roles/yanic/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

- name: Configure yanic
template:
src: config.toml
src: "{{ yanic_config_file }}"
dest: /etc/yanic.conf
mode: 0644
owner: root
Expand Down
43 changes: 0 additions & 43 deletions roles/yanic/templates/config.toml

This file was deleted.

134 changes: 134 additions & 0 deletions roles/yanic/templates/yanic.conf.ffmapserver
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
[respondd]
enable = true
collect_interval = "1m"

[respondd.sites.ffhb]
domains = ["ffhb", "ffhb_legacy", "ffhb_11s", "servers", ""]

[[respondd.interfaces]]
ifname = "br-ffhb"
port = 10001

[[respondd.interfaces]]
ifname = "br-ffhb"
multicast_address = "ff02::2:1001"

[[respondd.interfaces]]
ifname = "eth0"
send_no_request = true
ip_address = "2a06:8782:ff00::f6"
port = 11001

[webserver]
enable = true
bind = ":8080"
webroot = "/opt/yanic/webroot"

[webserver.prometheus]
enable = true
wait = "10s"
outdated = "60s"


[nodes]
state_path = "/opt/yanic/state.json"
save_interval = "1m"
offline_after = "10m"
prune_after = "7d"
# ping_count = 3
# ping_timeout = "1s"


[[nodes.output.meshviewer]]
enable = true
version = 1
nodes_path = "/opt/yanic/v1/nodes.json"
graph_path = "/opt/yanic/v1/graph.json"

[nodes.output.meshviewer.filter]
no_owner = true


[[nodes.output.meshviewer]]
enable = true
version = 2
nodes_path = "/opt/yanic/v2/nodes.json"
graph_path = "/opt/yanic/v2/graph.json"

[nodes.output.meshviewer.filter]
no_owner = true


[[nodes.output.meshviewer-ffrgb]]
enable = true
path = "/opt/yanic/meshviewer.json"

[nodes.output.meshviewer-ffrgb.filter]
no_owner = true


[[nodes.output.nodelist]]
enable = true
path = "/opt/yanic/nodelist.json"

[nodes.output.nodelist.filter]
no_owner = true

[[nodes.output.geojson]]
enable = true
path = "/opt/yanic/geojson.json"

[[nodes.output.raw]]
enable = false

[[nodes.output.raw-jsonl]]
enable = false

[[nodes.output.prometheus-sd]]
enable = true
#path = "/var/lib/freifunkmanager/metrics"
path = "/opt/yanic/webroot/index.html"
target_address = "node_id"

[nodes.output.prometheus-sd.labels]
hosts = "ffhb"
service = "yanic"


[database]
delete_after = "7d"
delete_interval = "1h"

[[database.connection.influxdb]]
enable = true
address = "http://webserver.bremen.freifunk.net:8086"
database = "{{respond_collector_influxdb_database}}"
username = "{{respond_collector_influxdb_username}}"
password = "{{respond_collector_influxdb_password}}"

[[database.connection.influxdb2]]
enable = false
address = "http://webserver.bremen.freifunk.net:8086"
token = ""
organization_id = "ffhb"
bucket_default = "yanic-temp"

[database.connection.influxdb2.buckets]
global = "ffhb-nodes/autogen"
firmware = "ffhb-nodes/autogen"
model = "ffhb-nodes/autogen"
autoupdater = "ffhb-nodes/autogen"

[database.connection.influxdb2.tags]
system = "production"

[[database.connection.graphite]]
enable = false

[[database.connection.logging]]
enable = false

[[database.connection.respondd]]
enable = false
type = "udp6"
address = "[::1]:10001"

0 comments on commit 722ed70

Please sign in to comment.