From 271031c21b96907ee574a4b3612c85f23c848937 Mon Sep 17 00:00:00 2001 From: Wilfried Roset Date: Tue, 9 Nov 2021 21:28:44 +0100 Subject: [PATCH] Enable service This commit makes sure that loki and/or promtail service are enabled. Doing so will allow users to safely reboot a host without needing to either apply the role or start the services manually. Signed-off-by: Wilfried Roset --- tasks/install.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/install.yml b/tasks/install.yml index 467c5c2..42c7684 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -83,3 +83,10 @@ notify: "restart {{ item }}" loop: "{{ loki_bins }}" when: item == 'loki' or item == 'promtail' + +- name: enable service + service: + name: "{{ item }}" + enabled: true + loop: "{{ loki_bins }}" + when: item == 'loki' or item == 'promtail'