fixing packages for new style
This commit is contained in:
@@ -1,68 +1,55 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Linux based installation
|
||||
when:
|
||||
- ansible_os_family != 'Darwin'
|
||||
block:
|
||||
- name: RedHat based configuration
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
rhname: "{%if ansible_distribution == 'Fedora' %}fedora{% else %}epel{% endif %}"
|
||||
- ansible.builtin.command:
|
||||
cmd: rpm --eval "%{dist}"
|
||||
register: rpm_dist
|
||||
|
||||
- name: add openzfs gpg_key
|
||||
- name: Add openzfs gpg_key
|
||||
become: "{{ sys_pkg_become }}"
|
||||
ansible.builtin.rpm_key:
|
||||
key: "{{ pkgconfig.zfs.gpg_key }}"
|
||||
fingerprint: "{{ pkgconfig.zfs.gpg_key_fingerprint }}"
|
||||
key: "{{ zfs.gpg_key }}"
|
||||
fingerprint: "{{ zfs.gpg_fp }}"
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: enable openzfs repository
|
||||
- name: Enable openzfs repository
|
||||
become: "{{ sys_pkg_become }}"
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ pkgconfig.zfs.repo_base }}{{ rhname }}/zfs-release-{{ pkgconfig.zfs[rhname].release }}{{ rpm_dist.stdout }}.noarch.rpm"
|
||||
state: "{{ install_state }}"
|
||||
become: true
|
||||
|
||||
- name: install zfs deps
|
||||
ansible.builtin.set_fact:
|
||||
syspkgs: "{{ pkgconfig.zfs.deps[ansible_os_family] }}"
|
||||
when: ansible_os_family == 'RedHat'
|
||||
name: "{{ zfs.repo_pkg }}"
|
||||
state: present
|
||||
|
||||
- name: Debian configuration
|
||||
when: ansible_os_family == 'Debian'
|
||||
block:
|
||||
- name: enable openzfs repository
|
||||
- name: Enable openzfs repository
|
||||
become: "{{ sys_pkg_become }}"
|
||||
ansible.builtin.apt_repository:
|
||||
repo: |
|
||||
deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main contrib
|
||||
deb-src http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main contrib
|
||||
filename: "{{ ansible_distribution_release }}-backports"
|
||||
deb http://deb.debian.org/debian {{ zfs.release }}-backports main contrib
|
||||
deb-src http://deb.debian.org/debian {{ zfs.release }}-backports main contrib
|
||||
filename: "{{ zfs.release }}-backports"
|
||||
state: present
|
||||
update_cache: false
|
||||
become: true
|
||||
|
||||
- name: pin zfs package to backports
|
||||
- name: Pin zfs package to backports
|
||||
become: "{{ sys_pkg_become }}"
|
||||
ansible.builtin.file:
|
||||
content: |
|
||||
Package: src:zfs-linux
|
||||
Pin: release n={{ ansible_distribution_release }}-backports
|
||||
Pin: release n={{ zfs.release }}-backports
|
||||
Pin-Priority: 990
|
||||
dest: /etc/apt/preferences.d/90_zfs
|
||||
state: present
|
||||
become: true
|
||||
mode: '0644'
|
||||
|
||||
- name: install zfs deps
|
||||
ansible.builtin.set_fact:
|
||||
syspkgs: "{{ pkgconfig.zfs.deps[ansible_os_family] }}"
|
||||
become: true
|
||||
|
||||
- name: append to pkgs
|
||||
- name: Append to pkgs
|
||||
ansible.builtin.set_fact:
|
||||
syspkgs: "{{ syspkgs + pkgconfig.zfs.pkgs[ansible_os_family] }}"
|
||||
become: true
|
||||
when: ansible_os_family != 'Darwin'
|
||||
pkg_sys: "{{ pkg_sys + zfs.deps + zfs.pkgs }}"
|
||||
|
||||
- name: append to caskpkgs
|
||||
ansible.builtin.set_fact:
|
||||
caskpkgs: "{{ caskpkgs + [ 'openzfs' ] }}"
|
||||
- name: Append to caskpkgs
|
||||
when: ansible_os_family == 'Darwin'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cask: "{{ pkg_cask + ['openzfs'] }}"
|
||||
|
||||
Reference in New Issue
Block a user