mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
fix PS type conversion failure when using "all" profiles (#34383)
* obscure type promotion issue in some versions of Powershell causes [int]::MaxValue to be promoted to [int64] when doing a COM property get or set. Since the "All" profiles value of 0x7FFFFFFF is [int]::MaxValue, it would trigger "Specified cast is not valid" when modifying a rule that's already set to All Profiles or trying to be. * Fixed catch-all error handler to include exception detail * Added test converage for this case
This commit is contained in:
@@ -360,6 +360,23 @@
|
||||
that:
|
||||
- add_firewall_rule_with_string_profiles.changed == true
|
||||
|
||||
- name: Set firewall rule profile back to 'all'
|
||||
win_firewall_rule:
|
||||
name: http
|
||||
enabled: yes
|
||||
state: present
|
||||
localport: 80
|
||||
action: allow
|
||||
direction: in
|
||||
protocol: tcp
|
||||
profiles: [Domain, Public, Private]
|
||||
register: add_firewall_rule_with_string_profiles
|
||||
|
||||
- name: Check that setting firewall rule profile back to 'all' succeeds with a change
|
||||
assert:
|
||||
that:
|
||||
- add_firewall_rule_with_string_profiles.changed == true
|
||||
|
||||
- name: Add firewall rule with profiles in list format
|
||||
win_firewall_rule:
|
||||
name: http
|
||||
|
||||
Reference in New Issue
Block a user