adjusting variable names, fixing errors

This commit is contained in:
2026-03-19 21:46:04 -06:00
parent d1d556d425
commit 2d65e01f7b
38 changed files with 697 additions and 298 deletions

View File

@@ -1,17 +1,55 @@
# vim: set filetype=yaml.ansible :
#
## Package: zig
## Description: zig programming language tool chain
## Version: 0.15.2
## Methods: [system, archive]
## Helpers: archive
---
- name: Add zig
- name: Set zig default facts
ansible.builtin.set_fact:
install_methods:
- archive
- system
version: "{{ zig_version | default('0.15.2') }}"
archive:
url: https://ziglang.org/download
- name: Configure zig
when:
- zig_configured is undefined
- "'zig' not in __configured"
block:
- name: Load zig config
ansible.builtin.include_tasks:
file: config/zig.yml
- name: Append zig to pkg_archive
- name: Set zig install method
when:
- zig_install_method is undefined
ansible.builtin.set_fact:
pkg_archive: "{{ pkg_archive + ['zig'] }}"
zig_install_method: "{{ install_method if install_method in zig.install_methods else zig.install_methods[0] }}"
- name: Set zig_configured
- name: Configure zig system install
when:
- zig_install_method == 'system'
ansible.builtin.set_fact:
zig_configured: true
pkg_sys: "{{ pkg_sys + [zig.pkgname[os_family]] }}"
- name: Configure zig archive install
when:
- zig_install_method == 'archive'
block:
- name: Configure zig archive install
ansible.builtin.set_fact:
zig_archive_install:
url: "{{ zig.archive.url }}/{{ zig.version }}/zig-{{ architecture }}-{{ system | lower }}-{{ zig.version }}.tar.xz"
extract_to: "{{ path_zig }}"
name: "zig-{{ zig.version }}.tar.xz"
links:
- from: "{{ path_archive }}/zig-{{ architecture }}-{{ system | lower }}-{{ zig.version }}/zig"
to: "{{ path_bin }}/zig"
force: true
- name: Finalise zig archive install
ansible.builtin.set_fact:
zig_install: "{{ zig_archive_install }}"
- name: Finalise zig configuration
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'zig': zig_install } ) }}"