Files

76 lines
1.6 KiB
YAML

- name: "Ensure bird2 is installed"
ansible.builtin.apt:
state: present
name:
- bird2
- name: "Ensure bird2 is enabled"
ansible.builtin.systemd_service:
name: bird
enabled: true
- name: "Ensure /etc/bird/transits directory is present"
ansible.builtin.file:
path: "/etc/bird/transits"
state: directory
mode: '0755'
owner: root
group: root
- name: "Ensure /etc/bird/internal_peers directory is present"
ansible.builtin.file:
path: "/etc/bird/internal_peers"
state: directory
mode: '0755'
owner: root
group: root
- name: "Ensure /etc/bird/peers directory is present"
ansible.builtin.file:
path: "/etc/bird/peers"
state: directory
mode: '0755'
owner: root
group: root
- name: "Ensure /etc/bird/include directory is present"
ansible.builtin.file:
path: "/etc/bird/include"
state: directory
mode: '0755'
owner: root
group: root
- name: "Ensure /etc/bird/filters directory is present"
ansible.builtin.file:
path: "/etc/bird/filters"
state: directory
mode: '0755'
owner: root
group: root
- name: "Register if /var/log/bird.log exists"
ansible.builtin.stat:
path: "/var/log/bird.log "
register: bird_log_stat_result
- name: "Ensure bird log file exists"
ansible.builtin.file:
path: /var/log/bird.log
state: file
mode: '0644'
owner: bird
group: bird
when: not bird_log_stat_result.stat.exists
- name: "Setup bird2 config"
ansible.builtin.template:
src: bird.conf.j2
dest: /etc/bird/bird.conf
mode: "0644"
notify:
- "Reload bird2"
- name: Flush handlers
meta: flush_handlers