From 5cd724ca0c8d09521aebd1aef4d7b176c17d4e98 Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Sun, 2 Mar 2025 11:12:02 -0700 Subject: [PATCH] fixed go package --- tasks/archive/go.yml | 24 +++++++++++++++--------- vars/main.yml | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tasks/archive/go.yml b/tasks/archive/go.yml index 0a9e554..f7b53dc 100644 --- a/tasks/archive/go.yml +++ b/tasks/archive/go.yml @@ -1,15 +1,21 @@ # vim: set filetype=yaml.ansible : --- -- name: Install/update go - block: - - name: Remove existing go install - when: - - ansible_system == 'Linux' - become: true - ansible.builtin.file: - state: absent - path: "{{ path.go }}" +- name: Check if go is already installed + ansible.builtin.stat: + path: "{{ path.go }}/VERSION" + register: stat_path_go +- name: Check version of installed go + when: + - stat_path_go.stat.exists + ansible.builtin.set_fact: + do_go_install: "{{ not (go.vers in lookup('ansible.builtin.file', path.go ~ '/VERSION')) }}" + +- name: Install/update go + when: + - (do_go_install is defined and do_go_install) or + not stat_path_go.stat.exists + block: - name: Download go archive register: get_url_go ansible.builtin.get_url: diff --git a/vars/main.yml b/vars/main.yml index 20bd108..e8dd0c8 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -26,5 +26,5 @@ defaults: # - paths.pipx: $PREFIX/pipx ## Extra config that usually will not need to be changed -hyprland_clean: true +hyprland_clean: false hyprgitbase: https://github.com/hyprwm