diff --git a/roles/service-fastd-mesh/tasks/main.yml b/roles/service-fastd-mesh/tasks/main.yml index c45e907..a7d376d 100644 --- a/roles/service-fastd-mesh/tasks/main.yml +++ b/roles/service-fastd-mesh/tasks/main.yml @@ -98,8 +98,29 @@ mode: 0644 notify: reload systemd -- name: configure systemd unit/timer fastd-sync-meshkeys +- name: write systemd unit fastd-peer-limit-update.service + template: + src: fastd-peer-limit-update.service.j2 + dest: /etc/systemd/system/fastd-peer-limit-update.service + owner: root + group: root + mode: 0644 + notify: reload systemd + +- name: write systemd timer fastd-peer-limit-update.timer + template: + src: fastd-peer-limit-update.timer.j2 + dest: /etc/systemd/system/fastd-peer-limit-update.timer + owner: root + group: root + mode: 0644 + notify: reload systemd + +- name: configure systemd timers for fastd-mesh instance systemd: - name: fastd-sync-meshkeys.timer + name: "{{ item }}.timer" enabled: yes state: started + with_items: + - fastd-sync-meshkeys + - fastd-peer-limit-update diff --git a/roles/service-fastd-mesh/templates/fastd-peer-limit-update.service.j2 b/roles/service-fastd-mesh/templates/fastd-peer-limit-update.service.j2 new file mode 100644 index 0000000..963809e --- /dev/null +++ b/roles/service-fastd-mesh/templates/fastd-peer-limit-update.service.j2 @@ -0,0 +1,10 @@ +# +# {{ ansible_managed }} +# +[Unit] +Description=Update fastd peer limits + +[Service] +ExecStart=/home/admin/clones/backend-scripts/limit_fastd_peers_gw.py +User=admin +Group=admin diff --git a/roles/service-fastd-mesh/templates/fastd-peer-limit-update.timer.j2 b/roles/service-fastd-mesh/templates/fastd-peer-limit-update.timer.j2 new file mode 100644 index 0000000..880c912 --- /dev/null +++ b/roles/service-fastd-mesh/templates/fastd-peer-limit-update.timer.j2 @@ -0,0 +1,12 @@ +# +# {{ ansible_managed }} +# +[Unit] +Description=Timer which schedules fastd-peer-limit-update.service + +[Timer] +OnBootSec=5min +OnUnitActiveSec=5min + +[Install] +WantedBy=timers.target