Added folder for work that comes off team requests.
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
---
|
||||
testhosts:
|
||||
hosts:
|
||||
10.11.245.1:
|
||||
@@ -1,7 +0,0 @@
|
||||
Site,Description,SequenceNo,Prefix
|
||||
site1,desc1,10,1.1.1.1/32
|
||||
site2,desc2,20,2.2.2.2/32
|
||||
site3,desc3,30,3.3.3.3/32
|
||||
site5,Some text here,40,5.5.5.5/32
|
||||
new_site1,aaaaaa,50,6.6.6.6/32
|
||||
oooo_site,zzzzzz,60,7.7.7.7/32
|
||||
|
@@ -1,19 +0,0 @@
|
||||
---
|
||||
- name: Update device prefix list
|
||||
hosts: testhosts
|
||||
gather_facts: false
|
||||
connection: network_cli
|
||||
roles:
|
||||
- common
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Collect current prefix list
|
||||
cisco.ios.ios_prefix_lists:
|
||||
config:
|
||||
state: gathered
|
||||
register: result
|
||||
|
||||
- name: Print current prefix list information
|
||||
debug:
|
||||
var: result.gathered
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
- name: Update device prefix list
|
||||
hosts: testhosts
|
||||
gather_facts: false
|
||||
connection: network_cli
|
||||
roles:
|
||||
- common
|
||||
tasks:
|
||||
|
||||
# Read the CSV file and return a list of dicts with column names as keys
|
||||
- name: Read CSV file with prefixes information
|
||||
read_csv:
|
||||
path: prefixes_list.csv
|
||||
register: prefix_list
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Get current prefix lists config
|
||||
cisco.ios.ios_command:
|
||||
commands: show run | i ip prefix-list
|
||||
register: config_before
|
||||
|
||||
- name: Print current prefix lists config
|
||||
debug:
|
||||
msg: "{{ config_before.stdout_lines }}"
|
||||
|
||||
- name: Apply new prefix lists
|
||||
cisco.ios.ios_prefix_lists:
|
||||
config:
|
||||
- afi: ipv4
|
||||
prefix_lists:
|
||||
- name: "{{ item.Site }}"
|
||||
description: "{{ item.Description }}"
|
||||
entries:
|
||||
- action: permit
|
||||
prefix: "{{ item.Prefix }}"
|
||||
sequence: 10
|
||||
state: merged
|
||||
loop: "{{ prefix_list.list }}"
|
||||
|
||||
- name: Get updated prefix lists config
|
||||
cisco.ios.ios_command:
|
||||
commands: show run | i ip prefix-list
|
||||
register: config_after
|
||||
|
||||
- name: Print updated prefix lists config
|
||||
debug:
|
||||
msg: "{{ config_after.stdout_lines }}"
|
||||
|
||||
- name: Update target route map
|
||||
cisco.ios.ios_config:
|
||||
lines:
|
||||
- "route-map TEST_MAP permit {{ item.SequenceNo }}"
|
||||
- " match ip next-hop prefix-list {{ item.Site }}"
|
||||
loop: "{{ prefix_list.list }}"
|
||||
Reference in New Issue
Block a user