Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule 1.2.4 error in run order #49

Open
animatco opened this issue Aug 26, 2024 · 11 comments
Open

Rule 1.2.4 error in run order #49

animatco opened this issue Aug 26, 2024 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@animatco
Copy link

Describe the Issue
If in the defaults/main.yml file the the rule 1.2.1 is not moved below 1.2.4 the code errors out.

Expected Behavior
1.2.4 should run before 1.2.1

Actual Behavior
1.2.1 is running before 1.2.4

Control(s) Affected
rule 1.2.4

Environment (please complete the following information):

branch being used: devel
Ansible Version: 2.16.3
Host Python Version: 3.12.3
Ansible Server Python Version: 3.12.3
Additional Details:

Additional Notes
Anything additional goes here

Possible Solution
change run order.

@animatco animatco added the bug Something isn't working label Aug 26, 2024
@MrSteve81 MrSteve81 self-assigned this Dec 3, 2024
@MrSteve81
Copy link
Contributor

MrSteve81 commented Dec 3, 2024

Good Day @animatco Sorry to get to this so late but Im wondering if you are running in a cloud environment or a local system? I believe we have resolved this already and maybe the system type is not being picked up. The order of the tasks are setup in the section1.yml and are calling in the correct order depending on the type of system ansible finds. The default main should not control that.

@animatco
Copy link
Author

animatco commented Dec 4, 2024

No this was on a On-Prem vSphere VM

@MrSteve81
Copy link
Contributor

MrSteve81 commented Dec 5, 2024

Hmmmm ok I will see if i can replicate this. We dont have vSphere internal but I believe it may be having issues figuring out if its a hyper-v and running it the non hyper v way this is where it checks for that. I wonder if vpshere logs the type differently. So in your case it is running the cloud based hardening not the normal one.

Which means below the instance is registering the when statement when your running it.
I do not have a copy of vsphere to test against but would it be possible to get the ansible facts for that copy of windows and send them to me to see if i can find another method to filter out vsphere.
the ansible should register it as this
['virtualization_type'] = 'VMware'

but it seems it is not.

of course feel free to remove anything that is private info
you can reach me on the discord @MrSteve

HVM is Amazon AMI's, Hyper-V is Azure's, KVM is used for ('QEMU', 'Amazon EC2', 'DigitalOcean', 'Google', 'Scaleway', 'Nutanix', 'KVM', 'KVM Server', 'Bochs', 'AHV')
Current list is elastic and will be updated as we test more cloud based services.
Current testing is working in Azure using Hyper-V. We are currently using this for reference:
https://github.com/ansible/ansible/blob/905131fc76a07cf89dbc8d33e7a4910da3f10a16/lib/ansible/module_utils/facts/virtual/linux.py#L205

  • name: PRELIM | Set fact if cloud-based system.
    ansible.builtin.set_fact:
    prelim_win22cis_cloud_based_system: true
    when:
    - ansible_system_vendor == 'Microsoft Corporation'
    - ansible_virtualization_type == 'Hyper-V' or
    ansible_virtualization_type == 'hvm' or
    ansible_virtualization_type == 'kvm'
    tags:
    - always

@animatco
Copy link
Author

