--- #- 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