install go only if version is different from desired

This commit is contained in:
Matthew Stobbs
2025-01-24 17:21:41 -07:00
parent ac68bcca9c
commit adb9161079

View File

@@ -3,6 +3,15 @@
file: go.yml file: go.yml
name: _go name: _go
- name: check go version
ansible.builtin.command:
cmd: "go version"
register: r_go_version
ignore_errors: true
- name: install/update go
when: "'{{ _go.version }}' not in r_go_version.stdout"
block:
- name: set go arch - name: set go arch
ansible.builtin.set_fact: ansible.builtin.set_fact:
arch: "{{ _go.archmap[ansible_architecture] }}" arch: "{{ _go.archmap[ansible_architecture] }}"