-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpalo-op-module.yaml
41 lines (34 loc) · 1.12 KB
/
palo-op-module.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
## PLAYBOOK
# Playbook to demonstrate using OP module to pull back information from the Firewall
## DESCRIPTION
# Example playbook that will connect to the firewall using credentials provided saved in host var file
## REQUIREMENTS
# pip install ansible
# ansible-galaxy install PaloAltoNetworks.paloaltonetworks
## EXECUTE
# ansible-playbook palo-op-module.yaml
---
- name: Demonstrating how the OP module can be used to execute various op commands on the Firewall
hosts: PA-VM-02
connection: local
gather_facts: False
collections:
- paloaltonetworks.panos
tasks:
- name: Show all interfaces using ('show interface all')
panos_op:
provider: '{{ provider }}'
cmd: "show interface all"
register: result
- name: returned output in the default JSON format
debug: msg='{{ result.stdout }}'
- name: returned output in the XML format
debug: msg='{{ result.stdout_xml }}'
- name: Show system info op command
panos_op:
provider: '{{ provider }}'
cmd: 'show system info'
register: result
- name: returned output in the XML format
debug: msg='{{ result.stdout_xml }}'
...