diff --git a/ntp/init.sls b/ntp/init.sls index 814828a..99c50de 100644 --- a/ntp/init.sls +++ b/ntp/init.sls @@ -8,7 +8,7 @@ ntp: {% set ntp_conf_src = salt['pillar.get']('ntp:ntp_conf') -%} -{% if ntp_conf_src %} +{%- if ntp_conf_src %} ntp_conf: file.managed: - name: {{ ntp.ntp_conf }} @@ -16,13 +16,5 @@ ntp_conf: - source: {{ ntp_conf_src }} - require: - pkg: {{ ntp.client }} -{% endif %} +{%- endif %} -{% if ntp.ntp_conf -%} -ntp_running: - service.running: - - name: {{ ntp.service }} - - enable: True - - watch: - - file: {{ ntp.ntp_conf }} -{% endif -%} diff --git a/ntp/server.sls b/ntp/server.sls index 6b0b943..ff71046 100644 --- a/ntp/server.sls +++ b/ntp/server.sls @@ -3,6 +3,7 @@ include: - ntp +{% set ntp_conf_src = salt['pillar.get']('ntp:ntp_conf') -%} {% set ntpd_conf_src = salt['pillar.get']('ntp:ntpd_conf') -%} {% if ntpd_conf_src %} @@ -20,7 +21,12 @@ ntpd: - enable: True - require: - pkg: ntp -{% if ntpd_conf_src %} +{%- if ntpd_conf_src or ntp_conf_src %} - watch: +{%- if ntpd_conf_src %} - file: ntpd_conf -{% endif %} +{%- endif %} +{%- if ntp.ntp_conf %} + - file: ntp_conf_src +{%- endif %} +{%- endif %}