-
Notifications
You must be signed in to change notification settings - Fork 8
/
import-templates.yml
40 lines (37 loc) · 1.11 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
- name: Import vManage Policy Lists
hosts: localhost
connection: local
roles:
- ansible-viptela
vars:
vmanage_host: "{{ groups.vmanage_hosts | first }}"
vmanage_ip: "{{ hostvars[vmanage_host].ansible_host }}"
file: vmanage_templates.yml
gather_facts: no
tasks:
- name: Reading file {{ file }}
include_vars:
file: "{{ file }}"
name: vmanage_templates
# - set_fact:
# vmanage_templates: "{{ lookup('file', 'vmanage_templates.json') | from_json }}"
#
# - debug:
# var: vmanage_templates
- name: Import feature templates
vmanage_feature_template:
user: "{{ ansible_user }}"
host: "{{ vmanage_ip }}"
password: "{{ ansible_password }}"
state: present
aggregate: "{{ vmanage_templates.feature_templates }}"
- name: Import device templates
vmanage_device_template:
user: "{{ ansible_user }}"
host: "{{ vmanage_ip }}"
password: "{{ ansible_password }}"
state: present
aggregate: "{{ vmanage_templates.device_templates }}"
#
# - debug:
# var: policy_facts