fix variable references

This commit is contained in:
Matthew Stobbs
2025-01-25 22:04:52 -07:00
parent 7c11dcfab2
commit f2e740c3dd
2 changed files with 46 additions and 45 deletions

View File

@@ -6,19 +6,15 @@
ignore_errors: true ignore_errors: true
- name: install/update go - name: install/update go
when: "'{{ pkgconfig.go.version }}' not in r_go_version.stdout" when: "'{{ pkgconfig_go.version }}' not in r_go_version.stdout"
block: block:
- name: set go arch - name: set go arch
ansible.builtin.set_fact: ansible.builtin.set_fact:
arch: "{{ pkgconfig.go.archmap[ansible_architecture] }}" arch: "{{ pkgconfig_go.archmap[ansible_architecture] }}"
- name: set go archive filename - name: set go archive filename
ansible.builtin.set_fact: ansible.builtin.set_fact:
go_archive: "go{{ pkgconfig.go.version }}.{{ ansible_system | lower }}-{{ arch }}.{{ pkgconfig.go.extmap[ansible_system] }}" go_archive: "go{{ pkgconfig_go.version }}.{{ ansible_system | lower }}-{{ arch }}.{{ pkgconfig_go.extmap[ansible_system] }}"
tags:
- dev
- go
- debug
- name: create temp path - name: create temp path
ansible.builtin.tempfile: ansible.builtin.tempfile:
@@ -31,21 +27,18 @@
ansible.builtin.get_url: ansible.builtin.get_url:
dest: "{{ d_go_dl_tmp.path }}/{{ go_archive }}" dest: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
url: "https://go.dev/dl/{{ go_archive }}" url: "https://go.dev/dl/{{ go_archive }}"
checksum: "{{ pkgconfig.go[pkgconfig.go.version][ansible_system][arch] }}" checksum: "{{ pkgconfig_go[pkgconfig_go.version][ansible_system][arch] }}"
decompress: false decompress: false
tags:
- dev
- go
- name: ensure go install dir exists - name: ensure go install dir exists
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: "{{ pkgconfig.go.install_path }}" path: "{{ pkgconfig_go.install_path }}"
state: directory state: directory
- name: extract go package - name: extract go package
ansible.builtin.unarchive: ansible.builtin.unarchive:
dest: "{{ pkgconfig.go.install_path }}" dest: "{{ pkgconfig_go.install_path }}"
src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}" src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
remote_src: true remote_src: true
when: ansible_system == 'Linux' when: ansible_system == 'Linux'
@@ -56,6 +49,3 @@
cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go_archive }} -target /" cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go_archive }} -target /"
when: ansible_system == 'Darwin' when: ansible_system == 'Darwin'
become: true become: true
tags:
- dev
- go

View File

@@ -4,6 +4,16 @@
zig_path: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}" zig_path: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}"
zig_pkg: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}.tar.xz" zig_pkg: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}.tar.xz"
- name: check if zig {{ pkgconfig_zig.version }} exists
ansible.builtin.stat:
path: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig"
register: r_zig_stat
- debug:
var: r_zig_stat
- name: update/install zig
block:
- name: create temp path - name: create temp path
ansible.builtin.tempfile: ansible.builtin.tempfile:
state: directory state: directory
@@ -35,3 +45,4 @@
src: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig" src: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig"
path: "{{ pkgconfig_zig.install_prefix }}/bin/zig" path: "{{ pkgconfig_zig.install_prefix }}/bin/zig"
become: true become: true
when: not r_zig_stat.stat.exists