Linter + Dashboard fixes

This commit is contained in:
Mark Janssen 2024-07-31 20:33:54 +02:00
parent e1bf3e1765
commit abc64144a8
Signed by: foobar
GPG key ID: D8674D8FC4F69BD2
44 changed files with 265 additions and 379 deletions

View file

@ -19,11 +19,11 @@
register: go_latest_version_shell
- name: Format Go latest version variable
set_fact:
ansible.builtin.set_fact:
go_latest_version: "{{ go_latest_version_shell.stdout }}"
- name: Detect installed Go version
shell: "go version | grep --color=never -Po '\\d\\.\\d+(\\.\\d+)?' || echo none"
ansible.builtin.shell: "go version | grep --color=never -Po '\\d\\.\\d+(\\.\\d+)?' || echo none"
register: go_installed_version_shell
changed_when: false
@ -31,19 +31,20 @@
set_fact:
go_installed_version: "{{ go_installed_version_shell.stdout }}"
- debug:
- name: Debug
ansible.builtin.debug:
msg:
- "Latest Go version: {{ go_latest_version}}"
- "Installed Go version: {{ go_installed_version }}"
- name: Remove installed go
file:
ansible.builtin.file:
state: absent
path: /usr/local/go
when: go_installed_version != go_latest_version
- name: Install Go
unarchive:
ansible.builtin.unarchive:
src: https://go.dev/dl/go{{ go_latest_version }}.linux-{{ go_arch }}.tar.gz
dest: /usr/local
remote_src: yes
@ -52,7 +53,7 @@
when: go_installed_version != go_latest_version
- name: Configure Go environment
template:
ansible.builtin.template:
src: go.profile
dest: /etc/profile.d/go.sh
owner: root
@ -60,7 +61,7 @@
mode: 0644
- name: Link go binary
file:
ansible.builtin.file:
state: link
src: /usr/local/go/bin/go
dest: /usr/local/bin/go