Static URL for VyOS rolling nightly build?

Hello,

I am the co-developer of an open source project on Github, and we leverage VyOS for our edge router. VyOS works really well for us, but we have one nagging issue that we’re hoping the VyOS team can assist us with on their end.

Many years ago when VyOS moved their nightly build downloads to AWS, our automatic download functionality of VyOS broke because the URLs changed with each nightly build. I reached out via Slack (at the time), and the VyOS team was kind enough to modify their build automation to create a file called “vyos-rolling-latest.iso”, which would always be the same as the latest nightly build. This provided us with a static URL we could reference to download the latest ISO. Life was good! :slight_smile:

Later, VyOS moved their nightly build download artifacts to Github, and with that move, the statically named “vyos-rolling-latest.iso” file went away. A while back we made some modifications to our project to determine the latest build, and download it, but it’s caused us issues in other areas.

So, I’m writing today to see if VyOS could once again create a static file called “vyos-rolling-latest.iso”, at a static URL path, that would always be the latest nightly build. It would really make our lives a lot easier, and I’m sure others could leverage it as well.

Any assistance you can provide in making this happen would be greatly appreciated.

Thank you,

Luis

Here are the nightlies:

https://github.com/vyos/vyos-rolling-nightly-builds/releases

Here is the latest nightly:

https://github.com/vyos/vyos-rolling-nightly-builds/releases/latest

And here is a script you can use locally on your VyOS (or elsewhere if you just want to download the latest iso):

#!/bin/vbash

# Include VyOS functions                        
source /opt/vyatta/etc/functions/script-template

# Script debugging
#set -x

# Set variables
VRF=INTERNET
#read -p "Enter path to update-file: " URL
#URL=https://s3-us.vyos.io/rolling/current/vyos-rolling-latest.iso
URL=$(ip vrf exec ${VRF} curl -s "https://api.github.com/repos/vyos/vyos-rolling-nightly-builds/releases/latest" | grep browser_download_url | head -n 1 | cut -d\" -f4)

# Perform stuff
run add system image ${URL} vrf ${VRF}
4 Likes

@Apachez,

Thank you very much for your reply. This is much easier (and cleaner) than what we are currently doing, so we will see about modifying our Ansible playbooks to leverage this method.

Sincerely,

Luis

Hello,

Here is an ansible playbook that I use for upgrading my VyOS router running 1.5 rolling release.

---
- name: VyOS - Install new rolling 1.5 image and schedule machine reboot
  gather_facts: false
  hosts: vyos

  vars:
    take_backup: False
    backup_ssh_username: ""
    backup_ssh_password: ""
    backup_ssh_host: ""
    backup_destination_path: "" #Add the absolut path and start with a /
    backup_destination_filename: ""

  tasks:  

    - name: "Get Latest Release from Github"
      community.general.github_release:
        user: vyos
        repo: vyos-rolling-nightly-builds
        action: latest_release
      register: version
      delegate_to: localhost

    - name: Print Latest Version
      ansible.builtin.debug:
        var: version.tag
      delegate_to: localhost

    - name: "Check whether VyOS {{ version.tag }} is Installed or Not"
      cli_command:
        command: 'show system image | grep {{ version.tag }} | wc -l'
      register: check_installed_value
      changed_when: check_installed_value.stdout == "0"
      ignore_errors: True

    - name: "Backup VyOS Configuration"
      cli_command:
        command: "{{ item }}"
        newline: True
        check_all: True
        prompt:
        - 'Do you wish to continue'
        answer:
        - 'Yes'
      loop:
        - configure
        - save scp://{{ backup_ssh_username }}:{{ backup_ssh_password }}@{{ backup_ssh_host }}:/{{ backup_destination_path }}/{{ backup_destination_filename }}
        - exit
      when: 
        - check_installed_value.stdout != "1"
        - take_backup

    - name: "Installing {{ version.tag }} on system"
      cli_command:
        command: add system image https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/{{ version.tag }}/vyos-{{ version.tag }}-amd64.iso
        newline: True
        check_all: True
        prompt:
        - 'What would you like to name this image'
        - 'Would you like to set the new image as the default one for boot'
        - 'An active configuration was found. Would you like to copy it to the new image'
        - 'Would you like to copy SSH host keys'
        answer:
        - "{{ version.tag }}"
        - 'Yes'
        - 'Yes'
        - 'Yes'
      when: check_installed_value.stdout != "1"
      vars:
        ansible_command_timeout: 120

    - name: Schedule reboot around 04:30 tonight
      cli_command:
        command: "reboot at 04:{{ range(25,35) | random }}"
      when: check_installed_value.stdout != "1"

    - name: "Check Installed System Images"
      cli_command:
        command: 'show system image'
      register: check_installed
      ignore_errors: True

    - name: "Print Installed System Images"
      ansible.builtin.debug:
        var: check_installed.stdout_lines

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.