Init basic cluster

This commit is contained in:
2025-02-02 22:35:43 +01:00
commit b7a47745ea
20 changed files with 498 additions and 0 deletions

2
ansible/hosts Normal file
View File

@@ -0,0 +1,2 @@
[openwrt]
2001:470:61a3:100:ffff:ffff:ffff:ffff ansible_scp_extra_args="-O"

6
ansible/playbook.yml Normal file
View File

@@ -0,0 +1,6 @@
- name: Configure router
hosts: openwrt
remote_user: root
roles:
- ansible-openwrt
- router

View File

@@ -0,0 +1,54 @@
# Would never work without this awesome blogpost
# https://farcaller.net/2024/making-cilium-bgp-work-with-ipv6/
log "/tmp/bird.log" all;
log syslog all;
#Router ID
router id 192.168.1.1;
protocol kernel kernel4 {
learn;
scan time 10;
merge paths yes;
ipv4 {
# Importing only default route, we're their default gateway so they dont need rest
import filter { if net = 0.0.0.0/0 then { igp_metric = 100; accept; } reject; };
export all;
};
}
protocol kernel kernel6 {
learn;
scan time 10;
merge paths yes;
ipv6 {
import filter { if net = ::/0 then { igp_metric = 100; accept; } reject; };
export all;
};
}
protocol device {
scan time 10;
}
protocol direct {
interface "*";
}
protocol bgp homelab {
debug { events };
passive;
direct;
local 2001:470:61a3:100:ffff:ffff:ffff:ffff as 65000;
neighbor range 2001:470:61a3:100::/64 as 65000;
ipv4 {
extended next hop yes;
import all;
export all;
};
ipv6 {
import all;
export all;
};
}

View File

@@ -0,0 +1,5 @@
- name: Reload bird
service:
name: bird
state: restarted
enabled: true

View File

@@ -0,0 +1,16 @@
---
- name: Install bird2
opkg:
name: "{{ item }}"
state: present
# Workaround for opkg module not handling multiple names at once well
loop:
- bird2
- bird2c
- name: Set up bird.conf
ansible.builtin.copy:
src: bird.conf
dest: /etc/bird.conf
mode: "644"
notify: Reload bird