fixed go package

This commit is contained in:
Matthew Stobbs
2025-03-02 11:12:02 -07:00
parent dd9eb41620
commit 5cd724ca0c
2 changed files with 16 additions and 10 deletions

View File

@@ -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: