From b9efe6c8bed9b6f67c62f001730d4c9560c79ca7 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Mon, 27 Mar 2017 20:24:38 +0200 Subject: [PATCH] Add respondd (aka alfred-announce) --- roles/git/tasks/main.yml | 7 +++++++ roles/respondd/defaults/main.yml | 5 +++++ roles/respondd/handlers/main.yml | 7 +++++++ roles/respondd/meta/main.yml | 4 ++++ roles/respondd/tasks/main.yml | 14 ++++++++++++++ roles/respondd/templates/respondd.service.j2 | 10 ++++++++++ site.yml | 1 + 7 files changed, 48 insertions(+) create mode 100644 roles/git/tasks/main.yml create mode 100644 roles/respondd/defaults/main.yml create mode 100644 roles/respondd/handlers/main.yml create mode 100644 roles/respondd/meta/main.yml create mode 100644 roles/respondd/tasks/main.yml create mode 100644 roles/respondd/templates/respondd.service.j2 diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml new file mode 100644 index 0000000..a5eb418 --- /dev/null +++ b/roles/git/tasks/main.yml @@ -0,0 +1,7 @@ +--- + +- name: Install git + apt: name=git + +- name: Install ca-certificates + apt: name=ca-certificates diff --git a/roles/respondd/defaults/main.yml b/roles/respondd/defaults/main.yml new file mode 100644 index 0000000..eb964ae --- /dev/null +++ b/roles/respondd/defaults/main.yml @@ -0,0 +1,5 @@ +--- + +respondd_announce_git_root: https://github.com/ffnord/ffnord-alfred-announce/ +batman_interface: bat-{{ site_code }} +main_bridge: br-{{ site_code }} diff --git a/roles/respondd/handlers/main.yml b/roles/respondd/handlers/main.yml new file mode 100644 index 0000000..38ab132 --- /dev/null +++ b/roles/respondd/handlers/main.yml @@ -0,0 +1,7 @@ +--- + +- name: Restart respondd + service: name=respondd state=restarted + +- name: Reload systemd + command: systemctl daemon-reload diff --git a/roles/respondd/meta/main.yml b/roles/respondd/meta/main.yml new file mode 100644 index 0000000..050e161 --- /dev/null +++ b/roles/respondd/meta/main.yml @@ -0,0 +1,4 @@ +--- + +dependencies: +- { role: git } diff --git a/roles/respondd/tasks/main.yml b/roles/respondd/tasks/main.yml new file mode 100644 index 0000000..ab2636f --- /dev/null +++ b/roles/respondd/tasks/main.yml @@ -0,0 +1,14 @@ +--- + +- name: Clone respondd announce repository + git: repo={{ respondd_announce_git_root }} dest=/opt/{{ site_code }}/respondd-announce/ + notify: Restart respondd + +- name: Install system unit + template: src=respondd.service.j2 dest=/lib/systemd/system/respondd.service + notify: + - Reload systemd + - Restart respondd + +- name: Enable respondd + service: name=respondd enabled=yes diff --git a/roles/respondd/templates/respondd.service.j2 b/roles/respondd/templates/respondd.service.j2 new file mode 100644 index 0000000..59651a2 --- /dev/null +++ b/roles/respondd/templates/respondd.service.j2 @@ -0,0 +1,10 @@ +# {{ ansible_managed }} + +[Unit] +Description=Respondd + +[Service] +ExecStart=/opt/{{ site_code }}/respondd-announce/respondd.py -b {{ batman_interface }} -i {{ main_bridge }} -i vpn-{{ site_code }} -d /opt/{{ site_code }}/respondd-announce/ + +[Install] +WantedBy=multi-user.target diff --git a/site.yml b/site.yml index 60486c1..b5bed2c 100644 --- a/site.yml +++ b/site.yml @@ -15,6 +15,7 @@ - mesh-interfaces - dns - dhcpd + - respondd - name: Setup confluence server hosts: confluence.regensburg.freifunk.net