Create bird role for OSPF.

This commit is contained in:
jeltz 2021-02-24 22:09:23 +01:00
parent 85c1d905e7
commit 259c2afeab
4 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
bird_ospf_hello: 2
bird_ospf_retransmit: 2
bird_ospf_wait: 10
bird_ospf_dead: 30
...

View file

@ -0,0 +1,6 @@
---
- name: Reload bird
systemd:
name: bird.service
state: reloaded
...

20
roles/bird/tasks/main.yml Normal file
View file

@ -0,0 +1,20 @@
---
- name: Install bird
apt:
name: bird
state: latest
- name: Configure bird
template:
src: bird.conf.j2
dest: /etc/bird/bird.conf
owner: root
group: root
mode: u=rw,g=r,o=
- name: Enable and start bird
systemd:
name: bird.service
state: started
enabled: true
...

View file

@ -0,0 +1,43 @@
log syslog all;
router id {{ bird_router_id }};
protocol kernel {
scan time 15;
import none;
export filter {
krt_prefsrc = {{ bird_router_prefsrc }};
accept;
};
};
protocol device {
scan time 15;
};
{% if bird_ospf_ifaces is defined %}
protocol ospf {
import all;
export all;
area 0 {
{% for name, attrs in bird_ospf_ifaces.items() %}
interface "{{ name }}" {
{% if "stub" in attrs %}
stub;
{% else %}
hello {{ attrs.hello | default(bird_ospf_hello) }};
retransmit {{ attrs.retransmit | default(bird_ospf_retransmit) }};
wait {{ attrs.wait | default(bird_ospf_wait) }};
dead {{ attrs.dead | default(bird_ospf_dead) }};
type {{ attrs.type }};
cost {{ attrs.cost }};
{% endif %}
};
{% endfor %}
}
};
{% endif %}