forked from saltstack-formulas/ntp-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pillar.example
48 lines (41 loc) · 1.24 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
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 %}