filmov
tv
Ansible iosxr config generation playbook
Показать описание
Ansible iosxr config generation playbook
NCS5500
ASR9000
IOSXR
config template ansible
Jinja template files
Playbook file:-
---
- name: config generation with template file
hosts: localhost
gather_facts: false
connection: local
*** make sure to create the required dir *****
tasks:
- name: Generate Config
with_items:
- { hostname: 'CORE1' ,Loopback0_IP1: '1.1.1.1', route_policy1: test, community1: '1:1', community2: '2:2', net1: '49.4001.0001.0001.0001.00', BE1: 101,
BE2: 102, tag: 1, bgp_neighbor1: '100.100.100.100', bgp_neighbor2: '200.200.200.200' }
- { hostname: 'CORE2' , Loopback0_IP1: '2.2.2.2', route_policy1: test, community1: '3:3', community2: '4:4', net1: '49.4002.0002.-0002.0002.00', BE1: 101,
BE2: 102, tag: 2, bgp_neighbor1: '100.100.100.100', bgp_neighbor2: '200.200.200.200' }
NCS5500
ASR9000
IOSXR
config template ansible
Jinja template files
Playbook file:-
---
- name: config generation with template file
hosts: localhost
gather_facts: false
connection: local
*** make sure to create the required dir *****
tasks:
- name: Generate Config
with_items:
- { hostname: 'CORE1' ,Loopback0_IP1: '1.1.1.1', route_policy1: test, community1: '1:1', community2: '2:2', net1: '49.4001.0001.0001.0001.00', BE1: 101,
BE2: 102, tag: 1, bgp_neighbor1: '100.100.100.100', bgp_neighbor2: '200.200.200.200' }
- { hostname: 'CORE2' , Loopback0_IP1: '2.2.2.2', route_policy1: test, community1: '3:3', community2: '4:4', net1: '49.4002.0002.-0002.0002.00', BE1: 101,
BE2: 102, tag: 2, bgp_neighbor1: '100.100.100.100', bgp_neighbor2: '200.200.200.200' }