-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinflux_adv.yml
65 lines (53 loc) · 1.6 KB
/
influx_adv.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
## Playbook to configure things
- hosts: localhost
vars:
directory:
- "./adv_juniper"
- "./adv_xr"
tasks:
- name: Delete directory
ansible.builtin.file:
state: absent
path: "{{ item }}"
loop: "{{ directory }}"
run_once: true
- name: Create directory
ansible.builtin.file:
state: directory
path: "{{ item }}"
loop: "{{ directory }}"
run_once: true
- hosts: juniper
tasks:
- name: Juniper BGP advertised routes
junipernetworks.junos.junos_command:
commands:
- show route advertising-protocol bgp {{ item.value.ip }} table {{ item.value.table }}
display: json
with_dict: "{{ peers }}"
register: adv_juniper
- name: Save to the adv dirctory
copy:
content: "{{ item.stdout[0] }}"
dest: "./adv_json/{{ item.item.value.name }}"
loop: "{{ adv_juniper.results }}"
when: item.skipped is not defined and not os == "linux"
delegate_to: localhost
#no_log: true
- hosts: xr
tasks:
- name: XR BGP advertised routes
cisco.iosxr.iosxr_command:
commands:
- show bgp neighbor {{ item.value.ip }} advertised-routes
with_dict: "{{ peers }}"
register: adv_xr
- name: Save to the adv dirctory
copy:
content: "{{ item.stdout[0] }}"
dest: "./adv_xr/{{ item.item.value.name }}"
loop: "{{ adv_xr.results }}"
when: item.skipped is not defined and not os == "linux"
delegate_to: localhost
#no_log: true