make the packages role more generic

This commit is contained in:
Matthew Stobbs
2025-01-18 09:24:11 -07:00
parent 3d466e64c7
commit 333ee4c3f5
112 changed files with 1610 additions and 3 deletions

41
tasks/Linux/go.yml Normal file
View File

@@ -0,0 +1,41 @@
---
- name: Set go Filename
ansible.builtin.set_fact:
goFilename: "go{{ go.version }}.linux-{{ arch[ansible_architecture] }}.{{ go.linux.extension }}"
tags:
- dev
- go
- debug
- name: Download latest go package for linux
become: true
ansible.builtin.get_url:
dest: "/tmp/{{ goFilename }}"
url: "https://go.dev/dl/{{ goFilename }}"
checksum: "sha256:{{ go.linux.sum[ansible_architecture] }}"
decompress: false
tags:
- dev
- go
- name: Ensure go install dir exists
become: true
ansible.builtin.file:
path: /usr/local
state: directory
- name: Extract go package for Linux
become: true
ansible.builtin.unarchive:
dest: /usr/local
src: "/tmp/{{ goFilename }}"
remote_src: true
- name: Cleanup go package download
become: true
ansible.builtin.file:
path: "/tmp/{{ goFilename }}"
state: absent
tags:
- dev
- go