fixing issues

This commit is contained in:
Matthew Stobbs
2025-02-22 16:09:47 -07:00
parent d1e8957f94
commit a73ed77dac
17 changed files with 63 additions and 68 deletions

View File

@@ -13,11 +13,10 @@
- name: Install/update go - name: Install/update go
when: when:
- do_go_install or - (do_go_install is defined and do_go_install) or
not stat_path_go.stat.exists not stat_path_go.stat.exists
block: block:
- name: Download go archive - name: Download go archive
become: "{{ sys_pkg_become }}"
register: get_url_go register: get_url_go
ansible.builtin.get_url: ansible.builtin.get_url:
dest: "{{ d_tempdir.path }}/{{ go.archive }}" dest: "{{ d_tempdir.path }}/{{ go.archive }}"
@@ -31,7 +30,7 @@
when: when:
- ansible_system == 'Linux' - ansible_system == 'Linux'
ansible.builtin.unarchive: ansible.builtin.unarchive:
dest: "{{ path.prefix }}" dest: "{{ go.prefix }}"
src: "{{ d_tempdir.path }}/{{ go.archive }}" src: "{{ d_tempdir.path }}/{{ go.archive }}"
remote_src: true remote_src: true
@@ -40,4 +39,4 @@
when: when:
- ansible_distribution == 'MacOSX' - ansible_distribution == 'MacOSX'
ansible.builtin.command: ansible.builtin.command:
cmd: "installer -pkg {{ d_tempdir.path }}/{{ go.archive }} -target /" cmd: "installer -pkg {{ d_tempdir.path }}/{{ go.archive }} -target {{ go.prefix }}"

View File

@@ -1,42 +1,38 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- 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 exists - name: Check if zig exists
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig" path: "{{ path.archive }}/zig/{{ zig.path }}/zig"
register: r_zig_stat register: r_zig_stat
- name: Update/install zig - name: Update/install zig
when: when:
- not r_zig_stat.stat.exists - not r_zig_stat.stat.exists
block: 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: ansible.builtin.get_url:
dest: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}" dest: "{{ d_tempdir.path }}/{{ zig.pkg }}"
url: "{{ pkgconfig_zig.base_url }}/{{ pkgconfig_zig.version }}/{{ zig_pkg }}" url: "{{ zig.base_url }}/{{ zig.vers }}/{{ zig.pkg }}"
decompress: false decompress: false
mode: '0644' mode: '0644'
- name: Create zig archive dir
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.archive }}/zig"
- name: Extract zig package - name: Extract zig package
become: "{{ ext_become }}" become: "{{ ext_become }}"
ansible.builtin.unarchive: ansible.builtin.unarchive:
dest: "{{ path.archive }}/zig" dest: "{{ path.archive }}/zig"
src: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}" src: "{{ d_tempdir.path }}/{{ zig.pkg }}"
remote_src: true remote_src: true
- name: Link zig binary - name: Link zig binary
become: "{{ ext_become }}" become: "{{ ext_become }}"
ansible.builtin.file: ansible.builtin.file:
state: link state: link
src: "{{ path.archive }}/{{ zig_path }}/zig" src: "{{ path.archive }}/zig/{{ zig.path }}/zig"
path: "{{ path.bin }}/zig" path: "{{ path.bin }}/zig"

View File

@@ -1,32 +1,37 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: Download zls archive
ansible.builtin.set_fact:
- name: Check if zls exists - name: Check if zls exists
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ path.archive }}/{{ zls_path }}/zls" path: "{{ path.archive }}/zls/{{ zls.path }}/zls"
register: r_zls_stat register: r_zls_stat
- name: Update/install zls - name: Update/install zls
block: block:
- name: Download zls archive - name: Download zls archive
register: get_url_zls
ansible.builtin.get_url: ansible.builtin.get_url:
dest: "{{ d_tempfile.path }}/{{ zls_pkg }}" dest: "{{ d_tempdir.path }}/{{ zls.pkg }}"
url: "{{ zls.base_url }}/{{ zls_pkg }}" url: "{{ zls.base_url }}/{{ zls.pkg }}"
decompress: false decompress: false
mode: '0644' mode: '0644'
- name: Create zls archive dir
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.archive }}/zls/{{ zls.path }}"
- name: Extract zls package - name: Extract zls package
become: "{{ ext_become }}" become: "{{ ext_become }}"
ansible.builtin.unarchive: ansible.builtin.unarchive:
dest: "{{ path.archive }}" dest: "{{ path.archive }}/zls/{{ zls.path }}"
src: "{{ d_tempfile.path }}/{{ zls_pkg }}" src: "{{ d_tempdir.path }}/{{ zls.pkg }}"
remote_src: true remote_src: true
- name: Link zls binary - name: Link zls binary
become: "{{ ext_become }}" become: "{{ ext_become }}"
ansible.builtin.file: ansible.builtin.file:
state: link state: link
src: "{{ path.archive }}/{{ zls_path }}/zls" src: "{{ path.archive }}/zls/{{ zls.path }}/zls"
path: "{{ path.bin }}/zls" path: "{{ path.bin }}/zls"

