fix variable references
This commit is contained in:
@@ -6,19 +6,15 @@
|
||||
ignore_errors: true
|
||||
|
||||
- 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:
|
||||
- name: set go arch
|
||||
ansible.builtin.set_fact:
|
||||
arch: "{{ pkgconfig.go.archmap[ansible_architecture] }}"
|
||||
arch: "{{ pkgconfig_go.archmap[ansible_architecture] }}"
|
||||
|
||||
- name: set go archive filename
|
||||
ansible.builtin.set_fact:
|
||||
go_archive: "go{{ pkgconfig.go.version }}.{{ ansible_system | lower }}-{{ arch }}.{{ pkgconfig.go.extmap[ansible_system] }}"
|
||||
tags:
|
||||
- dev
|
||||
- go
|
||||
- debug
|
||||
go_archive: "go{{ pkgconfig_go.version }}.{{ ansible_system | lower }}-{{ arch }}.{{ pkgconfig_go.extmap[ansible_system] }}"
|
||||
|
||||
- name: create temp path
|
||||
ansible.builtin.tempfile:
|
||||
@@ -31,21 +27,18 @@
|
||||
ansible.builtin.get_url:
|
||||
dest: "{{ d_go_dl_tmp.path }}/{{ 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
|
||||
tags:
|
||||
- dev
|
||||
- go
|
||||
|
||||
- name: ensure go install dir exists
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ pkgconfig.go.install_path }}"
|
||||
path: "{{ pkgconfig_go.install_path }}"
|
||||
state: directory
|
||||
|
||||
- name: extract go package
|
||||
ansible.builtin.unarchive:
|
||||
dest: "{{ pkgconfig.go.install_path }}"
|
||||
dest: "{{ pkgconfig_go.install_path }}"
|
||||
src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
|
||||
remote_src: true
|
||||
when: ansible_system == 'Linux'
|
||||
@@ -56,6 +49,3 @@
|
||||
cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go_archive }} -target /"
|
||||
when: ansible_system == 'Darwin'
|
||||
become: true
|
||||
tags:
|
||||
- dev
|
||||
- go
|
||||
|
||||
@@ -4,34 +4,45 @@
|
||||
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"
|
||||
|
||||
- name: create temp path
|
||||
- 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
|
||||
ansible.builtin.tempfile:
|
||||
state: directory
|
||||
prefix: zig_dl.
|
||||
register: d_zig_dl_tmp
|
||||
|
||||
- name: download zig archive
|
||||
- name: download zig archive
|
||||
ansible.builtin.get_url:
|
||||
dest: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
|
||||
url: "{{ pkgconfig_zig.base_url }}/{{ pkgconfig_zig.version }}/{{ zig_pkg }}"
|
||||
decompress: false
|
||||
|
||||
- name: create install_path
|
||||
- name: create install_path
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{{ pkgconfig_zig.install_path }}"
|
||||
become: true
|
||||
|
||||
- name: extract zig package
|
||||
- name: extract zig package
|
||||
ansible.builtin.unarchive:
|
||||
dest: "{{ pkgconfig_zig.install_path }}"
|
||||
src: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
|
||||
remote_src: true
|
||||
become: true
|
||||
|
||||
- name: link zig binary
|
||||
- name: link zig binary
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
src: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig"
|
||||
path: "{{ pkgconfig_zig.install_prefix }}/bin/zig"
|
||||
become: true
|
||||
when: not r_zig_stat.stat.exists
|
||||
|
||||
Reference in New Issue
Block a user