make the packages role more generic
This commit is contained in:
41
tasks/Linux/go.yml
Normal file
41
tasks/Linux/go.yml
Normal 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
|
||||
Reference in New Issue
Block a user