Merge "Map nicX abstraction to phys interface name"

This commit is contained in:
Zuul 2021-02-12 10:38:05 +00:00 committed by Gerrit Code Review
commit fb8baf28d9
2 changed files with 22 additions and 2 deletions

View File

@ -1,5 +1,5 @@
--- ---
# Copyright 2020 Red Hat, Inc. # Copyright 2021 Red Hat, Inc.
# All Rights Reserved. # All Rights Reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
@ -23,6 +23,26 @@
selevel: s0 selevel: s0
setype: container_file_t setype: container_file_t
- name: identify the real interfaces via os-net-config
shell: os-net-config -i
register: os_net_config_result
- name: os-net-config from json
set_fact:
iface_map: "{{ os_net_config_result.stdout }}"
- name: FRR uplink interfaces
block:
- name: construct FRR uplink interfaces from os-net-config mappings
set_fact:
tripleo_frr_bgp_uplinks_mapped: "{{ tripleo_frr_bgp_uplinks | map('extract', iface_map) | list }}"
rescue:
- name: failed to construct FRR uplink interfaces
ansible.builtin.fail:
msg: |
Failed to map at least one interface from {{ tripleo_frr_bgp_uplinks }} to {{ iface_map }}.
Please check value of Ansible variable tripleo_frr_bgp_uplinks.
- name: configure FRR - name: configure FRR
become: true become: true
ansible.builtin.template: ansible.builtin.template:

View File

@ -15,7 +15,7 @@ router bgp {{ tripleo_frr_bgp_asn }}
{% if tripleo_frr_bfd %} {% if tripleo_frr_bfd %}
neighbor uplink bfd neighbor uplink bfd
{% endif %} {% endif %}
{% for iface in tripleo_frr_bgp_uplinks %} {% for iface in tripleo_frr_bgp_uplinks_mapped %}
neighbor {{ iface }} interface peer-group uplink neighbor {{ iface }} interface peer-group uplink
{% endfor %} {% endfor %}