Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yanic update #105

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions playbooks/ffmapserver.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
---
- 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] }
- { role: yanic, tags: [yanic] }
Expand Down
2 changes: 1 addition & 1 deletion roles/go/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
template:
src: go.sh
dest: /etc/profile.d/go.sh
mode: 0644
mode: 0755
owner: root
group: root
38 changes: 8 additions & 30 deletions roles/yanic/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,34 +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.

2 changes: 1 addition & 1 deletion roles/yanic/templates/yanic-publish.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=Publish data of yanic on downloads server

[Service]
ExecStart=/usr/bin/rsync --del -rt {{ yanic_nodes_path }}/ downloads@webserver.bremen.freifunk.net:data/yanic
ExecStart=/usr/bin/rsync -l --del -rt {{ yanic_nodes_paths }} downloads@webserver.bremen.freifunk.net:data/
User=yanic
Type=oneshot

Expand Down
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"
2 changes: 1 addition & 1 deletion roles/yanic/templates/yanic.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Description=yanic
[Service]
Type=simple
User=yanic
ExecStart=/opt/go/bin/yanic -config /etc/yanic.conf
ExecStart=/opt/go/bin/yanic serve --config /etc/yanic.conf --timestamps --loglevel 40
Restart=always
RestartSec=5s
Environment=PATH=/usr/bin:/usr/local/bin
Expand Down