View File

@@ -3,7 +3,7 @@
- name: Install cargo pkg - name: Install cargo pkg
become: "{{ ext_become }}" become: "{{ ext_become }}"
community.general.cargo: community.general.cargo:
name: "{{ pkg.name }}" name: "{{ pkg.name | default(pkg) }}"
version: "{{ pkg.vers }}" version: "{{ pkg.vers | default(omit) }}"
path: "{{ paths.cargo }}" path: "{{ paths.cargo | default(omit) }}"
locked: "{{ pkg.locked | default(true) }}" locked: "{{ pkg.locked | default(true) }}"

View File

@@ -1,8 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: Set configuration for air
ansible.builtin.set_fact:
air:
ver: "{{ pkgconfig.air.version }}"
pkg: "{{ pkgconfig.air.mod_path }}@{{ pkgconfig.air.version }}"
bin: "{{ pkgconfig.air.bin }}"

View File

@@ -16,7 +16,7 @@
arch: "{{ go.arch }}" arch: "{{ go.arch }}"
archive: "go{{ go.vers }}.{{ go.sys }}-{{ go.arch }}.{{ pkgconfig.go.extmap[ansible_system] }}" archive: "go{{ go.vers }}.{{ go.sys }}-{{ go.arch }}.{{ pkgconfig.go.extmap[ansible_system] }}"
ext: "{{ go.ext }}" ext: "{{ go.ext }}"
inst_path: "{{ path.prefix }}" prefix: "{% if ansible_distribution == 'MacOSX' %}/{% else %}{{ path.prefix }}{% endif %}"
sum: "{{ pkgconfig.go.sums[go.vers][ansible_system][go.arch] }}" sum: "{{ pkgconfig.go.sums[go.vers][ansible_system][go.arch] }}"
sys: "{{ go.sys }}" sys: "{{ go.sys }}"
base_url: "{{ pkgconfig.go.base_url }}" base_url: "{{ pkgconfig.go.base_url }}"

View File

@@ -3,6 +3,7 @@
- name: Set zig configuration - name: Set zig configuration
ansible.builtin.set_fact: ansible.builtin.set_fact:
zig: zig:
version: 0.13.0 vers: "{{ pkgconfig.zig.version }}"
install_prefix: "{{ path.prefix }}" path: "zig-{{ pkgconfig.zig.sysmap[ansible_system] }}-{{ pkgconfig.zig.archmap[ansible_architecture] }}-{{ pkgconfig.zig.version }}"
install_path: "{{ path.archive }}/zig" pkg: "zig-{{ pkgconfig.zig.sysmap[ansible_system] }}-{{ pkgconfig.zig.archmap[ansible_architecture] }}-{{ pkgconfig.zig.version }}.tar.xz"
base_url: "{{ pkgconfig.zig.base_url }}"

View File

@@ -45,7 +45,7 @@
archive: "{{ path.archive | default(path.prefix ~ defaults.path.suffix.archive) }}" archive: "{{ path.archive | default(path.prefix ~ defaults.path.suffix.archive) }}"
bin: "{{ path.bin | default(path.prefix ~ defaults.path.suffix.bin) }}" bin: "{{ path.bin | default(path.prefix ~ defaults.path.suffix.bin) }}"
cargo: "{{ path.cargo | default(path.prefix ~ defaults.path.suffix.cargo) }}" cargo: "{{ path.cargo | default(path.prefix ~ defaults.path.suffix.cargo) }}"
go: "{{ path.go | default(path.prefix ~ defaults.path.suffix.go) }}" go: "{% if ansible_distribution == 'MacOSX' %}/usr/local/go{% else %}{{ path.go | default(path.prefix ~ defaults.path.suffix.go) }}{% endif %}"
pipx: "{{ path.pipx | default(path.prefix ~ defaults.path.suffix.pipx) }}" pipx: "{{ path.pipx | default(path.prefix ~ defaults.path.suffix.pipx) }}"
- name: Set OS independant facts - name: Set OS independant facts

