mirror of
https://gitea.0xace.cc/ansible-galaxy/bird.git
synced 2025-06-29 10:43:20 +00:00
rewrite bird
This commit is contained in:
@ -4,19 +4,12 @@
|
||||
name: bird2
|
||||
state: present
|
||||
|
||||
- name: Update ifcfg-lo config
|
||||
template:
|
||||
src: ifcfg-lo.j2
|
||||
dest: /etc/sysconfig/network-scripts/ifcfg-lo
|
||||
notify:
|
||||
- Restart loopback
|
||||
|
||||
- name: Add BIRD config
|
||||
template:
|
||||
src: bird.conf.j2
|
||||
dest: /etc/bird.conf
|
||||
notify:
|
||||
- Reload bird
|
||||
- Reload BIRD
|
||||
|
||||
- name: Start BIRD service
|
||||
systemd:
|
||||
@ -24,3 +17,4 @@
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
||||
|
@ -4,44 +4,6 @@
|
||||
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 == 'ns'
|
||||
|
||||
|
||||
- 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'
|
||||
|
||||
- name: Add BIRD config
|
||||
template:
|
||||
src: bird.conf.j2
|
||||
|
Reference in New Issue
Block a user