more package fixes

This commit is contained in:
Matthew Stobbs
2025-02-21 22:59:24 -07:00
parent 4b995a3c07
commit 852fe8eb7d
71 changed files with 403 additions and 440 deletions

View File

@@ -1,44 +1,44 @@
# vim: set filetype=yaml.ansible :
---
- name: Check if archive already exists
- name: Check if go is already installed
ansible.builtin.stat:
path: "{{ paths.archive }}/{{ go_archive }}"
register: stat_go_archive
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:
- not stat_go_archive.exists
- do_go_install or
not stat_path_go.stat.exists
block:
- name: Download go archive
become: "{{ sys_pkg_become }}"
register: get_url_go
ansible.builtin.get_url:
dest: "{{ paths.cache }}/{{ go_archive }}"
dest: "{{ path.cache }}/{{ go.archive }}"
url: "{{ go.url }}"
checksum: "{{ go.sum }}"
decompress: false
mode: '0644'
register: get_url_go
- name: Ensure go install dir exists
become: "{{ sys_pkg_become }}"
ansible.builtin.file:
path: "{{ go.inst_path }}"
state: directory
mode: '0755'
- name: Extract go package for Linux
become: "{{ ext_become }}"
when:
- ansible_system == 'Linux'
ansible.builtin.unarchive:
dest: "{{ path.prefix }}"
src: "{{ d_go_dl_tmp.path }}/{{ go.archive }}"
remote_src: true
- name: Extract go package
become: "{{ sys_pkg_become }}"
when:
- ansible_system == 'Linux'
ansible.builtin.unarchive:
dest: "{{ paths.archive }}/go"
src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
remote_src: true
- name: Install go macOS use pkg file
become: true
when:
- ansible_system == 'Darwin'
ansible.builtin.command:
creates: "{{ go.inst_path }}"
cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go_archive }} -target /"
- name: Install go macOS using pkg file
become: true
when:
- ansible_distribution == 'MacOSX'
ansible.builtin.command:
creates: "{{ path.go }}"
cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go.archive }} -target /"