-
Notifications
You must be signed in to change notification settings - Fork 4
/
ise.backup_status.yaml
94 lines (91 loc) · 2.96 KB
/
ise.backup_status.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
- name: ISE Backup Last Status Playbook
hosts: ise
gather_facts: no
vars_files: vars/main.yaml
# roles:
# - ise_backup_completed
tasks:
- name: ISE Backup In Progress | {{ inventory_hostname }} ({{ ansible_host }})
cisco.ise.backup_last_status_info:
ise_hostname: "{{ ansible_host }}"
ise_username: "{{ ise_username }}"
ise_password: "{{ ise_password }}"
ise_verify: "{{ ise_verify }}"
ise_debug: "{{ ise_debug }}"
register: backup_status
until: backup_status.ise_response.status != 'IN_PROGRESS'
retries: 360 # 360 retries * 10s delay = 3600s == 1 hour
delay: 10 # seconds to wait between retries
failed_when: backup_status.ise_response.justComplete != 'yes'
- name: Backup Completed
when: backup_status.ise_response.status == 'COMPLETED'
vars:
status: "{{ backup_status.ise_response }}"
ansible.builtin.debug:
msg:
- "{{ status.hostName }}"
- "{{ status.status }}"
- "{{ status.message }}"
# Example responses:
# ```
# backup_status:
# changed: false
# failed: false
# ise_response:
# action: BACKUP
# details: Backing up ISE Configuration Data
# error: 'false'
# hostName: ise.securitydemo.net
# initiatedFrom: OPEN_API
# justComplete: 'no'
# message: Backup is in progress...
# name: 20220911-210504
# percentComplete: '20'
# repository: FTP_dCloud_Ubuntu
# scheduled: 'no'
# startDate: Mon Sep 12 04:05:07 UTC 2022
# status: IN_PROGRESS
# type: CONFIGURATION_DB
# result: ''
#
# backup_status:
# changed: false
# failed: false
# ise_response:
# action: BACKUP
# details: Backing up ISE Indexing Engine Data
# error: 'false'
# hostName: ise.securitydemo.net
# initiatedFrom: OPEN_API
# justComplete: 'no'
# message: Backup is in progress...
# name: 20220911-210504
# percentComplete: '45'
# repository: FTP_dCloud_Ubuntu
# scheduled: 'no'
# startDate: Mon Sep 12 04:05:07 UTC 2022
# status: IN_PROGRESS
# type: CONFIGURATION_DB
# result: ''
#
# backup_status:
# changed: false
# failed: false
# ise_response:
# action: BACKUP
# details: null
# error: 'false'
# hostName: ise.securitydemo.net
# initiatedFrom: OPEN_API
# justComplete: 'yes'
# message: 'Backup failed: copy to repository failed'
# name: 20220911-210504
# percentComplete: null
# repository: FTP_dCloud_Ubuntu
# scheduled: 'no'
# startDate: Mon Sep 12 04:05:07 UTC 2022
# status: COMPLETED
# type: CONFIGURATION_DB
# result: '' #
# ```