-
Notifications
You must be signed in to change notification settings - Fork 0
/
activate_licenses.yml
60 lines (48 loc) · 1.46 KB
/
activate_licenses.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- hosts: all
connection: local
gather_facts: false
vars:
provider:
ip_address: '{{ ip_address }}'
username: '{{ username }}'
password: '{{ password }}'
pb_version: 1.2
collections:
- paloaltonetworks.panos
tasks:
- name: Include User Variables
include_vars: vars/main.yml
- name: "Initiating License Activation Tool"
debug:
msg: "Initiating License Activation Tool Version: {{ pb_version }}"
- name: Ensure deps are avabilable
# Ensure we have all the right requirements installed in this environment
pip:
name:
- pan-python
- pan-os-python>1.0.0
- xmltodict
- requests
- requests_toolbelt
- name: Wait for Device Online
# Best practice is to always wait for device online at start of playbook
# as these tasks will get called repeatedly, they are added as handlers that
# get included
command: echo "Waiting for device online"
notify: "reboot"
- name: Wait for Online Handler
meta: flush_handlers
- name: Activate licenses
include_tasks: tasks/activate_license.yml
- name: Wait for Online Handler
meta: flush_handlers
handlers:
- name: Wait for System Information
panos_op:
provider: '{{ provider }}'
cmd: 'show system info'
register: system_info
until: system_info is not failed
retries: 60
delay: 30
listen: reboot