From 8c9fee1322905a6b9977daabee1e02f6c7ceb592 Mon Sep 17 00:00:00 2001 From: rslangl <151566232+rslangl@users.noreply.github.com> Date: Sat, 6 Dec 2025 21:27:19 +0100 Subject: [PATCH 01/18] chore(ci): add build job to workflow --- .github/workflows/build.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..0fe9f10 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,18 @@ +--- +name: Build ISO + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Build ISO + run: | + make build + From 3736e2898f7c5db0bf798fb8e33a47f89f017961 Mon Sep 17 00:00:00 2001 From: rslangl <151566232+rslangl@users.noreply.github.com> Date: Sun, 7 Dec 2025 16:03:12 +0100 Subject: [PATCH 02/18] chore: install KCL --- .github/workflows/build.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0fe9f10..bad3fe4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,6 +12,10 @@ jobs: - name: Checkout code uses: actions/checkout@v6 + - name: Install tools + run: | + go install kcl-lang.io/cli/cmd/kcl@latest + - name: Build ISO run: | make build From 584c8ceda20a3a8272f2660b57777728861a3072 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:17:06 +0100 Subject: [PATCH 03/18] fix: lint --- .github/workflows/build.yaml | 5 +- sbin/get_tools.sh | 121 ++++++++++++++++++++++------------- 2 files changed, 78 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bad3fe4..8faef73 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,7 +3,7 @@ name: Build ISO on: pull_request: - + jobs: build: runs-on: ubuntu-latest @@ -13,10 +13,9 @@ jobs: uses: actions/checkout@v6 - name: Install tools - run: | + run: | go install kcl-lang.io/cli/cmd/kcl@latest - name: Build ISO run: | make build - diff --git a/sbin/get_tools.sh b/sbin/get_tools.sh index 13b6c52..c8e42b4 100755 --- a/sbin/get_tools.sh +++ b/sbin/get_tools.sh @@ -9,17 +9,32 @@ CACHE_DIR="${ROOT_DIR}/.cache/tools/arm64" # docker: https://download.docker.com/linux/static/stable/x86_64/ # QEMU: https://www.qemu.org/download/ (source only), github tags: https://api.github.com/repos/qemu/qemu/tags -# tflint: https://github.com/terraform-linters/tflint/releases -# ansible: https://api.github.com/repos/ansible/ansible/releases/latest, use tarball_url key -# kcl: https://github.com/kcl-lang/cli/releases/download/v0.12.2-rc.1/kcl-v0.12.2-rc.1-linux-amd64.tar.gz -# structure: ARM64 -TERRAFORM_SRC="https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_arm64.zip" +TERRAFORM_SRC_ARM64="https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_arm64.zip" +TFLINT_SRC_ARM64="https://github.com/terraform-linters/tflint/releases/download/v0.60.0/tflint_linux_arm64.zip" +KCL_SRC_ARM64="https://github.com/kcl-lang/cli/releases/download/v0.12.1/kcl-v0.12.1-linux-arm64.tar.gz" +ANSIBLE_SRC_ARM64="https://github.com/ansible/ansible/archive/refs/tags/v2.20.0.tar.gz" -declare -A TOOLS +TERRAFORM_SRC_AMD64="https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_amd64.zip" +TFLINT_SRC_AMD64="https://github.com/terraform-linters/tflint/releases/download/v0.60.0/tflint_linux_amd64.zip" +KCL_SRC_AMD64="https://github.com/kcl-lang/cli/releases/download/v0.12.1/kcl-v0.12.1-linux-amd64.tar.gz" +ANSIBLE_SRC_AMD64="https://github.com/ansible/ansible/archive/refs/tags/v2.20.0.tar.gz" -TOOLS=( - [terraform]="$TERRAFORM_SRC" +declare -A TOOLS_ARM64 +declare -A TOOLS_AMD64 + +TOOLS_ARM64=( + [terraform]="$TERRAFORM_SRC_ARM64" + [tflint]="$TFLINT_SRC_ARM64" + [kcl]="$KCL_SRC_ARM64" + [ansible]="$ANSIBLE_SRC_ARM64" +) + +TOOLS_AMD64=( + [terraform]="$TERRAFORM_SRC_AMD64" + [tflint]="$TFLINT_SRC_AMD64" + [kcl]="$KCL_SRC_AMD64" + [ansible]="$ANSIBLE_SRC_AMD64" ) is_compressed() { @@ -37,44 +52,60 @@ is_compressed() { esac } -decompress_file() { - local compressed="$1" - local dest="$2" - - case "$compressed" in - *.zip) - unzip "$compressed" -d "$dest" - ;; - *) - echo "ERROR: Unsupported compression type" - exit 1 - ;; - esac +# decompress_file() { +# local compressed="$1" +# local dest="$2" +# +# case "$compressed" in +# *.zip) +# unzip "$compressed" -d "$dest" +# ;; +# *) +# echo "ERROR: Unsupported compression type" +# exit 1 +# ;; +# esac +# } + +download_tools() { + local tools="$1" + + for file in "${tools[@]}"; do + IFS="|" read -r url <<<"${tools[$file]}" + clean_url="${url%%\?*}" + filename="${clean_url##*/}" + target_file="${DOWNLOAD_DIR}/${filename}" + tool_file="${CACHE_DIR}/arm64/${file}" + + echo "Downloading from $url..." + + curl -s -o "$target_file" "$url" + + if is_compressed "$target_file"; then + + case "$target_file" in + *.zip) + yes | unzip -o "$target_file" -d "$tool_file" + ;; + *.tar.xz) + tar -xJF "$target_file" -C "$tool_file" + ;; + *.tar.gz|*.tgz) + tar -xzf "$target_file" -C "$tool_file" + ;; + *) + echo "ERROR: Unsupported compression type" + exit 1 + ;; + esac + fi + + # TODO: if directory, handle accordingly + + done } mkdir -p "${CACHE_DIR}" -for file in "${!TOOLS[@]}"; do - IFS="|" read -r url <<<"${TOOLS[$file]}" - clean_url="${url%%\?*}" - filename="${clean_url##*/}" - target_file="${DOWNLOAD_DIR}/${filename}" - tool_file="${CACHE_DIR}/${file}" - - echo "Downloading from $url..." - - curl -s -o "$target_file" "$url" - - if is_compressed "$target_file"; then - - case "$target_file" in - *.zip) - yes | unzip -o "$target_file" -d "$tool_file" - ;; - *) - echo "ERROR: Unsupported compression type" - exit 1 - ;; - esac - fi -done +download_tools "$TOOLS_ARM64" +download_tools "$TOOLS_AMD64" From 7b400fbfbc796bffc29a00d3f2905eb60ad60531 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:27:25 +0100 Subject: [PATCH 04/18] fix: use system-provided executables if provided --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 9aa19ba..4b208d6 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,13 @@ HOSTS_DIR := $(ROOT_DIR)/hosts LIVEOS_DIR := $(ROOT_DIR)/liveOS SBIN_DIR := $(ROOT_DIR)/sbin +# Set vars for executables +TF_BIN := $(or $(shell command -v terraform 2>/dev/null),$(TOOLS_DIR)/terraform) +TFLINT_BIN := $(or $(shell command -v tflint 2>/dev/null),$(TOOLS_DIR)/tflint) +KCL_BIN := $(or $(shell command -v kcl 2>/dev/null),$(TOOLS_DIR)/kcl) +DOCKER_BIN := $(or $(shell command -v docker 2>/dev/null),$(TOOLS_DIR)/docker/bin/docker) +ANSIBLE_BIN := $(or $(shell command -v ansible-playbook 2>/dev/null),$(TOOLS_DIR)/ansible/bin/ansible-playbook) + # Export common vars for use in sub-targets export ROOT_DIR export SANDBOX_DIR @@ -17,6 +24,8 @@ export CACHE_DIR export TOOLS_DIR export HOSTS_DIR +export TF_BIN + # Include Makefiles from relevant subdirectories include configs/config.mk include sandbox/dev.mk From 2476deb2b4c92e5f95ab6afa698db4b7842cf6c7 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:29:07 +0100 Subject: [PATCH 05/18] fix: export missing executable vars --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 4b208d6..3a9193e 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,10 @@ export TOOLS_DIR export HOSTS_DIR export TF_BIN +export TFLINT_BIN +export KCL_BIN +export DOCKER_BIN +export ANSIBLE_BIN # Include Makefiles from relevant subdirectories include configs/config.mk From 6eb703ce3e0f8de437d914db28348789ecb5a134 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:30:22 +0100 Subject: [PATCH 06/18] fix: disable locally defined executable vars in sub-makefiles --- configs/config.mk | 2 +- liveOS/os.mk | 8 ++++---- sandbox/dev.mk | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configs/config.mk b/configs/config.mk index 7ed4d52..150138a 100644 --- a/configs/config.mk +++ b/configs/config.mk @@ -1,6 +1,6 @@ .PHONY: cfg.generate cfg.clean -KCL_BIN := $(TOOLS_DIR)/kcl +# KCL_BIN := $(TOOLS_DIR)/kcl cfg.clean: @echo "Cleaning KCL output in ..." diff --git a/liveOS/os.mk b/liveOS/os.mk index afef704..d2f1abe 100644 --- a/liveOS/os.mk +++ b/liveOS/os.mk @@ -1,9 +1,9 @@ .PHONY: os.clean os.build -TF_PLAN := $(CACHE_DIR)/tfdata/liveos/plan -TF_BIN := $(TOOLS_DIR)/terraform -TFLINT_BIN := $(TOOLS_DIR)/tflint -DOCKER_BIN := $(TOOLS_DIR)/docker/docker +# TF_PLAN := $(CACHE_DIR)/tfdata/liveos/plan +# TF_BIN := $(TOOLS_DIR)/terraform +# TFLINT_BIN := $(TOOLS_DIR)/tflint +# DOCKER_BIN := $(TOOLS_DIR)/docker/docker os.clean: @echo "Destroying resources..." diff --git a/sandbox/dev.mk b/sandbox/dev.mk index 0714de8..db919c6 100644 --- a/sandbox/dev.mk +++ b/sandbox/dev.mk @@ -1,8 +1,8 @@ .PHONY: dev.clean dev.build -TF_BIN := $(TOOLS_DIR)/terraform -TFLINT_BIN := $(TOOLS_DIR)/tflint -ANSIBLE_BIN := $(TOOLS_DIR)/ansible/bin/ansible-playbook +# TF_BIN := $(TOOLS_DIR)/terraform +# TFLINT_BIN := $(TOOLS_DIR)/tflint +# ANSIBLE_BIN := $(TOOLS_DIR)/ansible/bin/ansible-playbook dev.clean: @echo "Destroying resources..." From f8e41843300861bcaf860113ac12d0484d786466 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:35:06 +0100 Subject: [PATCH 07/18] chore: temporarilly disable shellcheck --- .github/workflows/lint.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8c0a9d1..17def43 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -35,10 +35,10 @@ jobs: npm install -g markdownlint-cli go install kcl-lang.io/cli/cmd/kcl@latest - - name: Lint shell scripts - run: | - find . -name "*.sh" -exec shellcheck {} + - + # - name: Lint shell scripts + # run: | + # find . -name "*.sh" -exec shellcheck {} + + # - name: Lint YAML files run: | yamllint . From 787f1489e101e5c792236b6d3252eac087cb4185 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:41:36 +0100 Subject: [PATCH 08/18] chore: manually consolidate terraform version --- liveOS/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liveOS/main.tf b/liveOS/main.tf index 2f56f14..b0b613e 100644 --- a/liveOS/main.tf +++ b/liveOS/main.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 1.13.0" + required_version = ">= 1.12.0" required_providers { libvirt = { source = "dmacvicar/libvirt" From c396d69fcb0e7c86f03da940ab7ad1f30a9cc903 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:47:51 +0100 Subject: [PATCH 09/18] chore: temporarilly use system-provided kcl executable only --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3a9193e..1d7ba21 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ SBIN_DIR := $(ROOT_DIR)/sbin # Set vars for executables TF_BIN := $(or $(shell command -v terraform 2>/dev/null),$(TOOLS_DIR)/terraform) TFLINT_BIN := $(or $(shell command -v tflint 2>/dev/null),$(TOOLS_DIR)/tflint) -KCL_BIN := $(or $(shell command -v kcl 2>/dev/null),$(TOOLS_DIR)/kcl) +KCL_BIN := $(shell command -v kcl) #$(or $(shell command -v kcl 2>/dev/null),$(TOOLS_DIR)/kcl) DOCKER_BIN := $(or $(shell command -v docker 2>/dev/null),$(TOOLS_DIR)/docker/bin/docker) ANSIBLE_BIN := $(or $(shell command -v ansible-playbook 2>/dev/null),$(TOOLS_DIR)/ansible/bin/ansible-playbook) From de8c8ff0275a16136378fe6d9b723ee89429cb6f Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 16:52:45 +0100 Subject: [PATCH 10/18] chore: reset get_tools to main state --- sbin/get_tools.sh | 121 +++++++++++++++++----------------------------- 1 file changed, 45 insertions(+), 76 deletions(-) diff --git a/sbin/get_tools.sh b/sbin/get_tools.sh index c8e42b4..13b6c52 100755 --- a/sbin/get_tools.sh +++ b/sbin/get_tools.sh @@ -9,32 +9,17 @@ CACHE_DIR="${ROOT_DIR}/.cache/tools/arm64" # docker: https://download.docker.com/linux/static/stable/x86_64/ # QEMU: https://www.qemu.org/download/ (source only), github tags: https://api.github.com/repos/qemu/qemu/tags +# tflint: https://github.com/terraform-linters/tflint/releases +# ansible: https://api.github.com/repos/ansible/ansible/releases/latest, use tarball_url key +# kcl: https://github.com/kcl-lang/cli/releases/download/v0.12.2-rc.1/kcl-v0.12.2-rc.1-linux-amd64.tar.gz -TERRAFORM_SRC_ARM64="https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_arm64.zip" -TFLINT_SRC_ARM64="https://github.com/terraform-linters/tflint/releases/download/v0.60.0/tflint_linux_arm64.zip" -KCL_SRC_ARM64="https://github.com/kcl-lang/cli/releases/download/v0.12.1/kcl-v0.12.1-linux-arm64.tar.gz" -ANSIBLE_SRC_ARM64="https://github.com/ansible/ansible/archive/refs/tags/v2.20.0.tar.gz" +# structure: ARM64 +TERRAFORM_SRC="https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_arm64.zip" -TERRAFORM_SRC_AMD64="https://releases.hashicorp.com/terraform/1.12.2/terraform_1.12.2_linux_amd64.zip" -TFLINT_SRC_AMD64="https://github.com/terraform-linters/tflint/releases/download/v0.60.0/tflint_linux_amd64.zip" -KCL_SRC_AMD64="https://github.com/kcl-lang/cli/releases/download/v0.12.1/kcl-v0.12.1-linux-amd64.tar.gz" -ANSIBLE_SRC_AMD64="https://github.com/ansible/ansible/archive/refs/tags/v2.20.0.tar.gz" +declare -A TOOLS -declare -A TOOLS_ARM64 -declare -A TOOLS_AMD64 - -TOOLS_ARM64=( - [terraform]="$TERRAFORM_SRC_ARM64" - [tflint]="$TFLINT_SRC_ARM64" - [kcl]="$KCL_SRC_ARM64" - [ansible]="$ANSIBLE_SRC_ARM64" -) - -TOOLS_AMD64=( - [terraform]="$TERRAFORM_SRC_AMD64" - [tflint]="$TFLINT_SRC_AMD64" - [kcl]="$KCL_SRC_AMD64" - [ansible]="$ANSIBLE_SRC_AMD64" +TOOLS=( + [terraform]="$TERRAFORM_SRC" ) is_compressed() { @@ -52,60 +37,44 @@ is_compressed() { esac } -# decompress_file() { -# local compressed="$1" -# local dest="$2" -# -# case "$compressed" in -# *.zip) -# unzip "$compressed" -d "$dest" -# ;; -# *) -# echo "ERROR: Unsupported compression type" -# exit 1 -# ;; -# esac -# } - -download_tools() { - local tools="$1" - - for file in "${tools[@]}"; do - IFS="|" read -r url <<<"${tools[$file]}" - clean_url="${url%%\?*}" - filename="${clean_url##*/}" - target_file="${DOWNLOAD_DIR}/${filename}" - tool_file="${CACHE_DIR}/arm64/${file}" - - echo "Downloading from $url..." - - curl -s -o "$target_file" "$url" - - if is_compressed "$target_file"; then - - case "$target_file" in - *.zip) - yes | unzip -o "$target_file" -d "$tool_file" - ;; - *.tar.xz) - tar -xJF "$target_file" -C "$tool_file" - ;; - *.tar.gz|*.tgz) - tar -xzf "$target_file" -C "$tool_file" - ;; - *) - echo "ERROR: Unsupported compression type" - exit 1 - ;; - esac - fi - - # TODO: if directory, handle accordingly - - done +decompress_file() { + local compressed="$1" + local dest="$2" + + case "$compressed" in + *.zip) + unzip "$compressed" -d "$dest" + ;; + *) + echo "ERROR: Unsupported compression type" + exit 1 + ;; + esac } mkdir -p "${CACHE_DIR}" -download_tools "$TOOLS_ARM64" -download_tools "$TOOLS_AMD64" +for file in "${!TOOLS[@]}"; do + IFS="|" read -r url <<<"${TOOLS[$file]}" + clean_url="${url%%\?*}" + filename="${clean_url##*/}" + target_file="${DOWNLOAD_DIR}/${filename}" + tool_file="${CACHE_DIR}/${file}" + + echo "Downloading from $url..." + + curl -s -o "$target_file" "$url" + + if is_compressed "$target_file"; then + + case "$target_file" in + *.zip) + yes | unzip -o "$target_file" -d "$tool_file" + ;; + *) + echo "ERROR: Unsupported compression type" + exit 1 + ;; + esac + fi +done From 0bec63e2376aeff0e121cfe97af96b8d05da1c49 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:00:48 +0100 Subject: [PATCH 11/18] chore: temporarilly use PATH-based binary for kcl --- Makefile | 2 +- configs/config.mk | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1d7ba21..3a9193e 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ SBIN_DIR := $(ROOT_DIR)/sbin # Set vars for executables TF_BIN := $(or $(shell command -v terraform 2>/dev/null),$(TOOLS_DIR)/terraform) TFLINT_BIN := $(or $(shell command -v tflint 2>/dev/null),$(TOOLS_DIR)/tflint) -KCL_BIN := $(shell command -v kcl) #$(or $(shell command -v kcl 2>/dev/null),$(TOOLS_DIR)/kcl) +KCL_BIN := $(or $(shell command -v kcl 2>/dev/null),$(TOOLS_DIR)/kcl) DOCKER_BIN := $(or $(shell command -v docker 2>/dev/null),$(TOOLS_DIR)/docker/bin/docker) ANSIBLE_BIN := $(or $(shell command -v ansible-playbook 2>/dev/null),$(TOOLS_DIR)/ansible/bin/ansible-playbook) diff --git a/configs/config.mk b/configs/config.mk index 150138a..6d67d08 100644 --- a/configs/config.mk +++ b/configs/config.mk @@ -9,10 +9,10 @@ cfg.clean: cfg.generate: @echo "Generating host_vars files..." - $(KCL_BIN) run $(HOSTS_CONFIG_DIR)/hosts/kvm.k --output $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml - $(KCL_BIN) run $(HOSTS_CONFIG_DIR)/hosts/router.k --output $(HOSTS_DIR)/router/ansible/host_vars/router.yaml + kcl run $(HOSTS_CONFIG_DIR)/hosts/kvm.k --output $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml + kcl run $(HOSTS_CONFIG_DIR)/hosts/router.k --output $(HOSTS_DIR)/router/ansible/host_vars/router.yaml cfg.validate: cfg.generate @echo "Validating generated files..." - $(KCL_BIN) vet $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml $(HOSTS_CONFIG_DIR)/hosts/kvm.k --format yaml - $(KCL_BIN) vet $(HOSTS_DIR)/router/ansible/host_vars/router.yaml $(HOSTS_CONFIG_DIR)/hosts/router.k --format yaml + kcl vet $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml $(HOSTS_CONFIG_DIR)/hosts/kvm.k --format yaml + kcl vet $(HOSTS_DIR)/router/ansible/host_vars/router.yaml $(HOSTS_CONFIG_DIR)/hosts/router.k --format yaml From 3a6a6ca03c2b4a2c1b7f90259f34f9e2b9ce3517 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:06:15 +0100 Subject: [PATCH 12/18] chore: ensure GOPATH bin is propagated to github path --- .github/workflows/build.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8faef73..620ba7a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,9 +12,15 @@ jobs: - name: Checkout code uses: actions/checkout@v6 + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version: 1.25 + - name: Install tools run: | go install kcl-lang.io/cli/cmd/kcl@latest + echo "$HOME/go/bin" >> $GITHUB_PATH - name: Build ISO run: | From 9bc674eca8ff19ebd9cb4fcefbaf11663fb51e24 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:10:24 +0100 Subject: [PATCH 13/18] chore: install terraform --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 620ba7a..fb5236a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,6 +19,9 @@ jobs: - name: Install tools run: | + wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + sudo apt update && sudo apt install terraform go install kcl-lang.io/cli/cmd/kcl@latest echo "$HOME/go/bin" >> $GITHUB_PATH From 92959cf518b3ff3e66d461c75b9f878a60e8f44d Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:14:55 +0100 Subject: [PATCH 14/18] chore: add ansible install and tflint actions --- .github/workflows/build.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fb5236a..ffe7173 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,10 +21,16 @@ jobs: run: | wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list - sudo apt update && sudo apt install terraform + sudo apt update && sudo apt install terraform ansible go install kcl-lang.io/cli/cmd/kcl@latest echo "$HOME/go/bin" >> $GITHUB_PATH + - uses: terraform-linters/setup-tflint@v6 + name: Setup TFLint + with: + tflint_version: v0.52.0 + cache: true + - name: Build ISO run: | make build From 310364af3d5d22da7e4c05603cf0de935cc7bec2 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:20:53 +0100 Subject: [PATCH 15/18] chore: use github-provided actions --- .github/workflows/build.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ffe7173..77b0948 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,18 +19,29 @@ jobs: - name: Install tools run: | - wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list - sudo apt update && sudo apt install terraform ansible go install kcl-lang.io/cli/cmd/kcl@latest echo "$HOME/go/bin" >> $GITHUB_PATH + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: "1.12.0" + - uses: terraform-linters/setup-tflint@v6 name: Setup TFLint with: tflint_version: v0.52.0 cache: true + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install Ansible + run: | + python3 -m pip install --upgrade pip + pip3 install ansible + - name: Build ISO run: | make build From 998652b788ba849c418c08e4c64414912dc6baa3 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:24:37 +0100 Subject: [PATCH 16/18] chore: add QEMU action --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 77b0948..c795993 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,6 +42,9 @@ jobs: python3 -m pip install --upgrade pip pip3 install ansible + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Build ISO run: | make build From 8d88ef3f0ea1a2eebbb923c71cc1dc976ad67412 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:26:26 +0100 Subject: [PATCH 17/18] chore: re-enable dynamically set kcl binary --- configs/config.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/config.mk b/configs/config.mk index 6d67d08..150138a 100644 --- a/configs/config.mk +++ b/configs/config.mk @@ -9,10 +9,10 @@ cfg.clean: cfg.generate: @echo "Generating host_vars files..." - kcl run $(HOSTS_CONFIG_DIR)/hosts/kvm.k --output $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml - kcl run $(HOSTS_CONFIG_DIR)/hosts/router.k --output $(HOSTS_DIR)/router/ansible/host_vars/router.yaml + $(KCL_BIN) run $(HOSTS_CONFIG_DIR)/hosts/kvm.k --output $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml + $(KCL_BIN) run $(HOSTS_CONFIG_DIR)/hosts/router.k --output $(HOSTS_DIR)/router/ansible/host_vars/router.yaml cfg.validate: cfg.generate @echo "Validating generated files..." - kcl vet $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml $(HOSTS_CONFIG_DIR)/hosts/kvm.k --format yaml - kcl vet $(HOSTS_DIR)/router/ansible/host_vars/router.yaml $(HOSTS_CONFIG_DIR)/hosts/router.k --format yaml + $(KCL_BIN) vet $(HOSTS_DIR)/kvm/ansible/host_vars/kvm.yaml $(HOSTS_CONFIG_DIR)/hosts/kvm.k --format yaml + $(KCL_BIN) vet $(HOSTS_DIR)/router/ansible/host_vars/router.yaml $(HOSTS_CONFIG_DIR)/hosts/router.k --format yaml From 464f9580de157757953eb5a486cc81bad2ce1d55 Mon Sep 17 00:00:00 2001 From: rslangl Date: Sun, 7 Dec 2025 17:31:26 +0100 Subject: [PATCH 18/18] chore: cleanup --- .github/workflows/lint.yaml | 8 ++++---- configs/config.mk | 2 -- liveOS/os.mk | 5 ----- sandbox/dev.mk | 4 ---- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 17def43..8c0a9d1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -35,10 +35,10 @@ jobs: npm install -g markdownlint-cli go install kcl-lang.io/cli/cmd/kcl@latest - # - name: Lint shell scripts - # run: | - # find . -name "*.sh" -exec shellcheck {} + - # + - name: Lint shell scripts + run: | + find . -name "*.sh" -exec shellcheck {} + + - name: Lint YAML files run: | yamllint . diff --git a/configs/config.mk b/configs/config.mk index 150138a..4bbc462 100644 --- a/configs/config.mk +++ b/configs/config.mk @@ -1,7 +1,5 @@ .PHONY: cfg.generate cfg.clean -# KCL_BIN := $(TOOLS_DIR)/kcl - cfg.clean: @echo "Cleaning KCL output in ..." rm -f $(HOSTS_DIR)/router/ansible/host_vars/router.yaml diff --git a/liveOS/os.mk b/liveOS/os.mk index d2f1abe..2babe0c 100644 --- a/liveOS/os.mk +++ b/liveOS/os.mk @@ -1,10 +1,5 @@ .PHONY: os.clean os.build -# TF_PLAN := $(CACHE_DIR)/tfdata/liveos/plan -# TF_BIN := $(TOOLS_DIR)/terraform -# TFLINT_BIN := $(TOOLS_DIR)/tflint -# DOCKER_BIN := $(TOOLS_DIR)/docker/docker - os.clean: @echo "Destroying resources..." $(TF_BIN) -chdir=$(LIVEOS_DIR) destroy -auto-approve diff --git a/sandbox/dev.mk b/sandbox/dev.mk index db919c6..5a11829 100644 --- a/sandbox/dev.mk +++ b/sandbox/dev.mk @@ -1,9 +1,5 @@ .PHONY: dev.clean dev.build -# TF_BIN := $(TOOLS_DIR)/terraform -# TFLINT_BIN := $(TOOLS_DIR)/tflint -# ANSIBLE_BIN := $(TOOLS_DIR)/ansible/bin/ansible-playbook - dev.clean: @echo "Destroying resources..." $(TF_BIN) -chdir=$(SANDBOX_DIR) destroy -auto-approve