node installation

This commit is contained in:
Bernhard Radermacher
2025-08-27 05:54:16 +00:00
parent 0835bea3b7
commit 459d124159
4 changed files with 31 additions and 2 deletions

View File

@@ -1,6 +1,9 @@
all: all:
vars: vars:
timezone_name: UTC timezone_name: UTC
k3s_server: "https://192.168.112.40:6443"
k3s_token: "K10ecaf0e2b11256207b74fa7293e1c6812ef54d5b0d8461a315837660109c4a61d::server:f2041e2d15ed15c0569bab40357e6047"
nodes: nodes:
hosts: hosts:
@@ -13,8 +16,8 @@ nodes:
node3: node3:
ansible_host: node3.pi-cluster.bwr.net ansible_host: node3.pi-cluster.bwr.net
controllers: server:
hosts: hosts:
controller0: server0:
ansible_host: pi-cluster.bwr.net ansible_host: pi-cluster.bwr.net

View File

@@ -0,0 +1,8 @@
---
---
- name: Install k3s Node (agent)
hosts: nodes
gather_facts: false
roles:
- role: k3s-node

View File

@@ -0,0 +1,16 @@
---
- name: Copy Configuration
ansible.builtin.template:
src: config.yaml.j2
dest: /etc/rancher/k3s/config.yaml
owner: root
group: root
mode: "644"
become: True
- name: Run Installation
ansible.builtin.command:
cmd: curl -sfL https://get.k3s.io | sh -s - agent
creates: /etc/systemd/system/k3s-agent.service
become: True

View File

@@ -0,0 +1,2 @@
token: "{{ k3s_token }}"
server: "{{ k3s_server }}"