-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnettimelegacy.sls
126 lines (102 loc) · 3.44 KB
/
nettimelegacy.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
#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\\Wow6432Node\\Subjective Software\\NetTime\\AlwaysProvideTime':
reg.present:
- value: 0
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\AutomaticUpdateChecks':
reg.present:
- value: 0
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\DaysBetweenUpdateChecks':
reg.present:
- value: 7
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\DemoteOnErrorCount':
reg.present:
- value: 4
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\Hostname':
reg.present:
- value: pool.ntp.org
- vtype: REG_SZ
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\LargeAdjustmentAction':
reg.present:
- value: 0
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\LargeAdjustmentThreshold':
reg.present:
- value: 2
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\LargeAdjustmentThresholdUnits':
reg.present:
- value: 2
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\LogLevel':
reg.present:
- value: 1
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\LostSync':
reg.present:
- value: 24
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\LostSyncUnits':
reg.present:
- value: 3
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\Port':
reg.present:
- value: 123
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\Protocol':
reg.present:
- value: 0
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\Retry':
reg.present:
- value: 1
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\RetryUnits':
reg.present:
- value: 2
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\Server':
reg.present:
- value: 0
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\SyncFreq':
reg.present:
- value: 15
- vtype: REG_DWORD
'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Subjective Software\\NetTime\\SyncFreqUnits':
reg.present:
- value: 2
- vtype: REG_DWORD
add_missing_reg:
cmd.run:
- name: New-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Subjective Software\NetTime' -Name "Protocol" -Value 0 -PropertyType "DWord"
- shell: powershell
- require:
- cmd: install_nettime
restart_nettime_svc:
cmd.run:
- name: Restart-Service "nettime"
- shell: powershell
- require:
- cmd: install_nettime