View File

@@ -1,12 +1,16 @@
--- ---
- debug:
var: path.go
- debug:
var: path.bin
- name: Install go packages - name: Install go packages
become: "{{ ext_become }}" become: "{{ ext_become }}"
environment: environment:
GOBIN: "{{ path.bin }}" GOBIN: "{% if ansible_distribution == 'MacOSX' %}/usr/local/bin{% else %}{{ path.bin }}{% endif %}"
PATH: "{{ path.go }}/bin:$PATH" PATH: "{{ path.go }}/bin:$PATH"
ansible.builtin.command: ansible.builtin.command:
creates: "{{ path.bin }}/{{ pkg.bin }}"
cmd: cmd:
- go - go
- install - install
- "{{ pkg.pkg }}" - "{{ pkg }}"

View File

@@ -31,3 +31,13 @@
name: "{{ flatpak.name }}" name: "{{ flatpak.name }}"
remote: "{{ flatpak.remote | default('flathub') }}" remote: "{{ flatpak.remote | default('flathub') }}"
state: present state: present
- name: Install pkg_appimage
when:
- pkg_appimage|length > 0
loop: "{{ pkg_appimage }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: appimage.yml

View File

@@ -72,15 +72,6 @@
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: "archive/{{ pkg }}.yml" file: "archive/{{ pkg }}.yml"
- name: Install pkg_appimage
when:
- pkg_appimage|length > 0
loop: "{{ pkg_appimage }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: appimage.yml
- name: Build and install source packages - name: Build and install source packages
when: when:
- pkg_src|length > 0 - pkg_src|length > 0

View File

@@ -4,4 +4,4 @@
notify: notify:
- Depend go - Depend go
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_go: "{{ pkg_go + [air] }}" pkg_go: "{{ pkg_go + ['github.com/air-verse/air@latest'] }}"

View File

@@ -2,4 +2,4 @@
--- ---
- name: Append to pkgs - name: Append to pkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_src: "{{ pkg_src + ['zig'] }}" pkg_archive: "{{ pkg_archive + ['zig'] }}"

View File

@@ -61,4 +61,4 @@
when: when:
- ansible_distribution == 'MacOSX' - ansible_distribution == 'MacOSX'
ansible.builtin.set_fact: ansible.builtin.set_fact:
brewtaps: "{{ brewtaps + ['hashicorp/tap'] }}" brewtap: "{{ brewtap + ['hashicorp/tap'] }}"

View File

@@ -1,4 +0,0 @@
air:
version: latest
mod_path: github.com/air-verse/air
bin: air

View File

@@ -11,11 +11,11 @@ go:
sums: sums:
1.24.0: 1.24.0:
Darwin: Darwin:
amd64: dee0ea64411a00b47ded586d5a8e30cfe3acf51564aa1bb24e039a6dca807a29 amd64: sha256:dee0ea64411a00b47ded586d5a8e30cfe3acf51564aa1bb24e039a6dca807a29
arm64: b19eb6b7ae87f8371c3e7a84d129db67779a2883d2fffa6bb90412b0167df133 arm64: sha256:b19eb6b7ae87f8371c3e7a84d129db67779a2883d2fffa6bb90412b0167df133
Linux: Linux:
amd64: b19eb6b7ae87f8371c3e7a84d129db67779a2883d2fffa6bb90412b0167df133 amd64: sha256:b19eb6b7ae87f8371c3e7a84d129db67779a2883d2fffa6bb90412b0167df133
arm64: c3fa6d16ffa261091a5617145553c71d21435ce547e44cc6dfb7470865527cc7 arm64: sha256:c3fa6d16ffa261091a5617145553c71d21435ce547e44cc6dfb7470865527cc7
1.23.6: 1.23.6:
Darwin: Darwin:
amd64: sha256:7fa387c228b4dd69b518a5d9425638fa5c0d86ec8943de373e3802aff2e5b12a amd64: sha256:7fa387c228b4dd69b518a5d9425638fa5c0d86ec8943de373e3802aff2e5b12a

View File

@@ -1,4 +1,5 @@
zig: zig:
version: 0.13.0
base_url: https://ziglang.org/download base_url: https://ziglang.org/download
sysmap: sysmap:
Darwin: macos Darwin: macos