49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
---
|
|
- name: download zig archive
|
|
ansible.builtin.set_fact:
|
|
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: 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
|
|
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
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: "{{ pkgconfig_zig.install_path }}"
|
|
become: true
|
|
|
|
- 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
|
|
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
|