evolinux-base: harware: Support HP gen >=10 RAID controller

This commit is contained in:
Benoît S. 2020-06-16 12:35:56 +09:00 committed by Gitea
parent 2dc7d22c13
commit 215ecd6c2c
3 changed files with 33 additions and 11 deletions

View File

@ -214,3 +214,6 @@ evolinux_listupgrade_include: True
# Generate ldif
evolinux_generateldif_include: True
# Cron check_hpraid
evolinux_cron_checkhpraid_frequency: daily

View File

@ -25,15 +25,17 @@
when: broadcom_netextreme_search.rc == 0
## RAID
# Dell and others: MegaRAID SAS
# HP gen <10: Hewlett-Packard Company Smart Array
# HP gen >=10: Adaptec Smart Storage PQI
- name: Detect if RAID is installed
shell: lspci | grep "RAID bus controller" | grep -v Intel
shell: lspci -q | grep -e "RAID bus controller" -e "Serial Attached SCSI controller"
check_mode: no
register: raidmodel
changed_when: "'FAILED' in raidmodel.stdout"
failed_when: "'FAILED' in raidmodel.stdout"
- name: HP Smart Array package is present
- name: HPE Smart Storage Administrator (ssacli) is present
block:
- name: Add HPE GPG key
apt_key:
@ -44,28 +46,45 @@
apt_repository:
repo: 'deb https://downloads.linux.hpe.com/SDR/repo/mcp {{ ansible_distribution_release }}/current non-free'
state: present
- name: Install packages for HP hardware
- name: Install HPE Smart Storage Administrator (ssacli)
apt:
name:
- cciss-vol-status
- ssacli
name: ssacli
when:
- "'Hewlett-Packard Company Smart Array' in raidmodel.stdout"
- "'Adaptec Smart Storage PQI' in raidmodel.stdout"
# NOTE: check_hpraid cron use check_hpraid from nagios-nrpe role
# So, if nagios-nrpe role is not installed it will not work
- name: Install and configure check_hpraid cron (HP gen >=10)
block:
- name: check_hpraid cron is present (HP gen >=10)
copy:
src: check_hpraid.cron.sh
dest: /etc/cron.{{ evolinux_cron_checkhpraid_frequency | mandatory }}/check_hpraid
mode: "0755"
when: "'Adaptec Smart Storage PQI' in raidmodel.stdout"
- name: Install and configure cciss-vol-status (HP gen <10)
block:
- name: Install cciss-vol-status (HP gen <10)
apt:
name: cciss-vol-status
state: present
- name: cciss-vol-statusd init script is present
- name: cciss-vol-statusd init script is present (HP gen <10)
template:
src: hardware/cciss-vol-statusd.j2
dest: /etc/init.d/cciss-vol-statusd
mode: "0755"
- name: Configure cciss-vol-statusd
- name: Configure cciss-vol-statusd (HP gen <10)
lineinfile:
dest: /etc/default/cciss-vol-statusd
line: 'MAILTO="{{ raid_alert_email or general_alert_email | mandatory }}"'
regexp: 'MAILTO='
create: yes
- name: Enable HP hardware in systemd
- name: Enable cciss-vol-status in systemd (HP gen <10)
service:
name: cciss-vol-statusd
enabled: true