fix variable references
This commit is contained in:
@@ -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
|
|
||||||
|
|||||||
@@ -4,34 +4,45 @@
|
|||||||
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: 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:
|
ansible.builtin.tempfile:
|
||||||
state: directory
|
state: directory
|
||||||
prefix: zig_dl.
|
prefix: zig_dl.
|
||||||
register: d_zig_dl_tmp
|
register: d_zig_dl_tmp
|
||||||
|
|
||||||
- name: download zig archive
|
- name: download zig archive
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
dest: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
|
dest: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
|
||||||
url: "{{ pkgconfig_zig.base_url }}/{{ pkgconfig_zig.version }}/{{ zig_pkg }}"
|
url: "{{ pkgconfig_zig.base_url }}/{{ pkgconfig_zig.version }}/{{ zig_pkg }}"
|
||||||
decompress: false
|
decompress: false
|
||||||
|
|
||||||
- name: create install_path
|
- name: create install_path
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: directory
|
state: directory
|
||||||
path: "{{ pkgconfig_zig.install_path }}"
|
path: "{{ pkgconfig_zig.install_path }}"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: extract zig package
|
- name: extract zig package
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
dest: "{{ pkgconfig_zig.install_path }}"
|
dest: "{{ pkgconfig_zig.install_path }}"
|
||||||
src: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
|
src: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
|
||||||
remote_src: true
|
remote_src: true
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: link zig binary
|
- name: link zig binary
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: link
|
state: link
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user