Hi, some suggestions below…
Hi All,
Is there a way to use Ansible to fetch Windows OS specific configuration using Ansible on demand ?
run or re-run the ansible setup
module, which will gather lots of facts about your windows hosts.
Is there a way to fetch OS updates, Open Ports, Windows Running Services list?
win_updates module for OS updates.
You can use win_command or win_shell modules to run powershell to get a lot of this kind of information
get active network connections like this
ansible windows_hosts -m win_command -a ‘netstat -ano’
get running processes (visible to user you have connected as like this)
ansible windows_hosts -m win_shell -a “Get-Process”
get installed hotfixes like this:
ansible windows_hosts -m win_shell -a “Get-Hotfix”
Is there a way to monitor Windows Performance Counters for a duration of time ?
Not tried, but you could probably make use of these powershell functions to export performance data to graphite https://github.com/MattHodge/Graphite-PowerShell-Functions/tree/v1.1.0 - described here https://hodgkins.io/using-powershell-to-send-metrics-graphite
I’d recommend having a look at what you can do using powershell, at lot of useful administrative information is available via powershell, and its relatively easy to get at it using powershell.
If you need to process the raw results within ansible I’d recomend having a look at creating your own modules - once you have the powershell command to get the right information, its not much more work to turn it into an ansible module - you only really need to handle any module parameters and build up the information that it makes sense to return, and create a module documentation file.
Hope this helps,
Jon