forked from CiscoDevNet/sdwan-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow-day0.yml
33 lines (30 loc) · 869 Bytes
/
show-day0.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
- name: Add host to topology
hosts: localhost
connection: local
gather_facts: no
tags:
- cull
vars:
include_groups: 'all'
exclude_groups: 'ha'
include_hosts: []
tasks:
- set_fact:
include_hosts: "{{ include_hosts|default([]) + groups[item] }}"
loop: "{{ include_groups.split(',') }}"
- set_fact:
exclude_hosts: "{{ exclude_hosts|default([]) + groups[item]|default([]) }}"
loop: "{{ exclude_groups.split(',') | difference(include_groups.split(',')) }}"
- add_host:
name: "{{ item }}"
groups: virl_nodes
when: hostvars[item].virl is defined
loop: "{{ include_hosts | difference(exclude_hosts) }}"
- name: Generating day0 config
hosts: virl_nodes
gather_facts: no
tags:
- config
tasks:
- debug:
msg: "{{ lookup('template', virl.config_template) }}"