From a2104ddcc50947afcb74ba9bf868010e26e25fcd Mon Sep 17 00:00:00 2001 From: Tobias Hachmer Date: Fri, 29 Dec 2017 14:27:52 +0100 Subject: [PATCH] Role service-tinc: fix handling of systemd unit * remove init script if present * nets.boot not necessary with new systemd unit * update systemd tasks to use systemd unit tinc@ * update handler --- roles/handlers/handlers/main.yml | 2 +- roles/service-tinc/tasks/main.yml | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/roles/handlers/handlers/main.yml b/roles/handlers/handlers/main.yml index c89973c..bedfd6c 100644 --- a/roles/handlers/handlers/main.yml +++ b/roles/handlers/handlers/main.yml @@ -57,7 +57,7 @@ - name: restart systemd unit tinc systemd: - name: tinc + name: "tinc@{{ icvpn.interface }}" enabled: yes state: restarted diff --git a/roles/service-tinc/tasks/main.yml b/roles/service-tinc/tasks/main.yml index 5ee461d..263e790 100644 --- a/roles/service-tinc/tasks/main.yml +++ b/roles/service-tinc/tasks/main.yml @@ -71,17 +71,14 @@ group: admin notify: restart systemd unit tinc -- name: write nets.boot - template: - src: nets.boot.j2 - dest: /etc/tinc/nets.boot - mode: 0644 - owner: root - group: root - notify: restart systemd unit tinc +- name: remove tinc init file if present + file: + path: /etc/init.d/tinc + state: absent + notify: reload systemd - name: configure systemd unit tinc systemd: - name: tinc + name: "tinc@{{ icvpn.interface }}" enabled: yes state: started