forked from ansible_roles/dn42
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
YAML
47 lines
1.0 KiB
YAML
---
|
|
#- import_tasks: bird-repos.yml
|
|
- name: Install bird2
|
|
apt:
|
|
name: "bird2"
|
|
state: present
|
|
|
|
- name: Copy bird config-file
|
|
template:
|
|
dest: /etc/bird/bird.conf
|
|
src: "{{ dn42_bird2_template }}"
|
|
notify: reload bird
|
|
|
|
- name: Ensure birds peer foler exists
|
|
file:
|
|
path: "/etc/bird/peers"
|
|
state: directory
|
|
owner: "bird"
|
|
group: "bird"
|
|
|
|
- name: Copy birds peer config-files
|
|
template:
|
|
dest: "/etc/bird/peers/{{ peer.name }}.conf"
|
|
src: "{{ dn42_bird2_peer_template }}"
|
|
when: (not peer.state is defined) or peer.state != "absent"
|
|
loop: "{{ dn42_peers }}"
|
|
loop_control:
|
|
loop_var: "peer"
|
|
notify: reload bird
|
|
|
|
- name: Remove bird peer config-files
|
|
file:
|
|
path: "/etc/bird/peers/{{ peer.name }}.conf"
|
|
state: absent
|
|
when: peer.state is defined and peer.state == "absent"
|
|
loop: "{{ dn42_peers }}"
|
|
loop_control:
|
|
loop_var: "peer"
|
|
notify: reload bird
|
|
|
|
- name: Ensure bird service is enabled and started
|
|
systemd:
|
|
name: "bird.service"
|
|
enabled: yes
|
|
state: started
|
|
|