-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpalo-fw-shutdown.yaml
34 lines (31 loc) · 1.01 KB
/
palo-fw-shutdown.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
---
## NAME: palo-fw-shutdown.yaml
# Shuts down a PAN-OS device.
#
# DESRIPTION:
# This issues the shutdown command using the 'panos_op' module. This uses the Ansible 'ignore_errors' keyword because
# issuing the shutdown command terminates the API connection.
#
# This playbook requires connection details for the device to be specified in the variables 'ip_address', 'username',
# and 'password'. These may be defined as host variables for an example or extra vars.
#
## MODULES:
# panos_op - https://paloaltonetworks.github.io/pan-os-ansible/modules/panos_op.html
#
## COMMAND TO RUN PLAYBOOK:
# ansible-playbook palo-fw-shutdown.yaml
---
- name: Shutdown the Firewall
hosts: PA-FW-02
connection: local
gather_facts: false
collections:
- paloaltonetworks.panos
tasks:
- name: Issue firewall shutdown command
paloaltonetworks.panos.panos_op:
provider: '{{ provider }}'
cmd: '<request><shutdown><system></system></shutdown></request>'
cmd_is_xml: true
ignore_errors: true
...