diff options
| author | omnom62 <omnom62@outlook.com> | 2026-10-16 21:06:09 +1000 |
|---|---|---|
| committer | omnom62 <omnom62@outlook.com> | 2026-10-18 11:44:23 +1000 |
| commit | 509f70682f4a1d20615c876beb1ae81590ff2344 (patch) | |
| tree | 77b40a746b34005fa3498c033f54e370be82a37c /docs | |
| parent | ff3a2771ba7c9a9daf7430ee0862c734b275fea0 (diff) | |
| download | vyos-documentation-509f70682f4a1d20615c876beb1ae81590ff2344.tar.gz vyos-documentation-509f70682f4a1d20615c876beb1ae81590ff2344.zip | |
docs: Ansible example - upgrades with the vyos.blueprints collection
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/configexamples/ansible.md | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/docs/configexamples/ansible.md b/docs/configexamples/ansible.md index d2594b9b..0ea3da90 100644 --- a/docs/configexamples/ansible.md +++ b/docs/configexamples/ansible.md @@ -268,5 +268,45 @@ Backups contain password hashes and keys. The files are created readable only by their owner; keep the backup directory protected as well. ``` +## Upgrades with the vyos.blueprints collection + +The same collection upgrades routers to a new VyOS image, one router at a +time: + +```none +# ansible-playbook vyos.blueprints.upgrade -i hosts \ + -e upgrade_image_url=https://example.com/vyos-1.5.1-generic-amd64.iso \ + -e upgrade_expected_version=1.5.1 +``` + +Replace the URL with the location of your VyOS ISO image, and keep the image's +signature file (`.minisig`) next to it: the signature is checked with the keys +VyOS ships before anything is installed, and the upgrade stops if it is missing +or not valid. To install an image without a signature anyway, add +`-e upgrade_allow_unsigned=true`. Each router downloads the image itself and +needs about 1 GB of free disk space for it. + +For each router, one at a time, the playbook: + +1. skips the router if it already runs the expected version +2. backs up its configuration, as described above +3. downloads the image and checks its signature +4. installs the new image and makes it the default boot image +5. reboots the router and waits until it is back +6. checks that it runs the new version + +If a router fails at any step, the upgrade stops before the next router is +touched, so a bad image never reaches the whole network. Because routers that +are already upgraded are skipped, run the same command again after fixing the +problem. + +To upgrade only some routers, add `-e vyos_upgrade_hosts=<group or host>`. + +```{note} +Try the upgrade on a lab router, or a single router of the network, before +running it on many: a new VyOS image can change behaviour, and the playbook +upgrades one router after the other. +``` + In the next chapter of the example, we'll use Ansible with jinja2 templates and variables. |
