|
1 | 1 | --- |
2 | 2 | # Runs test security-policy-match based on the given parameters |
3 | 3 |
|
| 4 | +- name: Set Test XML |
| 5 | + set_fact: |
| 6 | + test_xml: | |
| 7 | + <test> |
| 8 | + <security-policy-match> |
| 9 | + <source>{{ source_ip }}</source> |
| 10 | + <destination>{{ destination_ip }}</destination> |
| 11 | + <application>{{ application | default('ssl') }}</application> |
| 12 | + <protocol>6</protocol> |
| 13 | + <destination-port>443</destination-port> |
| 14 | + </security-policy-match> |
| 15 | + </test> |
| 16 | +
|
| 17 | +- name: Print the test parameters |
| 18 | + debug: |
| 19 | + msg: "{{ test_xml }}" |
| 20 | + |
4 | 21 | - name: Test the Current Security policy |
5 | 22 | block: |
6 | 23 | - name: Test the current status of the security policy using all parameters |
|
10 | 27 | username: "{{ provider.username }}" |
11 | 28 | password: "{{ provider.password }}" |
12 | 29 | serial_number: "{{ item.serial }}" |
13 | | - cmd: | |
14 | | - <test> |
15 | | - <security-policy-match> |
16 | | - <source>{{ source_ip }}</source> |
17 | | - <destination>{{ destination_ip }}</destination> |
18 | | - <application>{{ application }}</application> |
19 | | - <protocol>{{ protocol }}</protocol> |
20 | | - <destination-port>{{ destination_port }}</destination-port> |
21 | | - </security-policy-match> |
22 | | - </test> |
| 30 | + cmd: "{{ test_xml }}" |
23 | 31 | cmd_is_xml: true |
24 | 32 | register: security_policy_match_result |
25 | 33 | rescue: |
|
30 | 38 | username: "{{ provider.username }}" |
31 | 39 | password: "{{ provider.password }}" |
32 | 40 | serial_number: "{{ item.serial }}" |
33 | | - cmd: | |
34 | | - <test> |
35 | | - <security-policy-match> |
36 | | - <source>{{ source_ip }}</source> |
37 | | - <destination>{{ destination_ip }}</destination> |
38 | | - <application>ssl</application> |
39 | | - <protocol>6</protocol> |
40 | | - <destination-port>443</destination-port> |
41 | | - </security-policy-match> |
42 | | - </test> |
| 41 | + cmd: "{{ test_xml }}" |
43 | 42 | cmd_is_xml: true |
44 | 43 | register: security_policy_match_result |
45 | 44 |
|
| 45 | +- debug: |
| 46 | + msg: "{{ security_policy_match_result }}" |
| 47 | + |
46 | 48 | - name: Set the policy match result |
47 | 49 | set_fact: |
48 | 50 | matches_existing_policy: "{{ security_policy_match_result | panos_op_policy_match_result_to_bool }}" |
0 commit comments