railiance-cluster/ansible/bootstrap.yml

30 lines
706 B
YAML
Raw Normal View History

2025-09-12 01:46:14 +02:00
---
# Stage 1: Harden the server before anything else is installed.
- import_playbook: harden.yml
# Stage 2: Install base packages and k3s.
2025-09-12 01:46:14 +02:00
- name: Railiance host bootstrap
hosts: all
become: true
tasks:
- name: Ensure base packages
apt:
name:
- curl
- git
- jq
update_cache: yes
state: present
- name: Install k3s (server)
shell: |
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --write-kubeconfig-mode=644" sh -
args: { creates: /usr/local/bin/k3s }
- name: Verify k3s node
shell: k3s kubectl get nodes
register: nodes
changed_when: false
- debug: var=nodes.stdout_lines