|
140 | 140 | Optional[Variant[Stdlib::HTTPUrl,Boolean]] $server_url = undef, |
141 | 141 | Optional[Boolean] $enable_status_server = undef, |
142 | 142 | Optional[Boolean] $accept_trusted_publisher_certs = undef, |
143 | | - Optional[Variant[Enum['NotifyOnly', 'AutoNotify', 'Scheduled', 'AutoInstall'],Integer[2,5]]] $auto_update_option = undef, |
| 143 | + Optional[Variant[Enum['NotifyOnly', 'AutoNotify', 'Scheduled', 'AutoInstall', 'NotifyRestart'],Integer[2,5],Integer[7,7]]] |
| 144 | + $auto_update_option = undef, |
144 | 145 | Optional[Boolean] $auto_install_minor_updates = undef, |
145 | 146 | Optional[Variant[Integer[1,22],Boolean]] $detection_frequency_hours = undef, |
146 | 147 | Optional[Boolean] $disable_windows_update_access = undef, |
|
212 | 213 |
|
213 | 214 | if $auto_update_option { |
214 | 215 | $_parsed_auto_update_option = parse_auto_update_option($auto_update_option) |
| 216 | + |
| 217 | + # Option 7 is only supported on Windows Server 2016 and later. |
| 218 | + if $_parsed_auto_update_option == 7 { |
| 219 | + # Windows 2012's major version in facter is "2012 R2" which cannot be converted to integer directly. |
| 220 | + # So, extract the leading digits from the major release string. |
| 221 | + $_windows_version = regsubst($facts['os']['release']['major'], '^(\d+).*$', '\1') |
| 222 | + if (Integer($_windows_version) < 2016) { |
| 223 | + fail('auto_update_option value 7 is only supported on Windows Server 2016 and later.') |
| 224 | + } |
| 225 | + } |
215 | 226 | if $_parsed_auto_update_option == 4 and !($scheduled_install_day and $scheduled_install_hour) { |
216 | 227 | fail("scheduled_install_day and scheduled_install_hour required when specifying auto_update_option => '${auto_update_option}'") |
217 | 228 | } |
|
0 commit comments