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-26 15:12:38 +00:00
|
|
|
- block:
|
|
|
|
- name: Install network scripts
|
|
|
|
package:
|
|
|
|
name: network-scripts
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Update ifcfg-lo config
|
|
|
|
template:
|
|
|
|
src: ifcfg-lo.j2
|
|
|
|
dest: /etc/sysconfig/network-scripts/ifcfg-lo
|
|
|
|
notify:
|
|
|
|
- Restart loopback
|
|
|
|
when: network == 'network-scripts'
|
2021-10-25 12:48:40 +00:00
|
|
|
|
2021-10-26 15:12:38 +00:00
|
|
|
- name: Add dummy interface and add IPs
|
|
|
|
community.general.nmcli:
|
|
|
|
type: dummy
|
|
|
|
conn_name: "{{ network_nm_iface }}"
|
|
|
|
ip4: |
|
|
|
|
[
|
|
|
|
{% set ips = [] %}
|
|
|
|
{% for protocol_static in bird.bgp.static %}
|
|
|
|
{% for network in protocol_static['networks'][ansible_fqdn] %}
|
|
|
|
{{ ips.append(network['ip'] + '/' + network['mask_dash']) }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
"{{ ips | join(',') }}"
|
|
|
|
]
|
|
|
|
state: present
|
|
|
|
notify:
|
|
|
|
- Reload dummy interface
|
|
|
|
when: network == 'nm'
|
2021-10-25 11:24:40 +00:00
|
|
|
|
2021-10-25 12:54:01 +00:00
|
|
|
- name: Add BIRD config
|
|
|
|
template:
|
|
|
|
src: bird.conf.j2
|
|
|
|
dest: /etc/bird.conf
|
|
|
|
notify:
|
|
|
|
- Reload BIRD
|
|
|
|
|
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
|
|
|
|