File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
lib/ansible/modules/windows Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1+ minor_changes :
2+ - windows setup - Added ``ansible_os_installation_type`` to denote the type of Windows installation the remote host is.
Original file line number Diff line number Diff line change @@ -207,13 +207,21 @@ if($gather_subset.Contains('distribution')) {
207207 default { " unknown" }
208208 }
209209
210+ $installation_type = $null
211+ $current_version_path = " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
212+ if (Test-Path - LiteralPath $current_version_path ) {
213+ $install_type_prop = Get-ItemProperty - LiteralPath $current_version_path - ErrorAction SilentlyContinue
214+ $installation_type = [String ]$install_type_prop.InstallationType
215+ }
216+
210217 $ansible_facts += @ {
211218 ansible_distribution = $win32_os.Caption
212219 ansible_distribution_version = $osversion.Version.ToString ()
213220 ansible_distribution_major_version = $osversion.Version.Major.ToString ()
214221 ansible_os_family = " Windows"
215222 ansible_os_name = ($win32_os.Name.Split (' |' )[0 ]).Trim()
216223 ansible_os_product_type = $product_type
224+ ansible_os_installation_type = $installation_type
217225 }
218226}
219227
You can’t perform that action at this time.
0 commit comments