Skip to content

Commit

Permalink
Merge pull request #30 from sroegner/master
Browse files Browse the repository at this point in the history
fix for #28: move config file watch, remove service check from ntp state
  • Loading branch information
aboe76 authored Feb 15, 2019
2 parents 3835652 + 2ffa427 commit d9ddfa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 2 additions & 10 deletions ntp/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,13 @@ ntp:
{% set ntp_conf_src = salt['pillar.get']('ntp:ntp_conf', 'salt://ntp/ntp.conf') -%}
{% if ntp_conf_src %}
{%- if ntp_conf_src %}
ntp_conf:
file.managed:
- name: {{ ntp.ntp_conf }}
- template: jinja
- 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 -%}
10 changes: 8 additions & 2 deletions ntp/server.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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 %}

0 comments on commit d9ddfa3

Please sign in to comment.