-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrender_configurations.yaml
26 lines (22 loc) · 1.05 KB
/
render_configurations.yaml
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
# Playbook to show the final configuration rendered from Jinja2 Templates and host and group variables
#Specify Hosts and Connection Type to use
- hosts: switches
gather_facts: no
connection: ansible.netcommon.network_cli
#Render Templates for Devices and place them in the review_configs directory
tasks:
- name: Core Config Render
when: inventory_hostname in groups['core']
ansible.builtin.template:
src: "~/ansible_lab_v1/templates/core_config.j2"
dest: "~/ansible_lab_v1/review_configs/{{ inventory_hostname }}.config"
- name: Access Config Render
when: inventory_hostname in groups['access']
ansible.builtin.template:
src: "~/ansible_lab_v1/templates/access_config.j2"
dest: "~/ansible_lab_v1/review_configs/{{ inventory_hostname }}.config"
- name: MDT Config Render
when: inventory_hostname in groups['access']
ansible.builtin.template:
src: "~/ansible_lab_v1/templates/telemetry_config.j2"
dest: "~/ansible_lab_v1/review_configs/{{ inventory_hostname }}_MDT.config"