From 71b73d6406af8020f8202a6b2cd6431eb3e2915f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Mon, 8 Jul 2019 17:00:52 +0200 Subject: [PATCH] Avoid hard-coded value in a generic ansible role The service will be enabled if and only if its state is set to "running" or "started". This change addresses comment in this change: https://review.opendev.org/#/c/669365/1/tasks/config.yml@14 Change-Id: Ic25772c04047bcd3aaa3e8abc5b947feb66bcbbb --- tasks/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/config.yml b/tasks/config.yml index 6f05d39..4de5f89 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -11,7 +11,7 @@ - name: Ensure chronyd is running service: - enabled: yes + enabled: "{{ (chrony_service_state|default('started') in ['running', 'started']) |bool }}" name: "{{ chrony_service_name }}" state: "{{ chrony_service_state|default('started') }}" when: chrony_manage_service|bool