Skip to content

Commit ee425da

Browse files
committed
drop support for old Windows Servers versions (< 2016)
1 parent 55ef27c commit ee425da

File tree

6 files changed

+30
-221
lines changed

6 files changed

+30
-221
lines changed

README.md

-26
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Requirements
1111
This cookbook requires Chef 12.1+.
1212

1313
### Platforms
14-
* Windows Server 2008 (R1, R2)
15-
* Windows Server 2012 (R1, R2)
1614
* Windows Server 2016
1715
* Windows Server 2019
1816

@@ -196,28 +194,6 @@ source | Source of the windows package | String | *depen
196194
checksum | Checksum of the windows package | String | *depends of the architecture*
197195
options | Options to use when installing the windows package | String | `/q`
198196

199-
## wsus-server::report_viewer
200-
Install reporting viewer 2012 to enable wsus reports.
201-
202-
### Attributes
203-
Attributes to configure Reportviewer prerequisite package are accessible via `node['wsus_server']['report_viewer']['prerequisite']`.
204-
205-
Attribute | Description | Type | Default
206-
----------|----------------------------------------------------|--------|--------
207-
name | Name of the windows package | String | `Microsoft System CLR Types for SQL Server 2012 (x64)`
208-
source | Source of the windows package | String | [https://download.microsoft.com/.../SQLSysClrTypes.msi][sql_clr_types]
209-
checksum | Checksum of the windows package | String | `674c396e9c9bf389dd21c...c570fa927b07fa620db7d4537`
210-
options | Options to use when installing the windows package | String | `/q`
211-
212-
Attributes to configure Reportviewer runtime package are accessible via `node['wsus_server']['report_viewer']['runtime']`.
213-
214-
Attribute | Description | Type | Default
215-
----------|----------------------------------------------------|--------|--------
216-
name | Name of the windows package | String | `Microsoft Report Viewer 2012 Runtime`
217-
source | Source of the windows package | String | [https://download.microsoft.com/.../ReportViewer.exe][report_viewer]
218-
checksum | Checksum of the windows package | String | `948f28452abddd90b27dc...d42254c71b5b1e19ac5c6daf`
219-
options | Options to use when installing the windows package | String | `/q`
220-
221197
## wsus-server::synchronize
222198
This recipe performs a synchronous update of the update catalog, according to the configured subscriptions.
223199

@@ -269,8 +245,6 @@ limitations under the License.
269245
[subscription]: http://msdn.microsoft.com/library/microsoft.updateservices.administration.isubscription
270246
[subscription_members]: http://msdn.microsoft.com/library/microsoft.updateservices.administration.isubscription_members
271247
[frontend_server]: http://technet.microsoft.com/library/dd939896
272-
[report_viewer]: https://download.microsoft.com/download/F/B/7/FB728406-A1EE-4AB5-9C56-74EB8BDDF2FF/ReportViewer.msi
273-
[sql_clr_types]: https://download.microsoft.com/download/F/E/D/FEDB200F-DE2A-46D8-B661-D019DFE9D470/ENU/x64/SQLSysClrTypes.msi
274248
[build_status]: https://api.travis-ci.org/criteo-cookbooks/wsus-server.svg?branch=master
275249
[cookbook_version]: https://img.shields.io/cookbook/v/wsus-server.svg
276250
[cookbook]: https://supermarket.chef.io/cookbooks/wsus-server

attributes/install.rb

-26
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,3 @@
3131
default['wsus_server']['setup']['content_dir'] = nil
3232
# Defines the local or remote SQL instance used for WSUS configuration database.
3333
default['wsus_server']['setup']['sqlinstance_name'] = nil
34-
35-
# Following attributes are not required anymore on Windows Server 2012 and later
36-
if node['platform_version'].to_f < 6.2
37-
# Enables the inventory feature.
38-
default['wsus_server']['setup']['enable_inventory'] = false
39-
# Determines whether WSUS should be setup as an additional frontend server.
40-
# Frontend server shares the configuration of the main server, using the value of above attribute sqlinstance_name.
41-
# see http://technet.microsoft.com/en-us/library/dd939896.aspx
42-
default['wsus_server']['setup']['frontend_setup'] = false
43-
# Joins the Microsoft Update Improvement Program.
44-
default['wsus_server']['setup']['join_improvement_program'] = false
45-
# Determines whether WSUS should be set as default website - port 80 - or not - port 8530.
46-
default['wsus_server']['setup']['use_default_website'] = false
47-
# Defines path to windows internal database data directory.
48-
default['wsus_server']['setup']['wyukon_data_dir'] = nil
49-
50-
default['wsus_server']['package']['name'] = 'Windows Server Update Services 3.0 SP2'
51-
default['wsus_server']['package']['options'] = '/q'
52-
if node['kernel']['machine'] == 'x86_64'
53-
default['wsus_server']['package']['source'] = 'http://download.microsoft.com/download/B/0/6/B06A69C3-CF97-42CF-86BF-3C59D762E0B2/WSUS30-KB972455-x64.exe'
54-
default['wsus_server']['package']['checksum'] = '50d027431d64c35ad62291825eed35d7ffd3c3ecc96421588465445e195571d0'
55-
else
56-
default['wsus_server']['package']['source'] = 'http://download.microsoft.com/download/B/0/6/B06A69C3-CF97-42CF-86BF-3C59D762E0B2/WSUS30-KB972455-x86.exe'
57-
default['wsus_server']['package']['checksum'] = 'bec8bdd6cdad1edd50cc43e6121b73188b31ba4ad08e55b49f4287923a7f3290'
58-
end
59-
end

attributes/report_viewer.rb

-31
This file was deleted.

recipes/install.rb

+30-88
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@
2323
setup_conf = node['wsus_server']['setup']
2424

2525
setup_options = ''
26-
if setup_conf['sqlinstance_name']
27-
setup_options << if node['platform_version'].to_f >= 6.2
28-
" SQL_INSTANCE_NAME=\"#{setup_conf['sqlinstance_name']}\""
29-
else
30-
" SQLINSTANCE_NAME=\"#{setup_conf['sqlinstance_name']}\""
31-
end
32-
end
26+
setup_options << " SQL_INSTANCE_NAME=\"#{setup_conf['sqlinstance_name']}\"" if setup_conf['sqlinstance_name']
3327

3428
if setup_conf['content_dir']
3529
setup_options << " CONTENT_LOCAL=1 CONTENT_DIR=\"#{setup_conf['content_dir']}\""
@@ -39,94 +33,42 @@
3933
end
4034
end
4135

42-
require 'chef/win32/version'
43-
if node['platform_version'].to_f >= 6.2
44-
[
45-
'NET-WCF-HTTP-Activation45', # This feature is required for KB3159706
46-
'UpdateServices',
47-
'UpdateServices-UI',
48-
].each do |feature_name|
49-
windows_feature feature_name do
50-
action :install
51-
install_method :windows_feature_powershell if respond_to? :install_method
52-
provider :windows_feature_powershell unless respond_to? :install_method
53-
end
54-
end
55-
56-
windows_feature 'UpdateServices-WidDB' do
57-
action setup_conf['sqlinstance_name'] ? :remove : :install
58-
all true
59-
install_method :windows_feature_powershell if respond_to? :install_method
60-
provider :windows_feature_powershell unless respond_to? :install_method
61-
end
62-
63-
windows_feature 'UpdateServices-DB' do
64-
action setup_conf['sqlinstance_name'] ? :install : :remove
65-
all true
36+
[
37+
'NET-WCF-HTTP-Activation45', # This feature is required for KB3159706
38+
'UpdateServices',
39+
'UpdateServices-UI',
40+
].each do |feature_name|
41+
windows_feature feature_name do
42+
action :install
6643
install_method :windows_feature_powershell if respond_to? :install_method
6744
provider :windows_feature_powershell unless respond_to? :install_method
6845
end
46+
end
6947

70-
guard_file = ::File.join(Chef::Config['file_cache_path'], 'wsus_postinstall')
71-
execute 'WSUS PostInstall' do
72-
command "WsusUtil.exe PostInstall #{setup_options}"
73-
cwd 'C:\Program Files\Update Services\Tools'
74-
not_if { ::File.exist?(guard_file) && ::File.read(guard_file) == setup_options }
75-
end
76-
77-
file guard_file do
78-
path guard_file
79-
content setup_options
80-
end
81-
else
82-
setup_options << ' ENABLE_INVENTORY=' + (setup_conf['enable_inventory'] ? '1' : '0')
83-
setup_options << ' MU_ROLLUP=' + (setup_conf['join_improvement_program'] ? '1' : '0')
84-
setup_options << ' DEFAULT_WEBSITE=' + (setup_conf['use_default_website'] ? '1' : '0')
85-
setup_options << ' FRONTEND_SETUP=1 CREATE_DATABASE=0' if setup_conf['frontend_setup']
86-
87-
if setup_conf['wyukon_data_dir']
88-
setup_options << " WYUKON_DATA_DIR=\"#{setup_conf['wyukon_data_dir']}\""
89-
directory setup_conf['wyukon_data_dir'] { recursive true }
90-
end
91-
92-
# WSUS 3.0 SP2 requires some IIS features: http://technet.microsoft.com/en-us/library/dd939916.aspx
93-
features = %w(
94-
IIS-WebServerRole
95-
IIS-WebServer
96-
IIS-ApplicationDevelopment
97-
IIS-ISAPIFilter
98-
IIS-ISAPIExtensions
99-
IIS-NetFxExtensibility
100-
IIS-ASPNET
101-
IIS-WindowsAuthentication
102-
IIS-HttpCompressionDynamic
103-
IIS-IIS6ManagementCompatibility
104-
IIS-WMICompatibility
105-
IIS-Metabase
106-
IIS-LegacyScripts
107-
)
108-
109-
# IIS 6 SnapIn is not compatible with core version
110-
features << 'IIS-LegacySnapIn' unless Chef::ReservedNames::Win32::Version.new.core?
111-
features.each do |feature_name|
112-
windows_feature feature_name do
113-
action :install
114-
install_method :windows_feature_powershell if respond_to? :install_method
115-
provider :windows_feature_powershell unless respond_to? :install_method
116-
end
117-
end
48+
windows_feature 'UpdateServices-WidDB' do
49+
action setup_conf['sqlinstance_name'] ? :remove : :install
50+
all true
51+
install_method :windows_feature_powershell if respond_to? :install_method
52+
provider :windows_feature_powershell unless respond_to? :install_method
53+
end
11854

119-
include_recipe 'wsus-server::report_viewer'
55+
windows_feature 'UpdateServices-DB' do
56+
action setup_conf['sqlinstance_name'] ? :install : :remove
57+
all true
58+
install_method :windows_feature_powershell if respond_to? :install_method
59+
provider :windows_feature_powershell unless respond_to? :install_method
60+
end
12061

121-
package_info = node['wsus_server']['package']
62+
guard_file = ::File.join(Chef::Config['file_cache_path'], 'wsus_postinstall')
63+
execute 'WSUS PostInstall' do
64+
command "WsusUtil.exe PostInstall #{setup_options}"
65+
cwd 'C:\Program Files\Update Services\Tools'
66+
not_if { ::File.exist?(guard_file) && ::File.read(guard_file) == setup_options }
67+
end
12268

123-
windows_package package_info['name'] do
124-
action :install
125-
installer_type :custom
126-
options "#{package_info['options']} #{setup_options}"
127-
source package_info['source']
128-
checksum package_info['checksum']
129-
end
69+
file guard_file do
70+
path guard_file
71+
content setup_options
13072
end
13173

13274
# Wsus does not need configuration when setup as frontend server

recipes/report_viewer.rb

-33
This file was deleted.

spec/recipes/report_viewer_spec.rb

-17
This file was deleted.

0 commit comments

Comments
 (0)