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

Merge branch 'fix/jisc-migrations' into 'develop'

Fix/jisc migrations

See merge request !215
parents 4083835e 3050caab
No related branches found
No related tags found
1 merge request!215Fix/jisc migrations
Pipeline #91638 passed
...@@ -75,6 +75,38 @@ ...@@ -75,6 +75,38 @@
- name: Compile BGP-related config - name: Compile BGP-related config
when: object == "bgp" when: object == "bgp"
block: block:
- name: Set BGP V4 session object to check for custom policies
ansible.builtin.set_fact:
bgp_session_v4: "{{ ap.sbp | json_query(query) }}"
vars:
query: "bgp_session_list[?ip_type == 'ipv4'] | [0]"
loop:
"{{ subscription.l3_core_service.ap_list }}"
loop_control:
loop_var: ap
- name: Set BGP V6 session object to check for custom policies
ansible.builtin.set_fact:
bgp_session_v6: "{{ ap.sbp | json_query(query) }}"
vars:
query: "bgp_session_list[?ip_type == 'ipv6'] | [0]"
loop:
"{{ subscription.l3_core_service.ap_list }}"
loop_control:
loop_var: ap
- name: Include PIM role if V4 multicast is enabled
when: >
bgp_session_v4.families is contains('mcast-ipv4') or bgp_session_v6 is contains('mcast-ipv6')
and
subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"]
ansible.builtin.include_role:
name: pim
loop:
"{{ subscription.l3_core_service.ap_list }}"
loop_control:
loop_var: ap
- name: Include Prefix-list role - name: Include Prefix-list role
when: subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"] when: subscription.l3_core_service_type in ["GÉANT IP", "GEANT IP", "GEANT_IP"]
ansible.builtin.include_role: ansible.builtin.include_role:
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<aggregate> <aggregate>
<ip-prefix>{{ ag.ip_prefix }}</ip-prefix> <ip-prefix>{{ ag.ip_prefix }}</ip-prefix>
<community>{{ ag.community }}</community> <community>{{ ag.community }}</community>
<discard-component-communities>{{ ag.dcc }}</discard-component-communities> <discard-component-communities>{{ ag.dcc | lower }}</discard-component-communities>
</aggregate> </aggregate>
{% endfor %} {% endfor %}
</aggregates> </aggregates>
......
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
---
# defaults file for pim
galaxy_info:
author: A. Kurbatov
description: GEANT Orchestration and Automation Team
company: GEANT
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: MIT
min_ansible_version: '2.10'
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
galaxy_tags:
- network
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
---
- name: Set ansible host to localhost to compile template
ansible.builtin.set_fact:
ansible_host: "localhost"
ansible_connection: local
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_pim.conf"
# when: verb in ["deploy", "update", "terminate"]
ansible.builtin.template:
src: "pim.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_pim.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
delegate_to: localhost
---
# tasks file for pim
# - name: Merge vars
# ansible.builtin.include_tasks: merge_vars.yaml
#
- name: Include PIM compilation
ansible.builtin.include_tasks: compile.yaml
# - name: Include PIM deployment
# when: is_standalone_run | ansible.builtin.bool
# ansible.builtin.include_tasks: deploy_sbp.yaml
<router xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<router-name>Base</router-name>
<pim xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<interface alu:operation="replace">
<interface-name>{{ lag_name }}.{{ ap.sbp.vlan_id }}</interface-name>
{% if 'mcast-ipv4' in bgp_session_v4.families %}
<ipv4>
<multicast>true</multicast>
</ipv4>
{% endif %}
{% if 'mcast-ipv6' in bgp_session_v6.families %}
<ipv6>
<multicast>true</multicast>
</ipv6>
{% endif %}
</interface>
</pim>
</router>
---
# vars file for pim
is_standalone_run: false
lag_name: "{{ ap.sbp.edge_port.edge_port_name }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment