Vendor Galaxy Roles and Collections
This commit is contained in:
parent
c1e1897cda
commit
2aed20393f
1 changed files with 387444 additions and 2 deletions
|
|
@ -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
|
||||
Loading…
Reference in a new issue