mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
4.7 KiB
YAML
186 lines
4.7 KiB
YAML
# We start with firewall turned off
|
|
|
|
- name: Turn off Windows Firewall again
|
|
win_firewall:
|
|
profiles: [ Domain, Private, Public ]
|
|
state: disabled
|
|
register: firewall_off_again
|
|
|
|
- name: Test firewall_off_again
|
|
assert:
|
|
that:
|
|
- firewall_off_again is not changed
|
|
- not firewall_off_again.Domain.enabled
|
|
- not firewall_off_again.Private.enabled
|
|
- not firewall_off_again.Public.enabled
|
|
|
|
- name: Turn on Windows Firewall on Public
|
|
win_firewall:
|
|
profiles: [ Public ]
|
|
state: enabled
|
|
register: firewall_public_on
|
|
|
|
- name: Test firewall_public_on
|
|
assert:
|
|
that:
|
|
- firewall_public_on is changed
|
|
- not firewall_public_on.Domain.enabled
|
|
- not firewall_public_on.Private.enabled
|
|
- firewall_public_on.Public.enabled
|
|
|
|
|
|
- name: Turn on Windows Firewall on Public again
|
|
win_firewall:
|
|
profiles: [ Public ]
|
|
state: enabled
|
|
register: firewall_public_on_again
|
|
|
|
- name: Test firewall_public_on_again (normal mode)
|
|
assert:
|
|
that:
|
|
- firewall_public_on_again is not changed
|
|
- not firewall_public_on_again.Domain.enabled
|
|
- not firewall_public_on_again.Private.enabled
|
|
- firewall_public_on_again.Public.enabled
|
|
when: not in_check_mode
|
|
|
|
- name: Test firewall_public_on_again (check-mode)
|
|
assert:
|
|
that:
|
|
- firewall_public_on_again is changed
|
|
- not firewall_public_on_again.Domain.enabled
|
|
- not firewall_public_on_again.Private.enabled
|
|
- firewall_public_on_again.Public.enabled
|
|
when: in_check_mode
|
|
|
|
|
|
# On purpose not a list
|
|
- name: Turn on Windows Firewall on Domain
|
|
win_firewall:
|
|
profiles: Domain
|
|
state: enabled
|
|
register: firewall_domain_on
|
|
|
|
- name: Test firewall_domain_on (normal mode)
|
|
assert:
|
|
that:
|
|
- firewall_domain_on is changed
|
|
- firewall_domain_on.Domain.enabled
|
|
- not firewall_domain_on.Private.enabled
|
|
- firewall_domain_on.Public.enabled
|
|
when: not in_check_mode
|
|
|
|
- name: Test firewall_domain_on (check-mode)
|
|
assert:
|
|
that:
|
|
- firewall_domain_on is changed
|
|
- firewall_domain_on.Domain.enabled
|
|
- not firewall_domain_on.Private.enabled
|
|
- not firewall_domain_on.Public.enabled
|
|
when: in_check_mode
|
|
|
|
|
|
- name: Turn on Windows Firewall on Domain again
|
|
win_firewall:
|
|
profiles: [ Domain ]
|
|
state: enabled
|
|
register: firewall_domain_on_again
|
|
|
|
- name: Test firewall_domain_on_again (normal mode)
|
|
assert:
|
|
that:
|
|
- firewall_domain_on_again is not changed
|
|
- firewall_domain_on.Domain.enabled
|
|
- not firewall_domain_on.Private.enabled
|
|
- firewall_domain_on.Public.enabled
|
|
when: not in_check_mode
|
|
|
|
- name: Test firewall_domain_on_again (check-mode)
|
|
assert:
|
|
that:
|
|
- firewall_domain_on_again is changed
|
|
- firewall_domain_on.Domain.enabled
|
|
- not firewall_domain_on.Private.enabled
|
|
- not firewall_domain_on.Public.enabled
|
|
when: in_check_mode
|
|
|
|
|
|
- name: Turn on Windows Firewall
|
|
win_firewall:
|
|
profiles: [ Domain, Private, Public ]
|
|
state: enabled
|
|
register: firewall_on
|
|
|
|
- name: Test firewall_on
|
|
assert:
|
|
that:
|
|
- firewall_on is changed
|
|
- firewall_on.Domain.enabled
|
|
- firewall_on.Private.enabled
|
|
- firewall_on.Public.enabled
|
|
|
|
|
|
# On purpose no profiles added
|
|
- name: Turn on Windows Firewall again
|
|
win_firewall:
|
|
state: enabled
|
|
register: firewall_on_again
|
|
|
|
- name: Test firewall_on_again (normal mode)
|
|
assert:
|
|
that:
|
|
- firewall_on_again is not changed
|
|
- firewall_on_again.Domain.enabled
|
|
- firewall_on_again.Private.enabled
|
|
- firewall_on_again.Public.enabled
|
|
when: not in_check_mode
|
|
|
|
- name: Test firewall_on_again (check-mode)
|
|
assert:
|
|
that:
|
|
- firewall_on_again is changed
|
|
- firewall_on_again.Domain.enabled
|
|
- firewall_on_again.Private.enabled
|
|
- firewall_on_again.Public.enabled
|
|
when: in_check_mode
|
|
|
|
|
|
# On purpose no profiles added
|
|
- name: Turn off Windows Firewall
|
|
win_firewall:
|
|
state: disabled
|
|
register: firewall_off2
|
|
|
|
- name: Test firewall_off2 (normal mode)
|
|
assert:
|
|
that:
|
|
- firewall_off2 is changed
|
|
- not firewall_off2.Domain.enabled
|
|
- not firewall_off2.Private.enabled
|
|
- not firewall_off2.Public.enabled
|
|
when: not in_check_mode
|
|
|
|
- name: Test firewall_off2 (check-mode)
|
|
assert:
|
|
that:
|
|
- firewall_off2 is not changed
|
|
- not firewall_off2.Domain.enabled
|
|
- not firewall_off2.Private.enabled
|
|
- not firewall_off2.Public.enabled
|
|
when: in_check_mode
|
|
|
|
|
|
- name: Turn off Windows Firewall again
|
|
win_firewall:
|
|
profiles: [ Domain, Private, Public ]
|
|
state: disabled
|
|
register: firewall_off2_again
|
|
|
|
- name: Test firewall_off2_again (normal mode)
|
|
assert:
|
|
that:
|
|
- firewall_off2_again is not changed
|
|
- not firewall_off2_again.Domain.enabled
|
|
- not firewall_off2_again.Private.enabled
|
|
- not firewall_off2_again.Public.enabled
|