Open Sergong opened 1 year ago
Confirming this issue.
We just stumbled upon this when trying to enable the Remote Event Log Management
group. Ad-hoc module execution, as well as using the module in a playbook task yielded changed=false
on both target systems.
When trying the same with name: Remote Event Log Management (RPC)
(a single rule of this group), the module behaved as expected, enabling the rule on the first run, correctly reporting changed=true
and on second run it correctly identified as the desired state already being present with changed=false
.
Target systems were freshly installed Windows Server 2022, Ansible controller system is Ubuntu 20.04.
FWIW, here is a workaround:
group: "@FirewallAPI.dll,-28752"
…selects the remote desktop group.
I found this out by checking the output of (New-Object -ComObject HNetCfg.FwPolicy2).Rules
in powershell.
@spectras what to say... THANKS A LOT!
SUMMARY
When using the win_firewall_rule module as follows:
against a Windows Server 2022 host, I get the following output:
but none of the firewall rules are enabled.
Same is true when run in adhoc mode as follows:
ISSUE TYPE
COMPONENT NAME
win_firewall_rule
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Host OS: Windows Server 2022 Standard Edition Ansible Controller OS: Fedora 37
STEPS TO REPRODUCE
Run the following adhoc command:
EXPECTED RESULTS
I expect Change: True when running the command against a Windows Server 2022 where the group rules are not enabled
ACTUAL RESULTS
The actual result is as described above, the command outputs Changed: false but the rules in the group are not enabled