Working on source packages

Signed-off-by: Matthew Stobbs <matthew@stobbs.ca>
This commit is contained in:
Matthew Stobbs
2026-02-02 02:35:16 -07:00
parent fa78c0aa0c
commit c613a29ce4
14 changed files with 470 additions and 396 deletions

View File

@@ -1,16 +1,78 @@
# vim: set filetype=yaml.ansible :
---
- name: Load go config
ansible.builtin.include_tasks:
file: config/go.yml
- name: Append go to pkg_archive
- name: Configure go for install
when:
- go.method == 'archive'
ansible.builtin.set_fact:
pkg_archive: "{{ pkg_archive + ['go'] }}"
- __go_configured is undefined
block:
- name: Configure go install method
when:
- go_install_method is undefined
ansible.builtin.set_fact:
go_install_method: "{% if install_method in go_install_methods %}{{ install_method }}{% else %}{{ go_install_methods[0] }}{% endif %}"
- name: Append to pkg_sys
- go.method != 'archive'
- name: Configure go archive installation
when:
- go_install_method == 'archive'
block:
- name: Configure go
ansible.builtin.set_fact:
go_version: "{{ go_version | default('1.25.6') }}"
go_system: "{{ ansible_system | lower }}"
go_archmap:
arm64: arm64
aarch64: arm64
x86_64: amd64
go_install_sums:
1.25.6:
Darwin:
amd64: sha256:e2b5b237f5c262931b8e280ac4b8363f156e19bfad5270c099998932819670b7
arm64: sha256:984521ae978a5377c7d782fd2dd953291840d7d3d0bd95781a1f32f16d94a006
Linux:
amd64: sha256:f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a
arm64: sha256:738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5
- name: Set go architecture
ansible.builtin.set_fact:
go_arch: "{{ go_archmap[ansible_architecture] }}"
- name: Set archive name
ansible.builtin.set_fact:
go_archive: "go{{ go_version }}.{{ go_system }}-{{ go_arch }}.tar.gz"
- name: Set go download url
ansible.builtin.set_fact:
go_archive_url: "https://go.dev/dl/{{ go_archive }}"
- name: Set archive extract location
ansible.builtin.set_fact:
go_extract_path: "{{ path_archive }}/go{{ go_version }}"
- name: Complete go archive install configuration
ansible.builtin.set_fact:
__go_configured: true
go_archive_install:
extract_path: "{{ go_extract_path }}"
archive_url: "{{ go_archive_url }}"
archive_name: "{{ go_archive }}"
archive_checksum: "{{ go_install_sums[go_version][ansible_system][go_arch] }}"
- name: Install vis system package manager
when:
- go_install_method == 'system'
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['go'] }}"
- name: Install via archive
when:
- go_install_method == 'archive'
block:
- name: Add go archive extract install
ansible.builtin.set_fact:
pkg_archive: "{{ pkg_archive + [go_archive_install] }}"
- name: Set symbolic link to archive path
ansible.bulitin.file:
state: link
force: true
path: "{{ path_go }}"
src: "{{ got_extract_path }}/go"