-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp.yml
115 lines (100 loc) · 2.97 KB
/
temp.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
- name: Enable IPv4 routing
become: true
eos_config:
lines:
- "ip routing"
tags: ["routing"]
- name: Configure AS attributes and neighbor
become: true
arista.eos.eos_bgp:
config:
bgp_as: "{{ bgp.local_as }}"
log_neighbor_changes: True
router_id: "{{ bgp.router_id }}"
neighbors:
- neighbor: "{{ bgp.neighbors.ipv4_neighbors[0].neighbor }}"
remote_as: "{{ bgp.neighbors.ipv4_neighbors[0].remote_as }}"
networks:
- prefix: "{{ bgp.neighbors.ipv4_neighbors[0].prefix }}"
masklen: "{{ bgp.neighbors.ipv4_neighbors[0].masklen }}"
tags: ["bgp"]
- name: Configure AS attributes and neighbor
become: true
arista.eos.eos_bgp:
config:
bgp_as: "{{ bgp.local_as }}"
log_neighbor_changes: True
router_id: "{{ bgp.router_id }}"
neighbors:
- neighbor: "{{ item.neighbor }}"
remote_as: "{{ item.remote_as }}"
networks:
- prefix: "{{ item.prefix }}"
masklen: "{{ item.masklen }}"
when: bgp is defined
loop: "{{ bgp.neighbors.ipv4_neighbors }}"
tags: ["bgp"]
{% if not bgp.log-neighbor-changes -%}
no bgp log-neighbor-changes
{% endif -%}
- name: Configure routed protocols
become: true
arista.eos.interfaces:
config:
- name: "{{ item.eos_if }}"
mode: layer3
state: merged
when: item.routed is defined
loop: "{{ interfaces }}"
- name: Configure non-routed Loopbacks
become: true
arista.eos.interfaces:
config:
- name: "{{ item.eos_if }}"
state: merged
when: item.routed is not defined
loop: "{{ interfaces }}"
tags: ["l0"]
- name: Configure L3 IPv4 Interfaces
become: true
arista.eos.l3_interfaces:
config:
- name: "{{ item.eos_if }}"
ipv4:
- address: "{{ item.ipv4 }}"
state: merged
loop: "{{ interfaces }}"
tags: ["l3 int"]
- name: Configure routed protocols
become: true
arista.eos.interfaces:
config:
- name: "{{ item.eos_if }}"
mode: layer3
state: merged
when: item.routed is defined
loop: "{{ interfaces }}"
- name: Configure non-routed Loopbacks
become: true
arista.eos.interfaces:
config:
- name: "{{ item.eos_if }}"
state: merged
when: item.routed is not defined
loop: "{{ interfaces }}"
tags: ["l0"]
- name: Configure L3 IPv4 Interfaces
become: true
arista.eos.l3_interfaces:
config:
- name: "{{ item.eos_if }}"
ipv4:
- address: "{{ item.ipv4 }}"
state: merged
loop: "{{ interfaces }}"
tags: ["l3 int"]
description {{ int.desc }}
{% if "Ethernet" in int.eos_if -%}
no switchport
{% endif -%}
ip address {{ int.ipv4 }}