From ab9220d0424b968f6605f2e83cbe0d965f99be18 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 12 Apr 2023 20:39:49 +0200 Subject: [PATCH] Add pause & gather_facts at end when service was started --- wireguard-ipv6-converter/tasks/setup-service.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wireguard-ipv6-converter/tasks/setup-service.yml b/wireguard-ipv6-converter/tasks/setup-service.yml index c12fc5c..9519768 100644 --- a/wireguard-ipv6-converter/tasks/setup-service.yml +++ b/wireguard-ipv6-converter/tasks/setup-service.yml @@ -14,4 +14,14 @@ ansible.builtin.service: name: wg-ipv6-converter_{{ wireguard_ipv6_converter.setup.interface }} state: "{{ 'restarted' if deployDownload.changed or serviceFile.changed else 'started' }}" + register: service when: "wireguard_ipv6_converter.setup.interface in ansible_interfaces" + +- name: Pause for 5s to wait for program to have run + ansible.builtin.pause: + seconds: 5 + when: "service.changed" + +- name: Gather facts to get changes + ansible.builtin.gather_facts: + when: "service.changed"