Added 2.9 Ansible support

This commit is contained in:
Xan Manning 2021-01-24 18:21:51 +00:00
parent fc1149ac9e
commit e026d2a4a7
6 changed files with 57 additions and 4 deletions

View file

@ -14,7 +14,7 @@ and [CHANGELOG.md](CHANGELOG.md).
The host you're running Ansible from requires the following Python dependencies:
- `ansible >= 2.10.4`
- `ansbile >= 2.9.17` or `ansible-base >= 2.10.4`
You can install dependencies using the requirements.txt file in this repository:
`pip3 install -r requirements.txt`.

View file

@ -35,5 +35,6 @@ minimum configuration.
### Operations
- [Stop/Start a cluster](operations/stop-start-cluster.md)
- [Updating k3s](operations/updating-k3s.md)
- [Extending a cluster](operations/extending-a-cluster.md)
- [Shrinking a cluster](operations/shrinking-a-cluster.md)

View file

@ -0,0 +1,52 @@
# Updating k3s
## Before you start!
Ensure you back up your k3s cluster. This is particularly important if you use
an external datastore or embedded Etcd. Please refer to the below guide to
backing up your k3s datastore:
https://rancher.com/docs/k3s/latest/en/backup-restore/
Also, check your volume backups are also working!
## Proceedure
### Updates using Ansible
To update via Ansible, set `k3s_release_version` to the target version you wish
to go to. For example, from your `v1.19.3+k3s1` playbook:
```yaml
---
# BEFORE
- name: Provision k3s cluster
hosts: k3s_cluster
roles:
- name: xanmanning.k3s
vars:
k3s_release_version: v1.19.3+k3s1
```
Updating to `v1.20.2+k3s1`:
```yaml
---
# AFTER
- name: Provision k3s cluster
hosts: k3s_cluster
roles:
- name: xanmanning.k3s
vars:
k3s_release_version: v1.20.2+k3s1
```
### Automatic updates
For automatic updates, consider installing Rancher's
[system-upgrade-controller](https://rancher.com/docs/k3s/latest/en/upgrades/automated/)
**Please note**, to be able to update using the system-upgrade-controller you
will need to set `k3s_install_hard_links` to `true`.

View file

@ -20,7 +20,7 @@ galaxy_info:
# - CC-BY
license: BSD
min_ansible_version: '2.10'
min_ansible_version: '2.9'
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

View file

@ -1,6 +1,6 @@
-r ../requirements.txt
molecule[docker]>=3.2.1
molecule[docker]>=3.2
docker>=4.3.1
yamllint>=1.25.0
ansible-lint>=4.3.5

View file

@ -1 +1 @@
ansible>=2.10.4
ansible>=2.9.16,!=2.10.0,!=2.10.1,!=2.10.2,!=2.10.3