Timotej Lazar
63ab087645
Set standardized interface names (mgmt0… for L2 management interfaces and lan0… for L3 data interfaces speaking BGP). ASN is stored as a custom field in netbox but that might change.
55 lines
1 KiB
YAML
55 lines
1 KiB
YAML
- include_tasks: mgmt.yml
|
|
|
|
- name: Set up loopback interface
|
|
template:
|
|
dest: /etc/network/interfaces.d/loopback.intf
|
|
src: loopback.intf.j2
|
|
mode: 0644
|
|
notify: reload interfaces
|
|
|
|
- name: Set up fabric interfaces
|
|
template:
|
|
dest: /etc/network/interfaces.d/fabric.intf
|
|
src: fabric.intf.j2
|
|
mode: 0644
|
|
notify: reload interfaces
|
|
|
|
- name: Set hostname
|
|
hostname:
|
|
name: '{{ inventory_hostname }}'
|
|
|
|
- name: Set up resolv.conf
|
|
template:
|
|
dest: /etc/resolv.conf
|
|
src: resolv.conf.j2
|
|
mode: 0644
|
|
|
|
- name: Install essential packages
|
|
package: name=git,rsync,vim,tmux
|
|
|
|
- name: Install FRR
|
|
package: name=frr,frr-pythontools
|
|
|
|
- name: Enable BGP and BFD
|
|
lineinfile:
|
|
path: /etc/frr/daemons
|
|
regexp: "^{{ item }}="
|
|
line: "{{ item }}=yes"
|
|
loop:
|
|
- bfdd
|
|
- bgpd
|
|
notify: restart frr
|
|
|
|
- name: Copy FRR config
|
|
template:
|
|
dest: /etc/frr/frr.conf
|
|
src: frr.conf.j2
|
|
mode: 0644
|
|
notify: reload frr
|
|
|
|
- name: Enable FRR service
|
|
service:
|
|
name: frr
|
|
enabled: yes
|
|
notify: restart frr
|