Files
provisioning/ansible-5/roles/k3s/tasks/install.yml
richard d0d8876c43 kube-cluster-update playbook
update k3s version to 1.29
2025-08-16 20:58:08 -04:00

31 lines
675 B
YAML

---
# install k3s
- name: Install required packages
apt:
name: "{{ item }}"
update_cache: yes
cache_valid_time: 3600
state: latest
with_items:
- curl
- bash-completion
- name: Fetch k3s install script
ansible.builtin.uri:
url: https://get.k3s.io
return_content: yes
register: k3s_installer
- name: Run installer
async: 300
poll: 10
ansible.builtin.shell:
cmd: INSTALL_K3S_VERSION={{k3s_version}}+k3s1 sh -s --
stdin: "{{ k3s_installer.content }}"
#- name: Setup bash completion
# ansible.builtin.shell:
# cmd: "kubectl completion bash >/etc/bash_completion.d/kubectl"
# creates: /etc/bash_completion.d/kubectl