K3s deploy on Rpis -- Rancher will live in Node

This commit is contained in:
2026-08-05 16:38:28 -05:00
parent 311eb69d33
commit 08f5a533df
9 changed files with 1572 additions and 6 deletions
+46
View File
@@ -0,0 +1,46 @@
---
- name: Rancher directories
become: yes
ansible.builtin.file:
state: directory
path: "{{ item }}"
mode: 0750
owner: root
group: root
loop:
- '/etc/rancher'
- '/etc/rancher/rke2'
- name: Rancher config
become: true
ansible.builtin.template:
src: rancher.config.yaml.j2
dest: /etc/rancher/rke2/config.yaml
owner: root
group: root
mode: 0750
- name: Copy install script
become: yes
ansible.builtin.copy:
src: get-rancher.sh
dest: /usr/local/sbin/get-rancher.sh
owner: root
group: root
mode: 0750
- name: Run install script
become: yes
ansible.builtin.command:
cmd: /usr/local/sbin/get-rancher.sh
- name: Enable rancherd
become: yes
ansible.builtin.service:
name: rancherd
state: restarted
enabled: yes
- debug:
msg: 'Make sure to run `rancherd reset-admin` if this is a new cluster.'