forked from PaloAltoNetworks/ansible-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_ready.yml
43 lines (40 loc) · 1.32 KB
/
check_ready.yml
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
42
43
---
# check_ready.yml - Checks to see if a firewall is ready via 'show chassis-ready' command.
#
# Description
# ===========
#
# Uses the 'show chassis-ready' op command to see if a PAN-OS firewall is ready. This playbook uses the Ansible
# 'until' and 'retries' keywords to retry the command until successful.
#
# 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 (see `host_vars/firewall.yml` for an example) or
# extra vars.
#
# Modules Used
# ============
#
# panos_op - https://paloaltonetworks.github.io/pan-os-ansible/modules/panos_op.html
#
# Usage
# =====
#
# $ ansible-playbook -i inventory check_ready.yml
- hosts: '{{ target | default("firewall") }}'
connection: local
vars:
device:
ip_address: '{{ ip_address }}'
username: '{{ username | default(omit) }}'
password: '{{ password | default(omit) }}'
api_key: '{{ api_key | default(omit) }}'
tasks:
- name: Check to see if device is ready
paloaltonetworks.panos.panos_op:
provider: '{{ device }}'
cmd: 'show chassis-ready'
changed_when: false
register: result
until: result is not failed and (result.stdout | from_json).response.result == 'yes'
retries: 50
delay: 30