clean up, refactor, documentation
- reducing amount of splitting in configs - documenting configuration
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
---
|
||||
- ansible.builtin.include_vars:
|
||||
file: go.yml
|
||||
name: _go
|
||||
|
||||
- name: check go version
|
||||
ansible.builtin.command:
|
||||
cmd: "go version"
|
||||
@@ -10,15 +6,15 @@
|
||||
ignore_errors: true
|
||||
|
||||
- name: install/update go
|
||||
when: "'{{ _go.version }}' not in r_go_version.stdout"
|
||||
when: "'{{ pkgconfig.go.version }}' not in r_go_version.stdout"
|
||||
block:
|
||||
- name: set go arch
|
||||
ansible.builtin.set_fact:
|
||||
arch: "{{ _go.archmap[ansible_architecture] }}"
|
||||
arch: "{{ pkgconfig.go.archmap[ansible_architecture] }}"
|
||||
|
||||
- name: set go archive filename
|
||||
ansible.builtin.set_fact:
|
||||
go_archive: "go{{ _go.version }}.{{ ansible_system | lower }}-{{ arch }}.{{ _go.extmap[ansible_system] }}"
|
||||
go_archive: "go{{ pkgconfig.go.version }}.{{ ansible_system | lower }}-{{ arch }}.{{ pkgconfig.go.extmap[ansible_system] }}"
|
||||
tags:
|
||||
- dev
|
||||
- go
|
||||
@@ -35,7 +31,7 @@
|
||||
ansible.builtin.get_url:
|
||||
dest: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
|
||||
url: "https://go.dev/dl/{{ go_archive }}"
|
||||
checksum: "{{ _go[_go.version][ansible_system][arch] }}"
|
||||
checksum: "{{ pkgconfig.go[pkgconfig.go.version][ansible_system][arch] }}"
|
||||
decompress: false
|
||||
tags:
|
||||
- dev
|
||||
@@ -44,12 +40,12 @@
|
||||
- name: ensure go install dir exists
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ _go.install_path }}"
|
||||
path: "{{ pkgconfig.go.install_path }}"
|
||||
state: directory
|
||||
|
||||
- name: extract go package
|
||||
ansible.builtin.unarchive:
|
||||
dest: "{{ _go.install_path }}"
|
||||
dest: "{{ pkgconfig.go.install_path }}"
|
||||
src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
|
||||
remote_src: true
|
||||
when: ansible_system == 'Linux'
|
||||
|
||||
Reference in New Issue
Block a user