From d0b7829a957d4a38117709c613bd37345d824144 Mon Sep 17 00:00:00 2001 From: binary Date: Mon, 21 Dec 2020 17:38:09 +0100 Subject: Add failsafe for os init scripts import --- roles/rc/tasks/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/rc/tasks/main.yml b/roles/rc/tasks/main.yml index 8ba98aa..1a8a921 100644 --- a/roles/rc/tasks/main.yml +++ b/roles/rc/tasks/main.yml @@ -3,8 +3,13 @@ --- +- name: stat existence of distribution rc-template + stat: path="{{ role_path }}/templates/rc_{{ os_distribution }}.yml" + register: rc_stat + - name: include rc task per-system include_tasks: "rc_{{ os_distribution }}.yml" + when: rc_stat.stat.exists - name: start and enable service on boot service: -- cgit v1.2.3