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 <wilfriedroset@users.noreply.github.com>
This commit is contained in:
Wilfried Roset 2021-11-09 21:28:44 +01:00
parent f74de4a831
commit 271031c21b
No known key found for this signature in database
GPG Key ID: 60E3203B4CBA1AEB

View File

@ -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'