add zig installation via tarball

This commit is contained in:
Matthew Stobbs
2025-01-25 21:16:59 -07:00
parent 66eaed6e4b
commit 343765c8a6
16 changed files with 136 additions and 86 deletions

View File

@@ -3,11 +3,9 @@
file: zfs.yml
name: _zfs
- ansible.builtin.set_fact:
pkgconfig:
zfs: "{{ _zfs | ansible.builtin.combine(pkgconfig.zfs) }}"
pkgconfig_zfs: "{{ _zfs | ansible.builtin.combine(pkgconfig.zfs) }}"
- name: RedHat based configuration
when: ansible_os_family == 'RedHat'
block:
- ansible.builtin.set_fact:
rhname: "{%if ansible_distribution == 'Fedora' %}fedora{% else %}epel{% endif %}"
@@ -17,34 +15,26 @@
- name: add openzfs gpg_key
ansible.builtin.rpm_key:
key: "{{ pkgconfig.zfs.gpg_key }}"
fingerprint: "{{ pkgconfig.zfs.gpg_key_fingerprint }}"
key: "{{ pkgconfig_zfs.gpg_key }}"
fingerprint: "{{ pkgconfig_zfs.gpg_key_fingerprint }}"
state: present
become: true
tags:
- packages
- RedHat
- name: enable openzfs repository
ansible.builtin.dnf:
name: "{{ pkgconfig.zfs.repo_base }}{{ rhname }}/zfs-release-{{ pkgconfig.zfs[rhname].release }}{{ rpm_dist.stdout }}.noarch.rpm"
name: "{{ pkgconfig_zfs.repo_base }}{{ rhname }}/zfs-release-{{ pkgconfig_zfs[rhname].release }}{{ rpm_dist.stdout }}.noarch.rpm"
state: "{{ install_state }}"
become: true
tags:
- packages
- RedHat
- name: install zfs deps
ansible.builtin.dnf:
name: "{{ pkgconfig.zfs[ansible_os_family].deppkgs }}"
state: "{{ install_state }}"
become: true
ansible.builtin.set_fact:
syspkgs: "{{ pkgconfig_zfs.deppkgs[ansible_os_family] }}"
when: ansible_os_family == 'RedHat'
- name: Debian configuration
when: ansible_os_family == 'Debian'
block:
- name: enable openzfs repository
become: true
ansible.builtin.apt_repository:
repo: |
deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main contrib
@@ -52,9 +42,9 @@
filename: "{{ ansible_distribution_release }}-backports"
state: present
update_cache: false
become: true
- name: pin zfs package to backports
become: true
ansible.builtin.file:
content: |
Package: src:zfs-linux
@@ -62,17 +52,14 @@
Pin-Priority: 990
dest: /etc/apt/preferences.d/90_zfs
state: present
become: true
- name: install zfs deps
ansible.builtin.set_fact:
syspkgs: "{{ pkgconfig_zfs.deppkgs[ansible_os_family] }}"
become: true
ansible.builtin.apt:
name: "{{ pkgconfig.zfs.deppkgs[ansible_os_family] }}"
state: "{{ install_state }}"
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + pkgconfig.zfs.pkgs[ansible_os_family] }}"
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + pkgconfig_zfs.pkgs[ansible_os_family] }}"
become: true
tags:
- RedHat
- packages