dn42-ansible/peerings.yml

43 lines
1.4 KiB
YAML
Raw Normal View History

- name: Configure peerings
hosts: routers
remote_user: root
tasks:
- name: Include per-node peering data
include_vars: "{{ playbook_dir }}/peerings/{{ pop_loc }}.yaml"
ignore_errors: false
- name: Generate systemd .netdev files
ansible.builtin.template:
src: ext-peer.netdev.j2
dest: "/etc/systemd/network/dn42{{ item.remotename }}.netdev"
mode: '0644'
loop: "{{ peers }}"
when: peers is defined
register: netdev_files
- name: Generate systemd .network files
ansible.builtin.template:
src: ext-peer.network.j2
dest: "/etc/systemd/network/dn42{{ item.remotename }}.network"
mode: '0644'
loop: "{{ peers }}"
when: peers is defined
register: network_files
- name: Generate BGP peering files
ansible.builtin.template:
src: ext-peer.bgp.conf.j2
dest: "/etc/bird/peers/dn42{{ item.remotename }}.conf"
mode: '0644'
loop: "{{ peers }}"
register: bgp_files
when: peers is defined
- name: Reload systemd-networkd
ansible.builtin.command: networkctl reload
when: peers is defined
2024-12-25 09:43:27 +00:00
- name: Make sure bird is running
ansible.builtin.systemd_service:
name: bird.service
2024-12-25 09:43:27 +00:00
state: started
when: peers is defined
- name: Reload bird
ansible.builtin.command: birdc configure
when: peers is defined