Create bird role for OSPF.
This commit is contained in:
parent
85c1d905e7
commit
259c2afeab
4 changed files with 75 additions and 0 deletions
6
roles/bird/defaults/main.yml
Normal file
6
roles/bird/defaults/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
bird_ospf_hello: 2
|
||||
bird_ospf_retransmit: 2
|
||||
bird_ospf_wait: 10
|
||||
bird_ospf_dead: 30
|
||||
...
|
6
roles/bird/handlers/main.yml
Normal file
6
roles/bird/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Reload bird
|
||||
systemd:
|
||||
name: bird.service
|
||||
state: reloaded
|
||||
...
|
20
roles/bird/tasks/main.yml
Normal file
20
roles/bird/tasks/main.yml
Normal 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
|
||||
...
|
43
roles/bird/templates/bird.conf.j2
Normal file
43
roles/bird/templates/bird.conf.j2
Normal 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 %}
|
Loading…
Reference in a new issue