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
This commit is contained in:
Cédric Jeanneret 2019-07-08 17:00:52 +02:00
parent e289119ba1
commit 71b73d6406
1 changed files with 1 additions and 1 deletions

View File

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