Browse Source

allow to set a custom location for birds config

main
n0emis 2 years ago
parent
commit
4f3c580294
Signed by: n0emis GPG Key ID: 00FAF748B777CF10
  1. 12
      defaults/main.yml
  2. 16
      tasks/bird2.yml

12
defaults/main.yml

@ -1,3 +1,4 @@
---
dn42_wg_private_key: "foobar2342"
dn42_wg_default_if_prefix: "dn42_"
@ -7,11 +8,15 @@ dn42_local_v4: "172.17.0.1"
dn42_local_v6: "fe80::1"
dn42_local_as: "424242424243"
dn42_bird2_directory: "/etc/bird/"
dn42_bird2_template: "bird2/bird.conf.j2"
dn42_bird2_peer_template: "bird2/peer.conf.j2"
dn42_enable_roa: yes
dn42_roa_v4_source: "https://dn42.burble.com/roa/dn42_roa_bird2_4.conf"
dn42_roa_v4_location: "/etc/bird/roa_dn42.conf"
dn42_roa_v4_location: "{{ dn42_bird2_directory }}/roa_dn42.conf"
dn42_roa_v6_source: "https://dn42.burble.com/roa/dn42_roa_bird2_6.conf"
dn42_roa_v6_location: "/etc/bird/roa_dn42_v6.conf"
dn42_roa_v6_location: "{{ dn42_bird2_directory }}/roa_dn42_v6.conf"
dn42_roa_cronjob: "curl -sfSLR -o{{ dn42_roa_v4_location }} -z{{ dn42_roa_v4_location }} {{ dn42_roa_v4_source }} && curl -sfSLR -o{{ dn42_roa_v6_location }} -z{{ dn42_roa_v6_location }} {{ dn42_roa_v6_source }} && birdc configure"
@ -23,9 +28,6 @@ dn42_pingfinder_logfile: "/dev/null"
dn42_configure_linux_network_table: no
dn42_bird2_template: "bird2/bird.conf.j2"
dn42_bird2_peer_template: "bird2/peer.conf.j2"
dn42_peers:
- name: "neighbour"
as: "4242424242"

16
tasks/bird2.yml

@ -1,26 +1,32 @@
---
#- import_tasks: bird-repos.yml
- name: Install bird2
apt:
name: "bird2"
state: present
- name: Ensure birds config foler exists
file:
path: "{{ dn42_bird2_directory }}"
state: directory
owner: "bird"
group: "bird"
- name: Copy bird config-file
template:
dest: /etc/bird/bird.conf
dest: "{{ dn42_bird2_directory }}/bird.conf"
src: "{{ dn42_bird2_template }}"
notify: reload bird
- name: Ensure birds peer foler exists
file:
path: "/etc/bird/peers"
path: "{{ dn42_bird2_directory }}/peers"
state: directory
owner: "bird"
group: "bird"
- name: Copy birds peer config-files
template:
dest: "/etc/bird/peers/{{ peer.name }}.conf"
dest: "{{ dn42_bird2_directory }}/peers/{{ peer.name }}.conf"
src: "{{ dn42_bird2_peer_template }}"
when: (not peer.state is defined) or peer.state != "absent"
loop: "{{ dn42_peers }}"
@ -30,7 +36,7 @@
- name: Remove bird peer config-files
file:
path: "/etc/bird/peers/{{ peer.name }}.conf"
path: "{{ dn42_bird2_directory }}/peers/{{ peer.name }}.conf"
state: absent
when: peer.state is defined and peer.state == "absent"
loop: "{{ dn42_peers }}"

Loading…
Cancel
Save