forked from saltstack-formulas/ntp-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pillar.example
79 lines (71 loc) · 2.23 KB
/
pillar.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ntp:
lookup:
client: ntp
server: ntpd
service: ntpd
ntpdate: ntpdate
ntp_conf: /etc/ntp.conf
ntpd_conf: /etc/ntpd.conf
# Example for ntp
ntp:
ntp_conf: salt://ntp/ntp-client.conf
# Example for ntp.server
ntp:
ntpd_conf: salt://ntp/ntp.conf
# Example for ntp.local_server
# Note grains['environment'] is a custom grain in this example
# Your method of determining what environment a server is in will vary
ntp:
### Assign NTP Servers Based On Environment ###
# Internal NTP Servers Get Data From Outside #
{% if grains['id'].startswith('nameofyourntpserver') %}
ntpservers: ["0.us.pool.ntp.org","1.us.pool.ntp.org","2.us.pool.ntp.org","3.us.pool.ntp.org"]
comment: ''
# If This Is Production #
{% if grains['environment'] == 'production' %}
localnetworks: ["10.1.1.0", "10.1.2.0", "10.1.3.0"]
# If Not, Must Be Dev #
{% else %}
localnetworks: ["10.1.4.0","10.1.5.0","10.1.6.0"]
{% endif %}
# Otherwise This Is Just An Internal Box
{% else %}
comment: '#'
localnetworks: ["192.168.1.0"]
# Assign Local Box NTP Server Based On Environment
{% if grains['environment'] == 'production' %}
ntpservers: ["10.1.1.20","10.1.1.21"]
{% else %}
ntpservers: ["10.1.4.20"]
{% endif %}
{% endif %}
# NTP NG example
ntp:
# An arbitrary key to avoid clashes with the original configuration
ng:
# OS-specific data that should, in most cases, be handled by map.jinja.
# It is an optional key and is only used to override defaults.
lookup:
package: ntp
service: ntpd
provider: systemd
ntp_conf: /etc/ntp.conf
# State-specific options
settings:
# If `True`, ntpd will be enabled. Otherwise ntp.conf will be configured
# but ntpd will not be enabled or started.
ntpd: True
# A dictionary of lists, each key corresponds to a conf-file directive in
# ntp.conf. Eg, the below will compile to:
#
# server 0.us.pool.ntp.org
# server 1.us.pool.ntp.org
#
# restrict 127.0.0.1
# restrict ::1
#
# driftile: /var/lib/ntp/ntp.drift
ntp_conf:
server: ['0.us.pool.ntp.org', '1.us.pool.ntp.org']
restrict: ['127.0.0.1', '::1']
driftfile: ['/var/lib/ntp/ntp.drift']