From dd9eb4162025f884c90f81348e0bc3cbbe9b8438 Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Sun, 2 Mar 2025 11:06:01 -0700 Subject: [PATCH] remove old go version before installing new one --- tasks/archive/go.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tasks/archive/go.yml b/tasks/archive/go.yml index 9b46d61..0a9e554 100644 --- a/tasks/archive/go.yml +++ b/tasks/archive/go.yml @@ -1,21 +1,15 @@ # vim: set filetype=yaml.ansible : --- -# - 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: Remove existing go install + when: + - ansible_system == 'Linux' + become: true + ansible.builtin.file: + state: absent + path: "{{ path.go }}" + - name: Download go archive register: get_url_go ansible.builtin.get_url: