forked from CiscoDevNet/sdwan-devops
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config-uuid-otp.yml
34 lines (32 loc) · 1.16 KB
/
config-uuid-otp.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
- name: Activate Vedge Cloud
hosts: "{{ passed | default('sdwan_edges') }}"
gather_facts: no
tags:
- bootstrap
- edges
connection: network_cli
vars:
vmanage_host: "{{ groups.vmanage_hosts | first }}"
vmanage_mgmt_interface: "{{ hostvars[vmanage_host].mgmt_interface | default('ansible_host') }}"
vmanage_ip: "{{ hostvars[vmanage_host][vmanage_mgmt_interface] | ipaddr('address') }}"
ansible_network_os: ios
serial: 1
# This is a workaround for a bug in vmanage. When multiple requests
# for boostrap are made to vmanage at the same time, it gets corrupted
tasks:
- name: Get OTP for UUID
vmanage_device_bootstrap:
host: "{{ vmanage_ip }}"
user: "{{ vmanage_user }}"
password: "{{ vmanage_pass }}"
uuid: "{{ sdwan_uuid }}"
register: result
retries: 10
delay: 10
until: result is not failed
delegate_to: localhost
- name: Activate vedge cloud with UUID and OTP
cli_command:
command: "request vedge-cloud activate chassis-number {{ sdwan_uuid }} token {{ result.bootstrap.otp }}"
connection: network_cli
register: command_results