service-fastd-mesh: add fastd-limiter (dry run)
new limits are not yet used by fastd
This commit is contained in:
parent
8a898bf339
commit
a825a9bed0
6 changed files with 105 additions and 0 deletions
|
@ -59,6 +59,48 @@
|
||||||
notify: restart fastd mesh instances
|
notify: restart fastd mesh instances
|
||||||
loop: "{{ meshes | subelements('fastd.nodes.instances') }}"
|
loop: "{{ meshes | subelements('fastd.nodes.instances') }}"
|
||||||
|
|
||||||
|
- name: install redis-server
|
||||||
|
apt:
|
||||||
|
name: redis-server
|
||||||
|
state: latest
|
||||||
|
default_release: stretch-backports
|
||||||
|
|
||||||
|
- name: build fastd-limiter
|
||||||
|
shell: "go get -v -u github.com/freifunk-mwu/fastd-limiter"
|
||||||
|
environment:
|
||||||
|
GOPATH: "{{ gopath }}"
|
||||||
|
|
||||||
|
- name: write fastd-limiter config
|
||||||
|
template:
|
||||||
|
src: fastd-limiter.yaml.j2
|
||||||
|
dest: /etc/fastd-limiter.yaml
|
||||||
|
owner: admin
|
||||||
|
group: admin
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: write systemd units for fastd-limiter
|
||||||
|
template:
|
||||||
|
src: "{{ item }}.j2"
|
||||||
|
dest: "/etc/systemd/system/{{ item }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
notify: reload systemd
|
||||||
|
loop:
|
||||||
|
- fastd-limiter-limit.service
|
||||||
|
- fastd-limiter-limit.timer
|
||||||
|
- fastd-limiter-peers.service
|
||||||
|
- fastd-limiter-peers.timer
|
||||||
|
|
||||||
|
- name: configure systemd timers for fastd-limiter
|
||||||
|
systemd:
|
||||||
|
name: "{{ item }}"
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
loop:
|
||||||
|
- fastd-limiter-limit.timer
|
||||||
|
- fastd-limiter-peers.timer
|
||||||
|
|
||||||
- name: write systemd unit fastd-sync-meshkeys.service
|
- name: write systemd unit fastd-sync-meshkeys.service
|
||||||
template:
|
template:
|
||||||
src: fastd-sync-meshkeys.service.j2
|
src: fastd-sync-meshkeys.service.j2
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Update fastd peer limits
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart={{ gopath }}/bin/fastd-limiter limit
|
||||||
|
User=admin
|
||||||
|
Group=admin
|
|
@ -0,0 +1,12 @@
|
||||||
|
#
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Timer which schedules fastd-limiter-limit.service
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=5min
|
||||||
|
OnUnitActiveSec=5min
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
|
@ -0,0 +1,11 @@
|
||||||
|
#
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Update fastd connected peers
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart={{ gopath }}/bin/fastd-limiter peers
|
||||||
|
User=admin
|
||||||
|
Group=admin
|
|
@ -0,0 +1,12 @@
|
||||||
|
#
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
#
|
||||||
|
[Unit]
|
||||||
|
Description=Timer which schedules fastd-limiter-peers.service
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=5min
|
||||||
|
OnUnitActiveSec=1min
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
17
roles/service-fastd-mesh/templates/fastd-limiter.yaml.j2
Normal file
17
roles/service-fastd-mesh/templates/fastd-limiter.yaml.j2
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
#
|
||||||
|
|
||||||
|
additional: 8
|
||||||
|
|
||||||
|
redis_db: '127.0.0.1:6379'
|
||||||
|
|
||||||
|
fastd_keys: '{{ git_path }}/peers-ffmwu'
|
||||||
|
key_ttl: 900
|
||||||
|
|
||||||
|
gateways:
|
||||||
|
{% for gateway in groups['ffmwu-gateways'] %}
|
||||||
|
- {{ gateway.rsplit('.freifunk-mwu.de')[0] }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
metrics_url: 'https://%s.freifunk-mwu.de:9281/metrics'
|
Loading…
Reference in a new issue