Skip to content
Snippets Groups Projects
Commit 6d2140ef authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

`policy_options`: changes to the nren communities calculation

If NREN custom ASN is defined for LHCONE, use it for the _BLOCK
community; skip the NREN community.
parent 7585cee5
Branches
Tags
1 merge request!263Use custom ASN if defined in inventory
Pipeline #93767 passed
--- ---
# When custom ASN is defined in partner general.yaml inventory for LHCONE,
# this is used for only _BLOCK community to configure, the GEANT_<NREN>
# community will stay standard with the standard partner's ASN.
#
- name: Set NREN community names - name: Set NREN community names
when: not subscription.product.product_type | upper in ['LHCONE'] when: not subscription.product.product_type | upper in ['LHCONE']
ansible.builtin.set_fact: ansible.builtin.set_fact:
...@@ -6,18 +10,42 @@ ...@@ -6,18 +10,42 @@
- name: Set NREN community names - name: Set NREN community names
when: subscription.product.product_type | upper in ['LHCONE'] when: subscription.product.product_type | upper in ['LHCONE']
ansible.builtin.set_fact: block:
nren_community_names: ["GEANT_{{ partner_name | upper }}", "LHCONE_{{ partner_name | upper }}_BLOCK"] - name: Set standard NREN community names
when: not partner[subscription.product.product_type | upper].asn is defined
ansible.builtin.set_fact:
nren_community_names: ["GEANT_{{ partner_name | upper }}", "LHCONE_{{ partner_name | upper }}_BLOCK"]
- name: Set NREN community values (2-byte ASN) - name: Set custom NREN community names
when: (partner.asn | int) < 65536 when: partner[subscription.product.product_type | upper].asn is defined
ansible.builtin.set_fact: ansible.builtin.set_fact:
nren_community_values: ["{{ geant_re_as_number }}:{{ partner.asn }}", "{{ bgp.block_community_prefix }}:{{ partner.asn }}"] nren_community_names: ["LHCONE_{{ partner_name | upper }}_BLOCK"]
- name: Set NREN community values (4-byte ASN) - name: Set NREN communities values using "partner.asn"
when: (partner.asn | int) > 65535 when: not partner[subscription.product.product_type | upper].asn is defined
ansible.builtin.set_fact: block:
nren_community_values: ["origin:{{ partner.asn }}:{{ geant_re_as_number }}", "origin:{{ partner.asn }}:{{ bgp.block_community_prefix }}"] - name: Set NREN community values (2-byte ASN)
when: (partner.asn | int) < 65536
ansible.builtin.set_fact:
nren_community_values: ["{{ geant_re_as_number }}:{{ partner.asn }}", "{{ bgp.block_community_prefix }}:{{ partner.asn }}"]
- name: Set NREN community values (4-byte ASN)
when: (partner.asn | int) > 65535
ansible.builtin.set_fact:
nren_community_values: ["origin:{{ partner.asn }}:{{ geant_re_as_number }}", "origin:{{ partner.asn }}:{{ bgp.block_community_prefix }}"]
- name: Set NREN communities values using {{partner[subscription.product.product_type | upper]}}.asn
when: partner[subscription.product.product_type | upper].asn is defined
block:
- name: Set NREN community values (2-byte ASN)
when: (partner[subscription.product.product_type | upper].asn | int) < 65536
ansible.builtin.set_fact:
nren_community_values: ["{{ bgp.block_community_prefix }}:{{ partner[subscription.product.product_type | upper].asn }}"]
- name: Set NREN community values (4-byte ASN)
when: (partner[subscription.product.product_type | upper].asn | int) > 65535
ansible.builtin.set_fact:
nren_community_values: ["origin:{{ partner[subscription.product.product_type | upper].asn }}:{{ bgp.block_community_prefix }}"]
- name: Create a list of NREN communities - name: Create a list of NREN communities
ansible.builtin.set_fact: ansible.builtin.set_fact:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment