2016-11-07 14:00:57 +01:00
|
|
|
---
|
|
|
|
- name: Install pciutils
|
|
|
|
apt:
|
|
|
|
name: pciutils
|
|
|
|
state: present
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2016-11-07 14:00:57 +01:00
|
|
|
|
|
|
|
## Broadcom NetXtreme II
|
|
|
|
|
|
|
|
- name: Check if Broadcom NetXtreme II device is present
|
|
|
|
shell: "lspci | grep -q 'NetXtreme II'"
|
2017-03-24 14:15:09 +01:00
|
|
|
check_mode: no
|
2017-10-07 12:57:05 +02:00
|
|
|
register: broadcom_netextreme_search
|
2016-11-07 14:00:57 +01:00
|
|
|
failed_when: False
|
|
|
|
changed_when: False
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2016-11-07 14:00:57 +01:00
|
|
|
|
|
|
|
# TODO: add the "non-free" part to the existing sources
|
|
|
|
# instead of adding a new source
|
|
|
|
|
|
|
|
- name: Add non-free repo for Broadcom NetXtreme II
|
2017-06-13 11:45:34 +02:00
|
|
|
include_role:
|
2019-11-29 14:00:25 +01:00
|
|
|
name: evolix/apt
|
2017-06-13 11:21:27 +02:00
|
|
|
tasks_from: basics.yml
|
|
|
|
vars:
|
2017-07-19 08:56:46 +02:00
|
|
|
apt_basics_components: "main contrib non-free"
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2017-10-07 12:57:05 +02:00
|
|
|
when: broadcom_netextreme_search.rc == 0
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2021-09-16 15:58:10 +02:00
|
|
|
|
|
|
|
## Dedicated hardware
|
|
|
|
- name: Install freepmi when it's dedicated hardware
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- libipc-run-perl
|
|
|
|
- freeipmi
|
|
|
|
state: present
|
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
when: ansible_virtualization_role == "host"
|
|
|
|
|
2016-11-07 14:00:57 +01:00
|
|
|
## RAID
|
2020-06-16 05:35:56 +02:00
|
|
|
# Dell and others: MegaRAID SAS
|
|
|
|
# HP gen <10: Hewlett-Packard Company Smart Array
|
|
|
|
# HP gen >=10: Adaptec Smart Storage PQI
|
2016-11-07 14:00:57 +01:00
|
|
|
- name: Detect if RAID is installed
|
2021-08-24 18:16:11 +02:00
|
|
|
shell:
|
|
|
|
cmd: "lspci -q | grep -e 'RAID bus controller' -e 'Serial Attached SCSI controller'"
|
2021-07-06 16:09:17 +02:00
|
|
|
executable: /bin/bash
|
2017-03-24 14:15:09 +01:00
|
|
|
check_mode: no
|
2016-11-07 14:00:57 +01:00
|
|
|
register: raidmodel
|
|
|
|
changed_when: "'FAILED' in raidmodel.stdout"
|
|
|
|
failed_when: "'FAILED' in raidmodel.stdout"
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2021-07-04 22:08:47 +02:00
|
|
|
- name: Look for legacy apt keyring
|
|
|
|
stat:
|
|
|
|
path: /etc/apt/trusted.gpg
|
|
|
|
register: _trusted_gpg_keyring
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2021-07-04 22:08:47 +02:00
|
|
|
|
2020-06-16 05:35:56 +02:00
|
|
|
- name: HPE Smart Storage Administrator (ssacli) is present
|
2019-12-31 16:56:03 +01:00
|
|
|
block:
|
2021-05-06 13:43:59 +02:00
|
|
|
- name: HPE GPG embedded key is absent
|
2019-12-31 16:56:03 +01:00
|
|
|
apt_key:
|
2021-05-03 14:23:13 +02:00
|
|
|
id: "26C2B797"
|
2021-05-06 13:43:59 +02:00
|
|
|
keyring: /etc/apt/trusted.gpg
|
2021-05-03 14:23:13 +02:00
|
|
|
state: absent
|
2021-07-04 22:08:47 +02:00
|
|
|
when: _trusted_gpg_keyring.stat.exists
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2021-05-03 14:23:13 +02:00
|
|
|
|
|
|
|
- name: HPE GPG key is installed
|
|
|
|
copy:
|
|
|
|
src: hpePublicKey2048_key1.asc
|
|
|
|
dest: /etc/apt/trusted.gpg.d/hpePublicKey2048_key1.asc
|
|
|
|
force: yes
|
|
|
|
mode: "0644"
|
2021-05-26 13:47:34 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2019-12-31 16:56:03 +01:00
|
|
|
|
|
|
|
- name: Add HPE repository
|
|
|
|
apt_repository:
|
|
|
|
repo: 'deb https://downloads.linux.hpe.com/SDR/repo/mcp {{ ansible_distribution_release }}/current non-free'
|
|
|
|
state: present
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2020-06-16 05:35:56 +02:00
|
|
|
- name: Install HPE Smart Storage Administrator (ssacli)
|
|
|
|
apt:
|
|
|
|
name: ssacli
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2020-06-16 05:35:56 +02:00
|
|
|
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"
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- config
|
2020-06-16 05:35:56 +02:00
|
|
|
when: "'Adaptec Smart Storage PQI' in raidmodel.stdout"
|
2019-12-31 16:56:03 +01:00
|
|
|
|
2020-06-16 05:35:56 +02:00
|
|
|
- name: Install and configure cciss-vol-status (HP gen <10)
|
|
|
|
block:
|
|
|
|
- name: Install cciss-vol-status (HP gen <10)
|
2019-12-31 16:56:03 +01:00
|
|
|
apt:
|
2020-06-16 05:35:56 +02:00
|
|
|
name: cciss-vol-status
|
2019-12-31 16:56:03 +01:00
|
|
|
state: present
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2019-12-31 16:56:03 +01:00
|
|
|
|
2020-06-16 05:35:56 +02:00
|
|
|
- name: cciss-vol-statusd init script is present (HP gen <10)
|
2019-12-31 16:56:03 +01:00
|
|
|
template:
|
|
|
|
src: hardware/cciss-vol-statusd.j2
|
|
|
|
dest: /etc/init.d/cciss-vol-statusd
|
|
|
|
mode: "0755"
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2020-06-16 05:42:33 +02:00
|
|
|
|
2020-06-16 05:35:56 +02:00
|
|
|
- name: Configure cciss-vol-statusd (HP gen <10)
|
2020-04-10 11:35:33 +02:00
|
|
|
lineinfile:
|
|
|
|
dest: /etc/default/cciss-vol-statusd
|
|
|
|
line: 'MAILTO="{{ raid_alert_email or general_alert_email | mandatory }}"'
|
|
|
|
regexp: 'MAILTO='
|
|
|
|
create: yes
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- config
|
2019-12-31 16:56:03 +01:00
|
|
|
|
2020-06-16 05:35:56 +02:00
|
|
|
- name: Enable cciss-vol-status in systemd (HP gen <10)
|
2019-12-31 16:56:03 +01:00
|
|
|
service:
|
|
|
|
name: cciss-vol-statusd
|
|
|
|
enabled: true
|
2020-04-10 11:35:33 +02:00
|
|
|
state: restarted
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
- config
|
2016-11-07 14:00:57 +01:00
|
|
|
when: "'Hewlett-Packard Company Smart Array' in raidmodel.stdout"
|
|
|
|
|
2019-12-31 16:56:03 +01:00
|
|
|
- name: MegaRAID SAS package is present
|
|
|
|
block:
|
2021-05-06 11:33:19 +02:00
|
|
|
- name: HWRaid embedded GPG key is absent
|
2019-12-31 16:56:03 +01:00
|
|
|
apt_key:
|
2021-05-03 14:23:13 +02:00
|
|
|
id: "23B3D3B4"
|
2021-05-06 13:43:59 +02:00
|
|
|
keyring: /etc/apt/trusted.gpg
|
2021-05-03 14:23:13 +02:00
|
|
|
state: absent
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2021-07-06 16:22:45 +02:00
|
|
|
when: _trusted_gpg_keyring.stat.exists
|
2021-05-03 14:23:13 +02:00
|
|
|
|
|
|
|
- name: HWRaid GPG key is installed
|
|
|
|
copy:
|
|
|
|
src: hwraid.le-vert.net.asc
|
|
|
|
dest: /etc/apt/trusted.gpg.d/hwraid.le-vert.net.asc
|
|
|
|
force: yes
|
|
|
|
mode: "0644"
|
2021-05-26 13:47:34 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2020-02-25 10:45:35 +01:00
|
|
|
when: ansible_distribution_major_version is version('9', '>=')
|
2019-12-31 16:56:03 +01:00
|
|
|
|
|
|
|
- name: Add HW tool repository
|
|
|
|
apt_repository:
|
|
|
|
repo: 'deb http://hwraid.le-vert.net/debian {{ ansible_distribution_release }} main'
|
|
|
|
state: present
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2019-12-31 16:56:03 +01:00
|
|
|
|
|
|
|
- name: Install packages for DELL/LSI hardware
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- megacli
|
|
|
|
- megaclisas-status
|
|
|
|
allow_unauthenticated: yes
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
2019-12-31 16:56:03 +01:00
|
|
|
|
|
|
|
- name: Configure packages for DELL/LSI hardware
|
|
|
|
template:
|
|
|
|
src: hardware/megaclisas-statusd.j2
|
|
|
|
dest: /etc/default/megaclisas-statusd
|
|
|
|
mode: "0755"
|
2021-07-07 14:32:38 +02:00
|
|
|
tags:
|
|
|
|
- config
|
2019-12-31 16:56:03 +01:00
|
|
|
|
|
|
|
- name: Enable DELL/LSI hardware in systemd
|
|
|
|
service:
|
|
|
|
name: megaclisas-statusd
|
|
|
|
enabled: true
|
2021-07-07 14:32:38 +02:00
|
|
|
state: restarted
|
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
- config
|
2021-07-06 16:12:14 +02:00
|
|
|
when: "'MegaRAID' in raidmodel.stdout"
|
2017-01-03 17:02:23 +01:00
|
|
|
|
|
|
|
- meta: flush_handlers
|