This commit is contained in:
ace 2021-10-25 15:48:40 +03:00
parent 5789b5558a
commit df46625d26
No known key found for this signature in database
GPG Key ID: 2E47CC17BA7F8CF0

View File

@ -1,4 +1,9 @@
---
- name: Install network scripts
package:
name: network-scripts
state: present
- name: Install BIRD
package:
name: bird
@ -11,24 +16,31 @@
notify:
- Reload BIRD
- name: Add dummy interface and add IPs
community.general.nmcli:
type: dummy
conn_name: "{{ dummy_iface | default('dummy0') }}"
ip4: '{{ item.ip4 }}'
state: present
- name: Update ifcfg-lo config
template:
src: ifcfg-lo.j2
dest: /etc/sysconfig/network-scripts/ifcfg-lo
notify:
- Reload dummy interface
loop: |
[
{% for protocol_static in bird.bgp.static %}
{% for network in protocol_static['networks'][ansible_fqdn] %}
{
"ip4": "{{ network['ip'] + '/' + network['mask_dash'] }}"
},
{% endfor %}
{% endfor %}
]
- Restart loopback
#- name: Add dummy interface and add IPs
# community.general.nmcli:
# type: dummy
# conn_name: "{{ dummy_iface | default('dummy0') }}"
# ip4: '{{ item.ip4 }}'
# state: present
# notify:
# - Reload dummy interface
# loop: |
# [
# {% for protocol_static in bird.bgp.static %}
# {% for network in protocol_static['networks'][ansible_fqdn] %}
# {
# "ip4": "{{ network['ip'] + '/' + network['mask_dash'] }}"
# },
# {% endfor %}
# {% endfor %}
# ]
- name: Start BIRD service
systemd: