dn42-ansible/setup.yml

32 lines
981 B
YAML

- name: Configure bird on routers
hosts: routers
remote_user: root
tasks:
- name: Add internal bgp peers
ansible.builtin.template:
src: int-bgp.j2
dest: /etc/bird/peers/internal.conf
mode: '0644'
- name: Add route collector peering
ansible.builtin.copy:
src: collector.conf
dest: /etc/bird/peers/collector.conf
mode: '0644'
- name: Add bird.conf in arch location
ansible.builtin.template:
src: bird-conf.j2
dest: /etc/bird.conf
mode: '0644'
when: ansible_distribution == 'Archlinux'
- name: Add bird.conf in debian location
ansible.builtin.template:
src: bird-conf.j2
dest: /etc/bird/bird.conf
mode: '0644'
when: ansible_distribution == 'Debian'
- name: Reload bird
ansible.builtin.systemd_service:
name: bird.service
enabled: true
state: reloaded
when: ansible_service_mgr == 'systemd'