aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-12-21 17:38:09 +0100
committerbinary <me@rgoncalves.se>2020-12-21 17:38:09 +0100
commitd0b7829a957d4a38117709c613bd37345d824144 (patch)
tree7064046aee9f55bd9e26c7ec01583255659859a5
parent44355d99e5fa9316e8f537cb8a0a2bf9f1f1680e (diff)
downloadinfrastructure-d0b7829a957d4a38117709c613bd37345d824144.tar.gz
Add failsafe for os init scripts import
-rw-r--r--roles/rc/tasks/main.yml5
1 files changed, 5 insertions, 0 deletions
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:
remember that computers suck.