Upgrade RouterOS packages and firmware
This role handles RouterOS Versions and firmware, both upgrade and downgrade. Upgrades can be done via SFTP push, or via the built-in package update on the MikroTik. Firmware will always be set to match the RouterOS version, as per MikroTik reccomended best practices. Please deploy from tags, not the master branch. Master branch should be considered experimental.
Note - Requires the community.routeros collection. Install via ansible-galaxy collection install -r collections/requirements.yml
- Not suggested for use to switch to testing channel as there could be breaking changes in v7.
- Note, this method will not handle downgrades, just upgrades to the latest release in the
update_channelset by this job. (stable, LTS, beta, testing)
This method is the same as going into winbox and clicking System>Packages>Check for Updates>Download.
- Set the
install_methodvariable tonormal - Set the
update_channelvariable to your desired channel (stable, long-term, development, testing) routeros_versionis not evaluated using Download Method, but will affect validation checks if you want this.- (optional) Adjust the
reboot_timeoutvariable if you have slower connections or waiting for reboots is timing out - (optional) set
validationvariable to true to verify all upgrades after processing. (needs to have routeros_version set also) - Run the job. (Devices will be upgraded, rebooted, firmware upgraded, and rebooted once more.)
- Note, this method can be used to set a specific version of RouterOS. (will handle upgrade or downgrade to achive desired version)
This method will use the router's internet connection to download the specified version .npk file and reboot to install.
- Set the
install_methodvariable todownload - Set the
routeros_versionvariable to the latest version - Set the
update_channelvariable to the desired channel (not actually used but should be set for consistency) - (optional) place the .npk files into the
packages/directory. (Otherwise Ansible will use your hosts internet connection to download them.) - (optional) set
validationvariable to true to verify all upgrades after processing. - Run the job. (Devices will be upgraded, rebooted, firmware upgraded, and rebooted once more.)
- Note, this method can be used to set a specific version of RouterOS. (will handle upgrade or downgrade to achieve desired version)
This method will use the ansible server's internet connection to download the specified version .npk file, transfer the .npk to the router via SFTP, and reboot to install.
- Set the
install_methodvariable topush - Set the
routeros_versionvariable to the latest version - Set the
update_channelvariable to the desired channel (not actually used but should be set for consistency) - (optional) place the .npk files into the
packages/directory. (Otherwise Ansible will use your hosts internet connection to download them.) - (optional) set
validationvariable to true to verify all upgrades after processing. - Run the job. (Devices will be upgraded, rebooted, firmware upgraded, and rebooted once more.)
Please do your own testing with this. I have tested with most of the 6.48 (stable), and 6.47 (LTS) trains, but there are no guarantees. Please understand what this job is doing and what impacts it might have on your environment.
Contributions welcome, just open an issue or pull request.