From 104df63f9a182025c26a13212921289007b27311 Mon Sep 17 00:00:00 2001 From: Simon Mayer <49491825+simcod@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:58:05 +0200 Subject: [PATCH] Fix frr download issue (#174) * Fix frr download issue * change permission of python file * Prettify --- roles/sonic/defaults/main.yaml | 7 ++++--- roles/sonic/tasks/frr-reload.yaml | 35 +++++++++++++++++-------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/roles/sonic/defaults/main.yaml b/roles/sonic/defaults/main.yaml index 2867b20b..ea7b260f 100644 --- a/roles/sonic/defaults/main.yaml +++ b/roles/sonic/defaults/main.yaml @@ -1,4 +1,5 @@ --- -branch_name: "202211" -base_url: "https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName={{ branch_name }}&platform=vs" -frr_pythontools_url: "{{ base_url }}&target=target%2Fdebs%2Fbullseye%2Ffrr-pythontools_8.2.2-sonic-0_all.deb" +base_url: "https://raw.githubusercontent.com/FRRouting/frr" +branch_name: "frr-8.2.2" +frr_python_url: "{{ base_url }}/{{ branch_name }}/tools/frr-reload.py" +frr_url: "{{ base_url }}/{{ branch_name }}/tools/frr-reload" diff --git a/roles/sonic/tasks/frr-reload.yaml b/roles/sonic/tasks/frr-reload.yaml index d029f3de..4afc994e 100644 --- a/roles/sonic/tasks/frr-reload.yaml +++ b/roles/sonic/tasks/frr-reload.yaml @@ -4,31 +4,34 @@ port: 2605 state: started -- name: Download frr-pythontools +- name: Download frr-reload.py community.docker.docker_container_exec: container: bgp argv: - curl - --location - - "{{ frr_pythontools_url }}" + - "{{ frr_python_url }}" - --output - - frr-pythontools.deb - chdir: /root + - frr-reload.py + chdir: /usr/lib/frr -- name: Install frr-pythontools +- name: Download frr-reload community.docker.docker_container_exec: container: bgp argv: - - dpkg - - -i - - frr-pythontools.deb - chdir: /root + - curl + - --location + - "{{ frr_url }}" + - --output + - frr-reload + chdir: /usr/lib/frr -- name: Place frr-reload - community.docker.docker_container_copy_into: +- name: Change frr file permissions + community.docker.docker_container_exec: container: bgp - content: | - #!/bin/sh - exec python3 /usr/lib/frr/frr-reload.py --reload /etc/frr/frr.conf - container_path: /usr/lib/frr/frr-reload - mode: "0755" + argv: + - chmod + - "0755" + - frr-reload.py + - frr-reload + chdir: /usr/lib/frr