role for installing k3s
This commit is contained in:
23
ansible-5/roles/k3s/tasks/install.yml
Normal file
23
ansible-5/roles/k3s/tasks/install.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
# install k3s
|
||||
- name: Install required packages
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600
|
||||
state: latest
|
||||
with_items:
|
||||
- curl
|
||||
|
||||
- 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: sh -s --
|
||||
stdin: "{{ k3s_installer.content }}"
|
||||
Reference in New Issue
Block a user