-
Notifications
You must be signed in to change notification settings - Fork 33
/
firmwaredownload.yml
71 lines (59 loc) · 2.19 KB
/
firmwaredownload.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
61
62
63
64
65
66
67
68
69
70
71
---
# Copyright 2019 Broadcom. All rights reserved.
# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries.
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- hosts: san_eng_zone_seed_san_a
gather_facts: False
vars:
credential:
fos_ip_addr: "{{fos_ip_addr}}"
fos_user_name: "{{fos_user_name}}"
fos_password: "{{fos_password}}"
https: "{{fos_https}}"
firmwaredownload:
host: "xx.xx.xx.xx"
user_name: "username"
password: "password"
remote_directory: "directory"
protocol: "scp"
eula_action: "accept-eula"
stage: False
tasks:
- name: initiate firmwaredownload
brocade_operation_firmwaredownload:
credential: "{{credential}}"
vfid: -1
firmwaredownload: "{{firmwaredownload}}"
register: result
- name: print firmwaredownload initial status
debug:
var: result.operation_resp
- name: show status before reboot. If connection refused error is returned during reboot, use showstatus.yml after reboot to view the current status.
brocade_operation_show_status:
credential: "{{credential}}"
vfid: -1
show_status:
message_id: "{{result.operation_resp.show_status.message_id}}"
register: status_result
until: status_result.operation_resp is not defined or status_result.operation_resp.show_status.status == "done" or status_result.operation_resp.show_status.status == "delivered"
retries: 100
delay: 10
- name: print show_status end result
debug:
var: status_result.operation_resp
# pause for 60 seconds to make sure switch has rebooted
- pause: seconds=60
- name: show status after reboot
brocade_operation_show_status:
credential: "{{credential}}"
vfid: -1
show_status:
message_id: "{{result.operation_resp.show_status.message_id}}"
register: status_result
until: status_result.operation_resp is not defined or status_result.operation_resp.show_status.status == "done" or status_result.operation_resp.show_status.status == "delivered"
retries: 100
delay: 10
- name: print show_status end result
debug:
var: status_result.operation_resp