mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 20:13:59 -07:00
minor updates + tests to win_firewall_rule as per jborean93 review (#29148)
* Added warning for 'force' option * Changed 'profiles' type to list * Changed 'interfacetypes' type to list * Added deprecation warning and fixed doc * updated force parameter
This commit is contained in:
parent
b454115e9f
commit
2b63ae61f2
3 changed files with 76 additions and 14 deletions
|
@ -251,7 +251,7 @@
|
|||
that:
|
||||
- add_firewall_rule_with_multiple_ports.changed == true
|
||||
|
||||
- name: Add firewall rule with interface types
|
||||
- name: Add firewall rule with interface types in string format
|
||||
win_firewall_rule:
|
||||
name: http
|
||||
enabled: yes
|
||||
|
@ -261,12 +261,29 @@
|
|||
direction: in
|
||||
protocol: tcp
|
||||
interfacetypes: 'ras,lan,wireless'
|
||||
register: add_firewall_rule_with_interface_types
|
||||
register: add_firewall_rule_with_string_interface_types
|
||||
|
||||
- name: Check that creating firewall rule with interface types succeeds with a change
|
||||
- name: Check that creating firewall rule with interface types in string format succeeds with a change
|
||||
assert:
|
||||
that:
|
||||
- add_firewall_rule_with_interface_types.changed == true
|
||||
- add_firewall_rule_with_string_interface_types.changed == true
|
||||
|
||||
- name: Add firewall rule with interface types in list format
|
||||
win_firewall_rule:
|
||||
name: http
|
||||
enabled: yes
|
||||
state: present
|
||||
localport: 80
|
||||
action: allow
|
||||
direction: in
|
||||
protocol: tcp
|
||||
interfacetypes: [ras, lan]
|
||||
register: add_firewall_rule_with_list_interface_types
|
||||
|
||||
- name: Check that creating firewall rule with interface types in list format succeeds with a change
|
||||
assert:
|
||||
that:
|
||||
- add_firewall_rule_with_list_interface_types.changed == true
|
||||
|
||||
- name: Add firewall rule with interface type 'any'
|
||||
win_firewall_rule:
|
||||
|
@ -325,3 +342,37 @@
|
|||
- add_firewall_rule_with_secure_flags.changed == true
|
||||
# Works on windows >= Windows 8/Windows Server 2012
|
||||
when: ansible_distribution_version | version_compare('6.2', '>=')
|
||||
|
||||
- name: Add firewall rule with profiles in string format
|
||||
win_firewall_rule:
|
||||
name: http
|
||||
enabled: yes
|
||||
state: present
|
||||
localport: 80
|
||||
action: allow
|
||||
direction: in
|
||||
protocol: tcp
|
||||
profiles: 'domain,public'
|
||||
register: add_firewall_rule_with_string_profiles
|
||||
|
||||
- name: Check that creating firewall rule with profiles in string format 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
|
||||
enabled: yes
|
||||
state: present
|
||||
localport: 80
|
||||
action: allow
|
||||
direction: in
|
||||
protocol: tcp
|
||||
profiles: [Domain, Private]
|
||||
register: add_firewall_rule_with_list_profiles
|
||||
|
||||
- name: Check that creating firewall rule with profiles in list format succeeds with a change
|
||||
assert:
|
||||
that:
|
||||
- add_firewall_rule_with_list_profiles.changed == true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue