kube-cluster-update playbook
update k3s version to 1.29
This commit is contained in:
10
ansible-5/playbooks/kube-cluster-update.yaml
Normal file
10
ansible-5/playbooks/kube-cluster-update.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- name: ping
|
||||||
|
hosts: kube
|
||||||
|
gather_facts: true
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- role: k3s
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
k3s_upgrade: true
|
||||||
5
ansible-5/roles/k3s/defaults/main.yml
Normal file
5
ansible-5/roles/k3s/defaults/main.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
# default values for prod.k3s
|
||||||
|
kube_context: home
|
||||||
|
k3s_version: "v1.29.1"
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
# install k3s
|
# install k3s
|
||||||
- name: Install required packages
|
- name: Install required packages
|
||||||
apt:
|
apt:
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
async: 300
|
async: 300
|
||||||
poll: 10
|
poll: 10
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: sh -s --
|
cmd: INSTALL_K3S_VERSION={{k3s_version}}+k3s1 sh -s --
|
||||||
stdin: "{{ k3s_installer.content }}"
|
stdin: "{{ k3s_installer.content }}"
|
||||||
|
|
||||||
#- name: Setup bash completion
|
#- name: Setup bash completion
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
- include_tasks: install.yml
|
- include_tasks: install.yml
|
||||||
when: not k3s_service.stat.exists
|
when: not k3s_service.stat.exists
|
||||||
|
|
||||||
|
- include_tasks: install.yml
|
||||||
|
when: k3s_upgrade == true
|
||||||
|
|
||||||
- name: Start service k3s, if not started
|
- name: Start service k3s, if not started
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: k3s
|
name: k3s
|
||||||
|
|||||||
Reference in New Issue
Block a user