mirror of
https://github.com/dredx/prole.git
synced 2026-09-27 02:04:30 +00:00
34 lines
794 B
YAML
34 lines
794 B
YAML
---
|
|
- name: Check if k3s service is installed
|
|
ansible.builtin.stat:
|
|
path: /etc/systemd/system/k3s.service
|
|
register: k3s_service
|
|
|
|
- name: Check if k3s binary exists
|
|
ansible.builtin.stat:
|
|
path: /usr/local/bin/k3s
|
|
register: k3s_bin
|
|
|
|
- name: Determine if k3s needs installation
|
|
ansible.builtin.set_fact:
|
|
k3s_needs_install: "{{ not k3s_bin.stat.exists or not k3s_service.stat.exists }}"
|
|
|
|
- name: Install k3s dependencies
|
|
ansible.builtin.package:
|
|
name:
|
|
- curl
|
|
- iptables
|
|
state: present
|
|
|
|
- name: Download k3s install script
|
|
ansible.builtin.get_url:
|
|
url: https://get.k3s.io
|
|
dest: /tmp/k3s_install.sh
|
|
mode: "0755"
|
|
|
|
- name: Ensure k3s service is stopped and disabled
|
|
ansible.builtin.service:
|
|
name: k3s
|
|
state: stopped
|
|
enabled: false
|