bird/tasks/RedHat/8.yaml

58 lines
1.2 KiB
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
- 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
2021-10-26 15:59:44 +00:00
when: network == 'ns'
2021-10-25 12:48:40 +00:00
2021-10-26 15:51:16 +00:00
- block:
- name: BGP IPs string for nmcli
set_fact:
ips: |-
{%- set ips_list = [] %}
{%- for protocol_static in bird.bgp.static %}
{%- for network in protocol_static['networks'][ansible_fqdn] %}
{{ ips_list.append(network['ip'] + '/' + network['mask_dash']) }}
{%- endfor %}
{%- endfor %}
{{ ips_list | join(', ') }}
- name: Add dummy interface and add IPs
community.general.nmcli:
type: dummy
conn_name: "{{ network_nm_iface }}"
ip4: "{{ ips }}"
mtu: "{{ network_nm_iface_mtu }}"
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