Add role service-respondd

This commit is contained in:
Tobias Hachmer 2017-10-15 10:18:26 +02:00
parent 130980d863
commit 57fff0410e
5 changed files with 59 additions and 0 deletions

View file

@ -29,3 +29,4 @@
- service-bind-slave - service-bind-slave
- network-routing - network-routing
- system-sysctl-gateway - system-sysctl-gateway
- service-respondd

View file

@ -76,6 +76,12 @@
systemd: systemd:
name: ffmwu-ip-rules name: ffmwu-ip-rules
state: restarted state: restarted
- name: restart respondd
systemd:
name: "respondd-{{ item.id }}"
state: restarted
with_items: "{{ meshes }}"
- name: iptables-restore - name: iptables-restore
shell: iptables-restore < /etc/iptables/rules.v4 shell: iptables-restore < /etc/iptables/rules.v4

View 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
´´´

View 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 }}"

View 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