Vendor Galaxy Roles and Collections
Some checks failed
/ Ansible Lint (push) Failing after 5m45s
/ Ansible Lint (pull_request) Failing after 4m59s

This commit is contained in:
Stefan Bethke 2026-02-06 22:07:16 +01:00
commit 2aed20393f

View file

@ -0,0 +1,57 @@
---
# Copyright (C) 2014-2019 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2019 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Select supported release for current distribution
ansible.builtin.set_fact:
hwraid_register_release: '{{ hwraid_release }}'
when: hwraid_release in hwraid_distribution_releases[hwraid_distribution]
# if the current linux distribution is not available yet, we try to use the latest one
- name: Select latest release for current distribution if no match found
ansible.builtin.set_fact:
hwraid_register_release: '{{ hwraid_distribution_releases[hwraid_distribution][0] }}'
when: hwraid_register_release is undefined
- name: Configure HWRaid APT repository
ansible.builtin.apt_repository:
repo: 'deb http://hwraid.le-vert.net/{{ hwraid_distribution | lower }} {{ hwraid_register_release | lower }} main'
state: 'present'
update_cache: True
when: hwraid_register_release is defined and hwraid_register_release
- name: Get list of active kernel modules
ansible.builtin.shell: set -o nounset -o pipefail -o errexit && lsmod | awk '{print $1}'
args:
executable: 'bash'
register: hwraid_register_modules
changed_when: False
- name: Install packages for recognized RAID devices
ansible.builtin.apt:
name: '{{ item.1 }}'
state: 'present'
install_recommends: False
with_subelements:
- '{{ hwraid_device_database }}'
- 'packages'
register: hwraid__register_packages
until: hwraid__register_packages is succeeded
when: ((hwraid_register_release is defined and hwraid_register_release) and
item.0.module not in hwraid_blacklist and
item.0.module in hwraid_register_modules.stdout_lines)
- name: Make sure service starts at boot
ansible.builtin.service:
name: '{{ item.1 }}'
state: 'started'
enabled: yes
with_subelements:
- '{{ hwraid_device_database }}'
- 'daemons'
when: ((hwraid_register_release is defined and hwraid_register_release) and
item.0.module not in hwraid_blacklist and
item.0.module in hwraid_register_modules.stdout_lines)
# vim: syntax=yaml ts=2 sw=2 et sr softtabstop=2 autoindent paste