style(state): avoid complicated comparison

This commit is contained in:
Nicolas Rodriguez 2020-09-10 04:06:20 +02:00
parent 31d3d9b73b
commit 496f09b2e1
2 changed files with 2 additions and 1 deletions

View File

@ -4,3 +4,4 @@
cron: cron:
pkg: cronie pkg: cronie
service: cron service: cron
enabled: true

View File

@ -6,7 +6,7 @@
{%- from tplroot ~ "/map.jinja" import cron with context %} {%- from tplroot ~ "/map.jinja" import cron with context %}
cron.service: cron.service:
{%- if 'enabled' not in cron or ( 'enabled' in cron and cron.enabled ) %} {%- if cron.enabled %}
service.running: service.running:
- name: {{ cron.service }} - name: {{ cron.service }}
- enable: true - enable: true