blob: 2f6084dbec9d349328575e8742d0a2cc9c6e224b [file] [log] [blame]
Filip Pytloun10e4d6c2015-10-06 16:28:32 +02001{% from "ntp/map.jinja" import client with context %}
2
3{%- if client.enabled %}
4
5{%- if grains.os_family == 'Arch' %}
6
7ntp_remove_packages:
8 pkg.removed:
9 - names:
10 - openntpd
11 - require_in:
12 - pkg: ntp_packages
13
14{%- endif %}
15
16ntp_packages:
17 pkg.installed:
18 - name: ntp
19
20{%- if grains.os_family == "RedHat" %}
21
22ntp_client_group_and_user:
23 group.present:
24 - name: ntp
25 - require:
26 - pkg: ntp_packages
27 user.present:
28 - name: ntp
29 - shell: /sbin/nologin
30 - home: /etc/ntp
31 - groups:
32 - ntp
33 - require:
34 - group: ntp
35 - require_in:
36 - file: /etc/ntp.conf
37
38{%- endif %}
39
40/etc/ntp.conf:
41 file.managed:
42 - source: salt://ntp/files/ntp.conf
43 - template: jinja
44 - require:
45 - pkg: ntp_packages
46
47ntp_service:
48 service.running:
49 - enable: true
50 - name: {{ client.service }}
51 - watch:
52 - file: /etc/ntp.conf
53
54{%- endif %}