ansible-roles/evolinux-base/tasks/hardware.yml
Benoît S. 771c75c1de
Some checks reported errors
continuous-integration/drone/push Build encountered an error
continuous-integration/drone/pr Build is passing
all-roles: Dot not use ansible_lsb as it is deprecated
We move from `ansible_lsb.codename` to `ansible_distribution_release`.
2019-07-03 09:41:35 +02:00

90 lines
2.2 KiB
YAML

---
- name: Install pciutils
apt:
name: pciutils
state: present
## Broadcom NetXtreme II
- name: Check if Broadcom NetXtreme II device is present
shell: "lspci | grep -q 'NetXtreme II'"
check_mode: no
register: broadcom_netextreme_search
failed_when: False
changed_when: False
# 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
include_role:
name: apt
tasks_from: basics.yml
vars:
apt_basics_components: "main contrib non-free"
when: broadcom_netextreme_search.rc == 0
## RAID
- name: Detect if RAID is installed
shell: lspci | grep "RAID bus controller" | grep -v Intel
check_mode: no
register: raidmodel
changed_when: "'FAILED' in raidmodel.stdout"
failed_when: "'FAILED' in raidmodel.stdout"
- block:
- name: Install packages for HP hardware
apt:
name: cciss-vol-status
state: present
- name: Configure packages for HP hardware
template:
src: hardware/cciss-vol-statusd.j2
dest: /etc/init.d/cciss-vol-statusd
mode: "0755"
- name: Enable HP hardware in systemd
service:
name: cciss-vol-statusd
enabled: true
state: started
when: "'Hewlett-Packard Company Smart Array' in raidmodel.stdout"
- block:
- name: Add HW tool GPG key
apt_key:
# url: https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key
data: "{{ lookup('file', 'hwraid.le-vert.net.gpg.key') }}"
when: ansible_distribution_release == "stretch"
- name: Add HW tool repository
apt_repository:
repo: 'deb http://hwraid.le-vert.net/debian stretch main'
state: present
when: ansible_distribution_release == "stretch"
- name: Install packages for DELL/LSI hardware
apt:
name: "{{ item }}"
allow_unauthenticated: yes
with_items:
- megacli
- megaclisas-status
- name: Configure packages for DELL/LSI hardware
template:
src: hardware/megaclisas-statusd.j2
dest: /etc/default/megaclisas-statusd
mode: "0755"
- name: Enable DELL/LSI hardware in systemd
service:
name: megaclisas-statusd
enabled: true
state: started
when: "'MegaRAID SAS' in raidmodel.stdout"
- meta: flush_handlers