Add role service-respondd
This commit is contained in:
parent
130980d863
commit
57fff0410e
5 changed files with 59 additions and 0 deletions
|
@ -29,3 +29,4 @@
|
|||
- service-bind-slave
|
||||
- network-routing
|
||||
- system-sysctl-gateway
|
||||
- service-respondd
|
||||
|
|
|
@ -76,6 +76,12 @@
|
|||
systemd:
|
||||
name: ffmwu-ip-rules
|
||||
state: restarted
|
||||
|
||||
- name: restart respondd
|
||||
systemd:
|
||||
name: "respondd-{{ item.id }}"
|
||||
state: restarted
|
||||
with_items: "{{ meshes }}"
|
||||
|
||||
- name: iptables-restore
|
||||
shell: iptables-restore < /etc/iptables/rules.v4
|
||||
|
|
16
roles/service-respondd/README.md
Normal file
16
roles/service-respondd/README.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Ansible role service-respondd
|
||||
|
||||
Diese Ansible role installiert und konfiguriert die respondd Implementierung `mesh-announce`.
|
||||
Pro Mesh Netzwerk muss eine `mesh-announce`-Instanz laufen.
|
||||
|
||||
- installiert `mesh-announce` (Github Clone)
|
||||
- installiert pro Mesh Netzwerk eine systemd unit
|
||||
|
||||
## Benötigte Variablen
|
||||
|
||||
- Dictionary `meshes`
|
||||
´´´
|
||||
meshes:
|
||||
- id: xx
|
||||
site_code: # string
|
||||
´´´
|
26
roles/service-respondd/tasks/main.yml
Normal file
26
roles/service-respondd/tasks/main.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
- name: clone respondd repo
|
||||
git:
|
||||
repo: https://github.com/freifunk-mwu/mesh-announce.git
|
||||
dest: /home/admin/clones/mesh-announce
|
||||
version: mwu-respondd
|
||||
become: false
|
||||
|
||||
- name: write systemd unit files
|
||||
template:
|
||||
src: respondd.service.j2
|
||||
dest: "/etc/systemd/system/respondd-{{ item.id }}.service"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify:
|
||||
- reload systemd
|
||||
- restart respondd
|
||||
with_items: "{{ meshes }}"
|
||||
|
||||
- name: configure systemd unit files
|
||||
systemd:
|
||||
name: "respondd-{{ item.id }}"
|
||||
enabled: yes
|
||||
state: started
|
||||
with_items: "{{ meshes }}"
|
10
roles/service-respondd/templates/respondd.service.j2
Normal file
10
roles/service-respondd/templates/respondd.service.j2
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=respondd instance {{ item.id }}
|
||||
|
||||
[Service]
|
||||
ExecStart=/home/admin/clones/mesh-announce/respondd.py -i {{ item.id }}BR -b {{ item.id }}BAT -s {{ item.site_code }} -d /home/admin/clones/mesh-announce/
|
||||
Restart=always
|
||||
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue