From b602a7a1f5fc940b64645bf0cd3ddf277d0a0a39 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Mon, 15 Jan 2024 15:39:37 -0500 Subject: [PATCH] fix: update makeninja - rename Archfile - check for k0sctl (#1161) * fix: update makeninja * Update Taskfile.yaml * fix: check for k0sctl when k0s is choosen Signed-off-by: Devin Buhl --------- Signed-off-by: Devin Buhl --- .taskfiles/Workstation/{ArchPackages => Archfile} | 0 .taskfiles/Workstation/Taskfile.yaml | 8 ++++---- Taskfile.yaml | 2 -- bootstrap/tasks/validation/cli.yaml | 10 ++++++++++ requirements.txt | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) rename .taskfiles/Workstation/{ArchPackages => Archfile} (100%) diff --git a/.taskfiles/Workstation/ArchPackages b/.taskfiles/Workstation/Archfile similarity index 100% rename from .taskfiles/Workstation/ArchPackages rename to .taskfiles/Workstation/Archfile diff --git a/.taskfiles/Workstation/Taskfile.yaml b/.taskfiles/Workstation/Taskfile.yaml index d92105f1..209909e2 100644 --- a/.taskfiles/Workstation/Taskfile.yaml +++ b/.taskfiles/Workstation/Taskfile.yaml @@ -16,20 +16,20 @@ tasks: paru: desc: Install workstation dependencies with Paru - cmd: paru -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages | xargs) + cmd: paru -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/Archfile | xargs) preconditions: - sh: command -v paru msg: | Paru is not installed. Using ArchLinux? Head over to https://github.com/Morganamilo/paru to get up and running. - - { msg: "ArchPackages not found", sh: "test -f {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages" } + - { msg: "Archfile not found", sh: "test -f {{.ROOT_DIR}}/.taskfiles/Workstation/Archfile" } yay: desc: Install workstation dependencies with Yay - cmd: yay -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages | xargs) + cmd: yay -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/Archfile | xargs) preconditions: - sh: command -v yay msg: | Yay is not installed. Using ArchLinux? Head over to https://github.com/Jguer/yay to get up and running. - - { msg: "ArchPackages not found", sh: "test -f {{.ROOT_DIR}}/.taskfiles/Workstation/ArchPackages" } + - { msg: "Archfile not found", sh: "test -f {{.ROOT_DIR}}/.taskfiles/Workstation/Archfile" } diff --git a/Taskfile.yaml b/Taskfile.yaml index 6ea1609e..af22e1b7 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -66,8 +66,6 @@ tasks: cmds: - ./.venv/bin/makejinja - task: sops:encrypt:all - # TODO: https://github.com/mirkolenz/makejinja/issues/94 - - find {{.ANSIBLE_DIR}} {{.KUBERNETES_DIR}} -type d -empty -delete preconditions: - { msg: "bootstrap addons file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/addons.yaml" } - { msg: "bootstrap config file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/config.yaml" } diff --git a/bootstrap/tasks/validation/cli.yaml b/bootstrap/tasks/validation/cli.yaml index 46dbdb56..930078d5 100644 --- a/bootstrap/tasks/validation/cli.yaml +++ b/bootstrap/tasks/validation/cli.yaml @@ -7,3 +7,13 @@ check_mode: false register: result failed_when: result.rc != 0 and result.rc != 127 + +- name: Check if required CLI tools are present for k0s + when: bootstrap_distribution == "k0s" + ansible.builtin.shell: | + command -v {{ item }} >/dev/null 2>&1 + loop: ["k0sctl"] + changed_when: false + check_mode: false + register: result + failed_when: result.rc != 0 and result.rc != 127 diff --git a/requirements.txt b/requirements.txt index 24fa362e..0c1db730 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ ansible-lint==6.22.1 # https://github.com/pyca/bcrypt/issues/684 bcrypt==4.1.2 jmespath==1.0.1 -makejinja==2.3.3 +makejinja==2.3.4 netaddr==0.10.1 openshift==0.13.2 passlib==1.7.4