aboutsummaryrefslogtreecommitdiff
path: root/tnet
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2024-06-13 20:05:39 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2024-06-13 20:05:39 +0200
commit36f713dff28d357458b787e2f1e00a71da7bd51f (patch)
tree162871a78641b947f5e28ff6f2bf6d6b02c72d9c /tnet
parent8ba9372b772eb488cdfe7fac0e7919c1ae4e965e (diff)
downloadinfra-36f713dff28d357458b787e2f1e00a71da7bd51f.tar.gz
infra-36f713dff28d357458b787e2f1e00a71da7bd51f.tar.bz2
infra-36f713dff28d357458b787e2f1e00a71da7bd51f.tar.xz
infra-36f713dff28d357458b787e2f1e00a71da7bd51f.zip
tnet
Diffstat (limited to 'tnet')
-rw-r--r--tnet/bird-config.yml20
-rw-r--r--tnet/bird-gen.yml4
-rw-r--r--tnet/files/hash/bird-tnet.conf (renamed from tnet/files/hash/bird.conf)8
-rw-r--r--tnet/files/knot/bird-tnet.conf (renamed from tnet/files/knot/bird.conf)8
-rw-r--r--tnet/files/node1/bird-tnet.conf (renamed from tnet/files/node1/bird.conf)8
-rw-r--r--tnet/files/node2/bird-tnet.conf (renamed from tnet/files/node2/bird.conf)8
-rw-r--r--tnet/templates/bird-tnet.conf.j2 (renamed from tnet/templates/bird.conf.j2)8
7 files changed, 62 insertions, 2 deletions
diff --git a/tnet/bird-config.yml b/tnet/bird-config.yml
new file mode 100644
index 0000000..fcffa4d
--- /dev/null
+++ b/tnet/bird-config.yml
@@ -0,0 +1,20 @@
+- hosts: tnet
+ tasks:
+ - become: yes
+ copy:
+ dest: /etc/bird/bird-tnet.conf
+ src: "{{ inventory_hostname }}/bird-tnet.conf"
+ register: bird_conf
+
+ - systemd:
+ state: reloaded
+ service: bird
+ when: bird_conf.changed
+ become: yes
+ handlers:
+ - name: systemctl reload bird
+ become: yes
+ systemd:
+ name: bird
+ state: reloaded
+
diff --git a/tnet/bird-gen.yml b/tnet/bird-gen.yml
index 4a3e19d..17e8128 100644
--- a/tnet/bird-gen.yml
+++ b/tnet/bird-gen.yml
@@ -7,5 +7,5 @@
path: files/{{ inventory_hostname }}
state: directory
- template:
- src: bird.conf.j2
- dest: files/{{ inventory_hostname }}/bird.conf
+ src: bird-tnet.conf.j2
+ dest: files/{{ inventory_hostname }}/bird-tnet.conf
diff --git a/tnet/files/hash/bird.conf b/tnet/files/hash/bird-tnet.conf
index 16ce2cc..b2afdc8 100644
--- a/tnet/files/hash/bird.conf
+++ b/tnet/files/hash/bird-tnet.conf
@@ -1,3 +1,11 @@
+define tnet = fdb1:4242:3538::/48;
+define tnet_router = fdb1:4242:3538:ffff::/64;
+
+function is_tnet() -> bool
+{
+ return net ~ tnet && ! (net ~ tnet_router);
+}
+
template bgp tnet_tpl {
local as 4242423538;
neighbor internal;
diff --git a/tnet/files/knot/bird.conf b/tnet/files/knot/bird-tnet.conf
index fcecc19..32f06cb 100644
--- a/tnet/files/knot/bird.conf
+++ b/tnet/files/knot/bird-tnet.conf
@@ -1,3 +1,11 @@
+define tnet = fdb1:4242:3538::/48;
+define tnet_router = fdb1:4242:3538:ffff::/64;
+
+function is_tnet() -> bool
+{
+ return net ~ tnet && ! (net ~ tnet_router);
+}
+
template bgp tnet_tpl {
local as 4242423538;
neighbor internal;
diff --git a/tnet/files/node1/bird.conf b/tnet/files/node1/bird-tnet.conf
index 88bd6f8..ebf0160 100644
--- a/tnet/files/node1/bird.conf
+++ b/tnet/files/node1/bird-tnet.conf
@@ -1,3 +1,11 @@
+define tnet = fdb1:4242:3538::/48;
+define tnet_router = fdb1:4242:3538:ffff::/64;
+
+function is_tnet() -> bool
+{
+ return net ~ tnet && ! (net ~ tnet_router);
+}
+
template bgp tnet_tpl {
local as 4242423538;
neighbor internal;
diff --git a/tnet/files/node2/bird.conf b/tnet/files/node2/bird-tnet.conf
index 99dfc5e..813b0f5 100644
--- a/tnet/files/node2/bird.conf
+++ b/tnet/files/node2/bird-tnet.conf
@@ -1,3 +1,11 @@
+define tnet = fdb1:4242:3538::/48;
+define tnet_router = fdb1:4242:3538:ffff::/64;
+
+function is_tnet() -> bool
+{
+ return net ~ tnet && ! (net ~ tnet_router);
+}
+
template bgp tnet_tpl {
local as 4242423538;
neighbor internal;
diff --git a/tnet/templates/bird.conf.j2 b/tnet/templates/bird-tnet.conf.j2
index 57e557a..6e1ba0e 100644
--- a/tnet/templates/bird.conf.j2
+++ b/tnet/templates/bird-tnet.conf.j2
@@ -1,3 +1,11 @@
+define tnet = fdb1:4242:3538::/48;
+define tnet_router = fdb1:4242:3538:ffff::/64;
+
+function is_tnet() -> bool
+{
+ return net ~ tnet && ! (net ~ tnet_router);
+}
+
template bgp tnet_tpl {
local as 4242423538;
neighbor internal;