as in the 2019
gather_facts for vSphere for 2019, 2022 and 2025
LWTST2025 | SUCCESS => {
"ansible_facts": {
"ansible_architecture": "64-bit",
"ansible_architecture2": "x86_64",
"ansible_bios_date": "06/25/2021",
"ansible_bios_version": "VMW71.00V.18227214.B64.2106252220",
"ansible_date_time": {
"date": "2024-12-26",
"day": "26",
"epoch": "1735227232.27351",
"epoch_int": 1735227232,
"epoch_local": "1735205632.27351",
"hour": "09",
"iso8601": "2024-12-26T15:33:52Z",
"iso8601_basic": "20241226T093352273506",
"iso8601_basic_short": "20241226T093352",
"iso8601_micro": "2024-12-26T15:33:52.273506Z",
"minute": "33",
"month": "12",
"second": "52",
"time": "09:33:52",
"tz": "Central Standard Time",
"tz_offset": "-06:00",
"weekday": "Thursday",
"weekday_number": "4",
"weeknumber": "51",
"year": "2024"
},
"ansible_distribution": "Microsoft Windows Server 2025 Standard",
"ansible_distribution_major_version": "10",
"ansible_distribution_version": "10.0.26334.0",
"ansible_domain": "Akuna.Mhata.org",
"ansible_env": {
"ALLUSERSPROFILE": "C:\ProgramData",
"APPDATA": "C:\Users\KING\AppData\Roaming",
"COMPUTERNAME": "LWTST2025",
"ComSpec": "C:\WINDOWS\system32\cmd.exe",
"CommonProgramFiles": "C:\Program Files\Common Files",
"CommonProgramFiles(x86)": "C:\Program Files (x86)\Common Files",
"CommonProgramW6432": "C:\Program Files\Common Files",
"DriverData": "C:\Windows\System32\Drivers\DriverData",
"LOCALAPPDATA": "C:\Users\KING\AppData\Local",
"NUMBER_OF_PROCESSORS": "4",
"OS": "Windows_NT",
"PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL",
"PROCESSOR_ARCHITECTURE": "AMD64",
"PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 63 Stepping 0, GenuineIntel",
"PROCESSOR_LEVEL": "6",
"PROCESSOR_REVISION": "3f00",
"PROMPT": "$P$G",
"PSExecutionPolicyPreference": "Unrestricted",
"PSModulePath": "C:\Users\KING\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules",
"PUBLIC": "C:\Users\Public",
"Path": "C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\WindowsPowerShell\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\KING\AppData\Local\Microsoft\WindowsApps",
"ProgramData": "C:\ProgramData",
"ProgramFiles": "C:\Program Files",
"ProgramFiles(x86)": "C:\Program Files (x86)",
"ProgramW6432": "C:\Program Files",
"SystemDrive": "C:",
"SystemRoot": "C:\WINDOWS",
"TEMP": "C:\Users\KING\AppData\Local\Temp",
"TMP": "C:\Users\KING\AppData\Local\Temp",
"USERDOMAIN": "LWTST2025",
"USERNAME": "KING",
"USERPROFILE": "C:\Users\KING",
"windir": "C:\WINDOWS"
},
"ansible_fqdn": "LWTST2025.Akuna.Mhata.org",
"ansible_hostname": "LWTST2025",
"ansible_interfaces": [
{
"connection_name": "Ethernet0",
"default_gateway": "192.168.1.1",
"dns_domain": "Akuna.Mhata.org",
"interface_index": 5,
"interface_name": "vmxnet3 Ethernet Adapter",
"ipv4": {
"address": "192.168.1.252",
"prefix": "22"
},
"ipv6": {
"address": "fe80::d51e:6f47:5aed:b663%5",
"prefix": "64"
},
"macaddress": "00:50:56:A5:7A:01",
"mtu": 1500,
"speed": 10000
}
],
"ansible_ip_addresses": [
"fe80::d51e:6f47:5aed:b663%5",
"192.168.1.252"
],
"ansible_kernel": "10.0.26334.0",
"ansible_lastboot": "2024-12-09 03:12:00Z",
"ansible_machine_id": "S-1-5-21-1756165062-2337078823-3160586835",
"ansible_memfree_mb": 11384,
"ansible_memtotal_mb": 16384,
"ansible_netbios_name": "LWTST2025",
"ansible_nodename": "LWTST2025.Akuna.Mhata.org",
"ansible_os_family": "Windows",
"ansible_os_installation_type": "Server",
"ansible_os_name": "Microsoft Windows Server 2025 Standard",
"ansible_os_product_type": "server",
"ansible_owner_contact": "",
"ansible_owner_name": "Administrator",
"ansible_pagefilefree_mb": 2145,
"ansible_pagefiletotal_mb": 2432,
"ansible_powershell_version": 5,
"ansible_processor": [
"0",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6242R CPU @ 3.10GHz",
"1",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6242R CPU @ 3.10GHz",
"2",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6242R CPU @ 3.10GHz",
"3",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6242R CPU @ 3.10GHz"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 4,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 4,
"ansible_product_name": "VMware7,1",
"ansible_product_serial": "VMware-42 25 b3 38 8e 5a 34 82-a1 51 aa a6 ee eb e5 fd",
"ansible_reboot_pending": true,
"ansible_swaptotal_mb": 0,
"ansible_system": "Win32NT",
"ansible_system_description": "",
"ansible_system_vendor": "VMware, Inc.",
"ansible_uptime_seconds": 1491713,
"ansible_user_dir": "C:\Users\KING",
"ansible_user_gecos": "",
"ansible_user_id": "KING",
"ansible_user_sid": "S-1-5-21-1756165062-2337078823-3160586835-1000",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "VMware",
"ansible_win_rm_certificate_expires": "2025-07-07 12:41:16",
"ansible_win_rm_certificate_thumbprint": "57521A54FF86C2449C26C8024480A6C2DBAEB9CD",
"ansible_windows_domain": "Akuna.Mhata.org",
"ansible_windows_domain_member": true,
"ansible_windows_domain_role": "Member server",
"gather_subset": [
"all"
],
"module_setup": true
},
"changed": false
}
lwtst2019 | SUCCESS => {
"ansible_facts": {
"ansible_architecture": "64-bit",
"ansible_architecture2": "x86_64",
"ansible_bios_date": "01/11/2023",
"ansible_bios_version": "VMW71.00V.21100432.B64.2301110304",
"ansible_date_time": {
"date": "2024-12-26",
"day": "26",
"epoch": "1735227232.44505",
"epoch_int": 1735227232,
"epoch_local": "1735209232.44505",
"hour": "10",
"iso8601": "2024-12-26T15:33:52Z",
"iso8601_basic": "20241226T103352445045",
"iso8601_basic_short": "20241226T103352",
"iso8601_micro": "2024-12-26T15:33:52.445045Z",
"minute": "33",
"month": "12",
"second": "52",
"time": "10:33:52",
"tz": "Eastern Standard Time",
"tz_offset": "-05:00",
"weekday": "Thursday",
"weekday_number": "4",
"weeknumber": "51",
"year": "2024"
},
"ansible_distribution": "Microsoft Windows Server 2019 Standard",
"ansible_distribution_major_version": "10",
"ansible_distribution_version": "10.0.17763.0",
"ansible_domain": "Akuna.Mhata.org",
"ansible_env": {
"ALLUSERSPROFILE": "C:\ProgramData",
"APPDATA": "C:\Users\KING\AppData\Roaming",
"COMPUTERNAME": "lwtst2019",
"ComSpec": "C:\Windows\system32\cmd.exe",
"CommonProgramFiles": "C:\Program Files\Common Files",
"CommonProgramFiles(x86)": "C:\Program Files (x86)\Common Files",
"CommonProgramW6432": "C:\Program Files\Common Files",
"DriverData": "C:\Windows\System32\Drivers\DriverData",
"LOCALAPPDATA": "C:\Users\KING\AppData\Local",
"NUMBER_OF_PROCESSORS": "4",
"OS": "Windows_NT",
"PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL",
"POWERSHELL_DISTRIBUTION_CHANNEL": "MSI:Windows Server 2019 Standard",
"PROCESSOR_ARCHITECTURE": "AMD64",
"PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 85 Stepping 7, GenuineIntel",
"PROCESSOR_LEVEL": "6",
"PROCESSOR_REVISION": "5507",
"PROMPT": "$P$G",
"PSExecutionPolicyPreference": "Unrestricted",
"PSModulePath": "C:\Users\KING\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules",
"PUBLIC": "C:\Users\Public",
"Path": "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\PowerShell\7\;C:\Users\KING\AppData\Local\Microsoft\WindowsApps",
"ProgramData": "C:\ProgramData",
"ProgramFiles": "C:\Program Files",
"ProgramFiles(x86)": "C:\Program Files (x86)",
"ProgramW6432": "C:\Program Files",
"SystemDrive": "C:",
"SystemRoot": "C:\Windows",
"TEMP": "C:\Users\KING\AppData\Local\Temp",
"TMP": "C:\Users\KING\AppData\Local\Temp",
"USERDOMAIN": "lwtst2019",
"USERNAME": "KING",
"USERPROFILE": "C:\Users\KING",
"windir": "C:\Windows"
},
"ansible_fqdn": "lwtst2019.Akuna.Mhata.org",
"ansible_hostname": "lwtst2019",
"ansible_interfaces": [
{
"connection_name": "Ethernet0",
"default_gateway": "192.168.1.1",
"dns_domain": null,
"interface_index": 5,
"interface_name": "vmxnet3 Ethernet Adapter",
"ipv4": {
"address": "192.168.1.250",
"prefix": "22"
},
"ipv6": {},
"macaddress": "00:50:56:88:54:51",
"mtu": 1500,
"speed": 10000
}
],
"ansible_ip_addresses": [
"192.168.1.25022"
],
"ansible_kernel": "10.0.17763.0",
"ansible_lastboot": "2024-11-08 17:42:02Z",
"ansible_machine_id": "S-1-5-21-3292981187-2166132357-1355570727",
"ansible_memfree_mb": 3205,
"ansible_memtotal_mb": 8192,
"ansible_netbios_name": "lwtst2019",
"ansible_nodename": "lwtst2019.Akuna.Mhata.org",
"ansible_os_family": "Windows",
"ansible_os_installation_type": "Server",
"ansible_os_name": "Microsoft Windows Server 2019 Standard",
"ansible_os_product_type": "server",
"ansible_owner_contact": "",
"ansible_owner_name": "Administrator",
"ansible_pagefilefree_mb": 1129,
"ansible_pagefiletotal_mb": 1280,
"ansible_powershell_version": 5,
"ansible_processor": [
"0",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz",
"1",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz",
"2",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz",
"3",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 4,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 4,
"ansible_product_name": "VMware7,1",
"ansible_product_serial": "VMware-42 08 da ce 05 5a a8 9c-58 8d 0c 33 f7 78 d8 3e",
"ansible_reboot_pending": true,
"ansible_swaptotal_mb": 0,
"ansible_system": "Win32NT",
"ansible_system_description": "",
"ansible_system_vendor": "VMware, Inc.",
"ansible_uptime_seconds": 4121510,
"ansible_user_dir": "C:\Users\KING",
"ansible_user_gecos": "",
"ansible_user_id": "KING",
"ansible_user_sid": "S-1-5-21-3292981187-2166132357-1355570727-1000",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "VMware",
"ansible_win_rm_certificate_expires": "2025-06-12 10:27:41",
"ansible_win_rm_certificate_thumbprint": "3A63D1E9A61A002FBE858C66E5775BF981844091",
"ansible_windows_domain": "Akuna.Mhata.org",
"ansible_windows_domain_member": true,
"ansible_windows_domain_role": "Member server",
"gather_subset": [
"all"
],
"module_setup": true
},
"changed": false
}
LWTST2022 | SUCCESS => {
"ansible_facts": {
"ansible_architecture": "64-bit",
"ansible_architecture2": "x86_64",
"ansible_bios_date": "08/19/2024",
"ansible_bios_version": "VMW71.00V.24224532.B64.2408191458",
"ansible_date_time": {
"date": "2024-12-26",
"day": "26",
"epoch": "1735227232.31225",
"epoch_int": 1735227232,
"epoch_local": "1735205632.31225",
"hour": "09",
"iso8601": "2024-12-26T15:33:52Z",
"iso8601_basic": "20241226T093352312245",
"iso8601_basic_short": "20241226T093352",
"iso8601_micro": "2024-12-26T15:33:52.312245Z",
"minute": "33",
"month": "12",
"second": "52",
"time": "09:33:52",
"tz": "Central Standard Time",
"tz_offset": "-06:00",
"weekday": "Thursday",
"weekday_number": "4",
"weeknumber": "51",
"year": "2024"
},
"ansible_distribution": "Microsoft Windows Server 2022 Standard",
"ansible_distribution_major_version": "10",
"ansible_distribution_version": "10.0.20348.0",
"ansible_domain": "Akuna.Mhata.org",
"ansible_env": {
"ALLUSERSPROFILE": "C:\ProgramData",
"APPDATA": "C:\Users\KING\AppData\Roaming",
"COMPUTERNAME": "LWTST2022",
"ComSpec": "C:\Windows\system32\cmd.exe",
"CommonProgramFiles": "C:\Program Files\Common Files",
"CommonProgramFiles(x86)": "C:\Program Files (x86)\Common Files",
"CommonProgramW6432": "C:\Program Files\Common Files",
"DriverData": "C:\Windows\System32\Drivers\DriverData",
"LOCALAPPDATA": "C:\Users\KING\AppData\Local",
"NODE_PATH": "D:\Program Files\SQL Anywhere 17\Node",
"NUMBER_OF_PROCESSORS": "8",
"OPENSSL_CONF": "C:\OpenSSL-Win32\bin\openssl.cfg",
"OS": "Windows_NT",
"PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL",
"POWERSHELL_DISTRIBUTION_CHANNEL": "MSI:Windows Server 2022 Standard",
"PROCESSOR_ARCHITECTURE": "AMD64",
"PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 79 Stepping 0, GenuineIntel",
"PROCESSOR_LEVEL": "6",
"PROCESSOR_REVISION": "4f00",
"PROMPT": "$P$G",
"PSExecutionPolicyPreference": "Unrestricted",
"PSModulePath": "C:\Users\KING\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules",
"PUBLIC": "C:\Users\Public",
"Path": "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\avs\bin;C:\Program Files\avs\bin32;D:\SQL Anywhere 12\bin64;D:\SQL Anywhere 12\bin32;D:\Program Files\SQL Anywhere 17\bin64;D:\Program Files\SQL Anywhere 17\bin32;D:\PHP64;C:\Users\KING\AppData\Local\Microsoft\WindowsApps",
"ProgramData": "C:\ProgramData",
"ProgramFiles": "C:\Program Files",
"ProgramFiles(x86)": "C:\Program Files (x86)",
"ProgramW6432": "C:\Program Files",
"SQLANY12": "D:\SQL Anywhere 12",
"SQLANY17": "D:\Program Files\SQL Anywhere 17",
"SQLANYSAMP12": "C:\Users\Public\Documents\SQL Anywhere 12\Samples",
"SQLANYSAMP17": "C:\Users\Public\Documents\SQL Anywhere 17\Samples",
"SystemDrive": "C:",
"SystemRoot": "C:\Windows",
"TEMP": "C:\Users\KING\AppData\Local\Temp",
"TMP": "C:\Users\KING\AppData\Local\Temp",
"USERDOMAIN": "LWTST2022",
"USERNAME": "KING",
"USERPROFILE": "C:\Users\KING",
"windir": "C:\Windows"
},
"ansible_fqdn": "LWTST2022.Akuna.Mhata.org",
"ansible_hostname": "LWTST2022",
"ansible_interfaces": [
{
"connection_name": "Ethernet0",
"default_gateway": "192.168.1.1",
"dns_domain": null,
"interface_index": 5,
"interface_name": "vmxnet3 Ethernet Adapter",
"ipv4": {
"address": "192.168.1.240",
"prefix": "23"
},
"ipv6": {},
"macaddress": "00:50:56:A5:82:83",
"mtu": 1500,
"speed": 10000
}
],
"ansible_ip_addresses": [
"192.168.1.240"
],
"ansible_kernel": "10.0.20348.0",
"ansible_lastboot": "2024-12-04 12:29:31Z",
"ansible_machine_id": "S-1-5-21-4218475527-2441478060-1680159493",
"ansible_memfree_mb": 10599,
"ansible_memtotal_mb": 16384,
"ansible_netbios_name": "LWTST2022",
"ansible_nodename": "LWTST2022.Akuna.Mhata.org",
"ansible_os_family": "Windows",
"ansible_os_installation_type": "Server",
"ansible_os_name": "Microsoft Windows Server 2022 Standard",
"ansible_os_product_type": "server",
"ansible_owner_contact": "",
"ansible_owner_name": "Administrator",
"ansible_pagefilefree_mb": 2299,
"ansible_pagefiletotal_mb": 2432,
"ansible_powershell_version": 5,
"ansible_processor": [
"0",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz",
"1",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz",
"2",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz",
"3",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz",
"4",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz",
"5",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz",
"6",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz",
"7",
"GenuineIntel",
"Intel(R) Xeon(R) Gold 6246 CPU @ 3.30GHz"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 8,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 8,
"ansible_product_name": "VMware7,1",
"ansible_product_serial": "VMware-42 25 0e f6 e3 a2 55 73-f6 5b da ca 4f e5 38 8c",
"ansible_reboot_pending": true,
"ansible_swaptotal_mb": 0,
"ansible_system": "Win32NT",
"ansible_system_description": "",
"ansible_system_vendor": "VMware, Inc.",
"ansible_uptime_seconds": 1890262,
"ansible_user_dir": "C:\Users\KING",
"ansible_user_gecos": "",
"ansible_user_id": "KING",
"ansible_user_sid": "S-1-5-21-4218475527-2441478060-1680159493-1000",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "VMware",
"ansible_win_rm_certificate_expires": "2027-07-12 17:24:46",
"ansible_win_rm_certificate_thumbprint": "699494C4D734C908D52E9F85330BF0DF1EF4F3B9",
"ansible_windows_domain": "Akuna.Mhata.org",
"ansible_windows_domain_member": true,
"ansible_windows_domain_role": "Member server",
"gather_subset": [
"all"
],
"module_setup": true
},
"changed": false
}

@MrSteve81
Copy link
Contributor

MrSteve81 commented Dec 27, 2024

I have pushed the same updates I did for 2019 to here as well in the dec24_updates please try them and and let me know.
@animatco

@animatco
Copy link
Author

It probably won't be till the 6th or 7th that I can further test

@MrSteve81
Copy link
Contributor

No worries. Just wanted to get it done as fast as I could for you.

@animatco
Copy link
Author

animatco commented Jan 3, 2025

So we tested again on both a 2019 and 2022 Windows Server on vSphere. They failed at the 1.2.1 section, when we manually modified the prelim.

  • name: Set Fact If Cloud-Based System.
    ansible.builtin.set_fact:
    win22cis_cloud_based_system: true

to be:

  • name: Set Fact If Cloud-Based System.
    ansible.builtin.set_fact:
    win22cis_cloud_based_system: false

doing that allowed the code to continue.

@MrSteve81
Copy link
Contributor

MrSteve81 commented Jan 3, 2025

@animatco mind messaging me on discord so we can test in realtime..... also are you using the devel branch or the dec24_updates branch that has the fix.

Argh i found it it is setting it to run as cloud i missed a not in it
***** I have pushed the updates to both 2019 and 2022 dec24_updates *****

can you try the following and get back to me

  • name: PRELIM | Set Fact If Cloud-Based System.
    when:
    - not ansible_virtualization_type == 'VMware' or
    (ansible_system_vendor == 'Microsoft Corporation' and
    ansible_virtualization_type in ['Hyper-V', 'hvm', 'kvm'])
    tags: always
    ansible.builtin.set_fact:
    win19cis_cloud_based_system: true

    this should fix it

@animatco
Copy link
Author

animatco commented Jan 3, 2025

additional information from gather facts:
Azure:
"ansible_system_vendor": "Microsoft Corporation",
"ansible_virtualization_role": "guest",
"ansible_virtualization_tech_guest": [
"VirtualPC"
],
"ansible_virtualization_tech_host": [
"kvm"
],
"ansible_virtualization_type": "VirtualPC",

Google:
"ansible_system_vendor": "Google",
"ansible_virtualization_role": "guest",
"ansible_virtualization_tech_guest": [
"kvm"
],
"ansible_virtualization_tech_host": [],
"ansible_virtualization_type": "kvm",

vSphere:
"ansible_system_vendor": "VMware, Inc.",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "VMware",

Hyper-V:
"ansible_system_vendor": "Microsoft Corporation",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "Hyper-V",

@animatco
Copy link
Author

animatco commented Jan 6, 2025

Just to let you know the latest update resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@animatco @MrSteve81 and others