-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnettime.sls
155 lines (132 loc) · 3.46 KB
/
nettime.sls
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#Salt state to stop and disable MS W32Time Sync as well as install and configure nettime ntp client
#Written by Rich Staats last updated Aug 26 2015
Disable_W32Time:
cmd.run:
- name: "Set-Service w32time -StartupType disabled"
- shell: powershell
Stop_W32Time:
cmd.run:
- name: "Stop-Service w32time"
- shell: powershell
C:\\nettime.exe:
file.managed:
- source: salt://files/win/nettime.exe
install_nettime:
cmd.run:
- name: "C:\\nettime.exe /verysilent"
- require:
- file: C:\\nettime.exe
'HKEY_LOCAL_MACHINE\Software\NetTime\AlwaysProvideTime':
reg.present:
- vname: AlwaysProvideTime
- vdata: 0
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\AutomaticUpdateChecks':
reg.present:
- vname: AutomaticUpdateChecks
- vdata: 0
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\DaysBetweenUpdateChecks':
reg.present:
- vname: DaysBetweenUpdatedChecks
- vdata: 7
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\DemoteOnErrorCount':
reg.present:
- vname: DemoteOnErrorCount
- vdata: 4
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\Hostname':
reg.present:
- vname: Hostname
- vdata: pool.ntp.org
- vtype: REG_SZ
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\LargeAdjustmentAction':
reg.present:
- vname: LargeAdjustmentAction
- vdata: 0
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\LargeAdjustmentThreshold':
reg.present:
- vname: LargeAdjustmentThreshold
- vdata: 2
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\LargeAdjustmentThresholdUnits':
reg.present:
- vname: LargeAdjustmentThresholdUnits
- vdata: 2
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\LogLevel':
reg.present:
- vname: LogLevel
- vdata: 1
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\LostSync':
reg.present:
- vname: LostSync
- vdata: 24
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\LostSyncUnits':
reg.present:
- vname: LostSyncUnits
- vdata: 3
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\Port':
reg.present:
- vname: Port
- vdata: 7b
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\Protocol':
reg.present:
- vname: Protocol
- vdata: 0
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\Retry':
reg.present:
- vname: Retry
- vdata: 1
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\RetryUnits':
reg.present:
- vname: RetryUnits
- vdata: 2
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\Server':
reg.present:
- vname: Server
- vdata: 0
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\SyncFreq':
reg.present:
- vname: SyncFreq
- vdata: 15
- vtype: REG_DWORD
- reflection: True
'HKEY_LOCAL_MACHINE\Software\NetTime\SyncFreqUnits':
reg.present:
- vname: SyncFreqUnits
- vdata: 2
- vtype: REG_DWORD
- reflection: True
start_nettime_svc:
cmd.run:
- name: Start-Service "nettime"
- shell: powershell
- require:
- cmd: install_nettime