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

Merge branch 'fix/create-l3-geant-ip' into 'develop'

Fix/create l3 geant ip

See merge request !202
parents 7b4af4b6 f900689c
No related branches found
No related tags found
1 merge request!202Fix/create l3 geant ip
Pipeline #90880 passed
Showing
with 158 additions and 0 deletions
...@@ -2,6 +2,23 @@ ...@@ -2,6 +2,23 @@
hosts: all hosts: all
gather_facts: false gather_facts: false
tasks: tasks:
- name: Check SBP
when: verb == 'check'
ansible.builtin.include_role:
name: service_checks
loop:
"{{ subscription.l3_core_service.ap_list }}"
loop_control:
loop_var: ap
# - name: Check BGP
# # FIX: rewrite
# when: >
# object == 'bgp'
# and
# verb == 'check'
# ansible.builtin.meta: end_play
- name: Generate an ID for this run - name: Generate an ID for this run
ansible.builtin.set_fact: ansible.builtin.set_fact:
opid: "{{ lookup('community.general.random_string', length=18, special=false) }}" opid: "{{ lookup('community.general.random_string', length=18, special=false) }}"
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
{% with bgp_obj=pe_bgp_internal, bgp_group_context='bgp_base' %} {% with bgp_obj=pe_bgp_internal, bgp_group_context='bgp_base' %}
{% include "router/bgp_group.j2" %} {% include "router/bgp_group.j2" %}
{% endwith %} {% endwith %}
{% with bgp_obj=pe_bgp_egeant, bgp_group_context='bgp_base' %}
{% include "router/bgp_group.j2" %}
{% endwith %}
{% else %} {% else %}
{% with bgp_base_obj=p_bgp_base, bgp_obj=p_bgp_internal, bgp_context='bgp_base', {% with bgp_base_obj=p_bgp_base, bgp_obj=p_bgp_internal, bgp_context='bgp_base',
bgp_group_context='bgp_base' %} bgp_group_context='bgp_base' %}
......
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
ansible_port: "{{ router.router_ts_port }}" ansible_port: "{{ router.router_ts_port }}"
when: router.router_access_via_ts | ansible.builtin.bool when: router.router_access_via_ts | ansible.builtin.bool
- name: Set ansible_host back to the {{ inventory_hostname }}
when: not router.router_access_via_ts | ansible.builtin.bool
ansible.builtin.set_fact:
ansible_host: "{{ inventory_hostname }}"
- name: Load netconf connection config - name: Load netconf connection config
ansible.builtin.set_fact: ansible.builtin.set_fact:
ansible_connection: "{{ netconf_access[router.vendor].ansible_connection }}" ansible_connection: "{{ netconf_access[router.vendor].ansible_connection }}"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<description>PHY {{ ep.edge_port_type }} {{ partner_name }} P_{{ ep.edge_port_name }} | {{ member.interface_description }}</description> <description>PHY {{ ep.edge_port_type }} {{ partner_name }} P_{{ ep.edge_port_name }} | {{ member.interface_description }}</description>
<ethernet> <ethernet>
<mode>access</mode> <mode>access</mode>
<encap-type>{{ ep.encapsulation }}</encap-type>
<mtu>{{ mtu_phy | default(9192) }}</mtu> <mtu>{{ mtu_phy | default(9192) }}</mtu>
{% if edge_port_lldp_enable_map[ep.edge_port_type] is true %} {% if edge_port_lldp_enable_map[ep.edge_port_type] is true %}
<lldp> <lldp>
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
<lag 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" alu:operation="replace"> <lag 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" alu:operation="replace">
<lag-name>{{ ep.edge_port_name | lower }}</lag-name> <lag-name>{{ ep.edge_port_name | lower }}</lag-name>
<admin-state>enable</admin-state> <admin-state>enable</admin-state>
<encap-type>{{ ep.encapsulation }}</encap-type>
{% if ep.geant_ga_id is string %} {% if ep.geant_ga_id is string %}
<description>LAG {{ ep.edge_port_type }} {{ partner_name }} ${{ ep.geant_ga_id }} |</description> <description>LAG {{ ep.edge_port_type }} {{ partner_name }} ${{ ep.geant_ga_id }} |</description>
{% else %} {% else %}
......
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 service_checks
sbp_ping_count: 10
sbp_ping_size: 512
galaxy_info:
author: A. Kurbatov
description: GOAT engineer
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: Check BGP neigbor
ansible.netcommon.netconf_rpc:
rpc: action
xmlns: "urn:ietf:params:xml:ns:yang:1"
content: |
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command>
<md-cli-input-line>show router bgp neighbor "{{ neighbor.peer_address }}"</md-cli-input-line>
</md-cli-raw-command>
</global-operations>
display: json
register: out
- name: Show ping results
when: "'nokiaoper:results' in out.output.['rpc-reply']"
ansible.builtin.debug:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
---
# tasks file for service_checks
- name: Ping peer via SBP
when: object == 'sbp'
ansible.builtin.include_tasks: sbp_checks.yaml
loop: "{{ bgp_obj }}"
loop_control:
loop_var: neighbor
- name: Check peer status
when: object == 'bgp'
ansible.builtin.include_tasks: bgp_checks.yaml
loop: "{{ bgp_obj }}"
loop_control:
loop_var: neighbor
---
- name: Perform ping
ansible.netcommon.netconf_rpc:
rpc: action
xmlns: "urn:ietf:params:xml:ns:yang:1"
content: |
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command>
<md-cli-input-line>//ping count {{ sbp_ping_count }} size {{ sbp_ping_size }} rapid {{ neighbor.peer_address }}</md-cli-input-line>
</md-cli-raw-command>
</global-operations>
display: json
register: out
- name: Show ping results
when: "'nokiaoper:results' in out.output.['rpc-reply']"
ansible.builtin.debug:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
---
# vars file for service_checks
bgp_obj: "{{ ap.sbp.bgp_session_list }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment