mirror of
https://gitea.0xace.cc/ansible-galaxy/bird.git
synced 2024-11-25 08:06:38 +00:00
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
---
|
|
- name: Install BIRD
|
|
package:
|
|
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
|
|
when: network == 'network-scripts'
|
|
|
|
- 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'
|
|
|
|
- name: Add BIRD config
|
|
template:
|
|
src: bird.conf.j2
|
|
dest: /etc/bird.conf
|
|
notify:
|
|
- Reload BIRD
|
|
|
|
- name: Start BIRD service
|
|
systemd:
|
|
name: bird
|
|
state: started
|
|
enabled: yes
|
|
daemon_reload: yes
|
|
|