mwallraf.oneos_upgrader
oneos_upgrader
This is an Ansible role used to upgrade Ekinops OneAccess devices that run the OneOS software. There are two main versions of OneOS: OneOS 5 and OneOS 6.
OneOS 5 is similar to Cisco IOS-XE, meaning the software image needs to be in flash memory, and a boot command must be given to specify which version to load.
OneOS 6 has both primary and backup software banks, and each one can have different software versions. You need to specify which bank should be the primary before reloading the router.
This role automatically handles upgrades for both OS versions.
Requirements
- ansible.utils
- mwallraf.ekinops
Failures
If there's a failure during the process, the upgrade will stop for that host. This might prevent a report from being generated, and failed hosts won’t appear in the report.
Role tags
There are four tags available to define how the role operates. If no tags are specified, a complete upgrade will be performed:
- report: Run pre-checks and generate a status report (this runs by default).
- staging: Prepare for an upgrade without causing any outages. Usually, you only need to reboot after this process.
- upload: Only upload the necessary files for the upgrade.
- upgrade: Execute all steps needed to complete the upgrade.
Default role variables
These variables are set by default but can be overridden if needed:
- auto_configure_pre_requisites: Automatically configures prerequisites (e.g., enables the SCP server). DEFAULT = true.
Calculated variables
These variables will be calculated based on the provided variables and the current configuration:
- running_os_is_compliant: Tells if the running OS is compliant with the desired OS version.
- boot_os_is_compliant: Indicates if the boot OS is compliant with the desired boot version.
- scp_is_enabled: Shows if SCP is enabled.
Upgrade process
The upgrade process can vary based on the tags used. A full upgrade will be done by default.
Report mode
In report mode, only basic checks will be done, and a report will be generated showing if the router needs an upgrade and if there is enough disk space.
Usage:
ansible-playbook -i hosts playbook.yml --tags report
Playbook tasks include connecting, gathering facts, checking system status, and outputting debug information for each host.
Staging mode
In staging mode, checks are performed, files are uploaded, and the upgrade is prepared without causing any interruptions.
Usage:
ansible-playbook -i hosts playbook.yml --tags staging
Tasks in this mode involve connecting, gathering facts, ensuring sufficient disk space by removing old files if necessary, implementing pre-configuration jobs, uploading files when needed, and preparing the software or boot files if there are no pending upgrades.
It's important to note that if multiple upgrades are required (e.g., BOOT, RECOVERY, OS), they cannot all be staged at once. If there’s enough space, all files will be uploaded. However, loading files can only happen for the first file since it also requires a reboot. Therefore, multi-stage upgrades should be done step-by-step; extra steps will be completed during the upgrade process.