forked from CiscoDevNet/sdwan-devops
-
Notifications
You must be signed in to change notification settings - Fork 1
/
import-templates.yml
28 lines (27 loc) · 1001 Bytes
/
import-templates.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
- name: Import vManage Feature/Device Templates
hosts: localhost
gather_facts: no
connection: local
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') }}"
tags:
- templates
tasks:
- name: Import feature templates
vmanage_feature_template:
user: "{{ ansible_user }}"
host: "{{ vmanage_ip }}"
password: "{{ ansible_password }}"
state: present
aggregate: "{{ vmanage_feature_templates }}"
when: vmanage_feature_templates is defined
- name: Import device templates
vmanage_device_template:
user: "{{ ansible_user }}"
host: "{{ vmanage_ip }}"
password: "{{ ansible_password }}"
state: present
aggregate: "{{ vmanage_device_templates }}"
when: vmanage_device_templates is defined