mirror of
https://gitea.0xace.cc/ansible-galaxy/bird.git
synced 2024-11-25 08:06:38 +00:00
40 lines
732 B
YAML
40 lines
732 B
YAML
---
|
|
- name: Install BIRD
|
|
package:
|
|
name: bird
|
|
state: present
|
|
|
|
- name: Add BIRD config
|
|
template:
|
|
src: bird.conf.j2
|
|
dest: /etc/bird.conf
|
|
notify:
|
|
- reload bird
|
|
|
|
- name: Add dummy interface and add IPs
|
|
community.general.nmcli:
|
|
type: dummy
|
|
conn_name: 'lo0'
|
|
ip4: '{{ item.ip4 }}'
|
|
state: present
|
|
notify:
|
|
- reload dummy interface
|
|
loop: |
|
|
[
|
|
{% for protocol_static in bird.bgp.static %}
|
|
{% for network in protocol_static['networks'][ansible_fqdn] %}
|
|
{
|
|
"ip4": "{{ network['ip'] + '/' + network['mask_dash'] }}"
|
|
},
|
|
{% endfor %}
|
|
{% endfor %}
|
|
]
|
|
|
|
- name: Start BIRD service
|
|
systemd:
|
|
name: bird
|
|
state: started
|
|
enabled: yes
|
|
daemon_reload: yes
|
|
|