bird/tasks/RedHat/8.yaml

40 lines
766 B
YAML
Raw Normal View History

2021-10-25 11:24:40 +00:00
---
2021-10-25 12:26:23 +00:00
- name: Install BIRD
package:
2021-10-25 11:24:40 +00:00
name: bird
state: present
2021-10-25 12:26:23 +00:00
- name: Add BIRD config
2021-10-25 11:24:40 +00:00
template:
src: bird.conf.j2
dest: /etc/bird.conf
notify:
2021-10-25 12:30:39 +00:00
- Reload bird
2021-10-25 11:24:40 +00:00
2021-10-25 11:55:25 +00:00
- name: Add dummy interface and add IPs
community.general.nmcli:
2021-10-25 12:26:23 +00:00
type: dummy
2021-10-25 12:30:39 +00:00
conn_name: "{{ dummy_iface | default('dummy0') }}"
2021-10-25 12:26:23 +00:00
ip4: '{{ item.ip4 }}'
2021-10-25 11:55:25 +00:00
state: present
2021-10-25 11:24:40 +00:00
notify:
2021-10-25 12:30:39 +00:00
- Reload dummy interface
2021-10-25 12:26:23 +00:00
loop: |
[
{% for protocol_static in bird.bgp.static %}
{% for network in protocol_static['networks'][ansible_fqdn] %}
{
"ip4": "{{ network['ip'] + '/' + network['mask_dash'] }}"
},
{% endfor %}
{% endfor %}
]
2021-10-25 11:24:40 +00:00
2021-10-25 12:26:23 +00:00
- name: Start BIRD service
2021-10-25 11:24:40 +00:00
systemd:
name: bird
state: started
enabled: yes
daemon_reload: yes
2021-10-25 12:26:23 +00:00