Compare commits

...

2 Commits

Author SHA1 Message Date
JamesAllenby 781a62c881 refactor: switch to ubuntu 26.04 lts 2026-06-23 21:58:14 +01:00
JamesAllenby 0cc8ea528a style: add yaml editor config 2026-06-23 21:20:28 +01:00
11 changed files with 29 additions and 47 deletions
+4
View File
@@ -12,3 +12,7 @@ indent_style = space
[*.json]
indent_size = 2
indent_style = space
[*.{yml,yaml}]
indent_size = 2
indent_style = space
+1 -6
View File
@@ -15,12 +15,7 @@ tofu-destroy: tofu-init
tofu -chdir={{ opentofu_dir }} apply -auto-approve -destroy
ansible-run-playbook:
ansible-playbook -i ansible/inventory/incus.yaml -c community.general.incus ansible/playbook.yaml
clean:
rm ansible/hosts.ini || true
rm -r ansible/.ssh/ || true
rm admin.conf || true
ansible-playbook -i ansible/inventories/incus/incus.yaml -c community.general.incus ansible/site.yaml
get-admin-conf:
incus exec master-0 -- cat /etc/kubernetes/admin.conf > k8s-admin.conf
+2
View File
@@ -0,0 +1,2 @@
---
ansible_python_interpreter: /usr/bin/python3
@@ -2,4 +2,4 @@
plugin: community.general.incus
strict: true
remotes:
- local:deskpi-cluster
- local:home-infrastructure
-3
View File
@@ -1,3 +0,0 @@
---
- name: Provision with Incus
ansible.builtin.import_playbook: playbooks/common.yaml
-22
View File
@@ -1,22 +0,0 @@
---
- name: Bootstrap - Stage 1
hosts: all
gather_facts: false
tasks:
- name: Install Python 3
ansible.builtin.raw: |
if ! command -v python3 >/dev/null 2>&1; then
apk add --no-cache python3
fi
register: apk_result
changed_when: "'OK' in apk_result.stdout or 'Installing' in apk_result.stdout"
- name: Bootstrap - Stage 2
hosts: all
tasks:
- name: Install Python 3 Libraries
ansible.builtin.package:
name: "{{ item }}"
loop:
- py3-yaml
- py3-kubernetes
+3
View File
@@ -0,0 +1,3 @@
---
- name: Install required provision packages
ansible.builtin.import_tasks: packages.yaml
+5
View File
@@ -0,0 +1,5 @@
---
- name: Upgrade all packages
ansible.builtin.package:
name: '*'
state: latest
+5
View File
@@ -0,0 +1,5 @@
---
- name: Common
hosts: all
roles:
- common
-9
View File
@@ -11,15 +11,6 @@ PACKAGES="dropbear openssh-sftp-server python3 py3-yaml py3-kubernetes cloud-uti
apk update && apk upgrade
apk add ${PACKAGES}
# Enable and start services
enable_and_start() {
service="$1"
rc-update add "${service}" default
service "${service}" start
}
enable_and_start dropbear
# increase root partition size
root_dev=$(readlink -f /dev/root)
disk=$(lsblk -no pkname "$root_dev")
+8 -6
View File
@@ -9,6 +9,8 @@ locals {
master_count = 2
worker_count = 0
image = "ubuntu/26.04"
}
# ---------
@@ -16,16 +18,16 @@ locals {
# ---------
resource "incus_project" "this" {
name = "deskpi-cluster"
description = "The emulated DeskPi Super6C stack."
name = "home-infrastructure"
description = "An emulated home infrastructure stack."
}
resource "incus_image" "alpine" {
resource "incus_image" "this" {
project = incus_project.this.name
source_image = {
remote = "images"
name = "alpine/edge"
name = local.image
type = "virtual-machine"
}
}
@@ -76,7 +78,7 @@ resource "incus_instance" "master" {
project = incus_project.this.name
type = "virtual-machine"
image = incus_image.alpine.fingerprint
image = incus_image.this.fingerprint
profiles = [incus_profile.this.name]
wait_for {
@@ -127,7 +129,7 @@ resource "incus_instance" "worker" {
project = incus_project.this.name
type = "virtual-machine"
image = incus_image.alpine.fingerprint
image = incus_image.this.fingerprint
profiles = [incus_profile.this.name]
wait_for {