Merge pull request #87 from PyratLabs/feature-ansible_2.9_support

Add Ansible 2.9 support, instructions for k3s upgrade
This commit is contained in:
Xan Manning 2021-01-24 20:00:02 +00:00 committed by GitHub
commit d4d24aec79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 65 additions and 4 deletions

View File

@ -14,6 +14,14 @@
---
-->
## 2021-01-24, v2.5.0
### Notable changes
- Added support for Ansible >= 2.9.17 #83
---
## 2021-01-23, v2.4.3
### Notable changes

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