45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
---
|
|
|
|
- name: Install packages
|
|
become: yes
|
|
package:
|
|
name:
|
|
- smartmontools
|
|
- hdparm
|
|
state: present
|
|
|
|
- name: Set udev settings for drives
|
|
become: yes
|
|
copy:
|
|
dest: /etc/udev/rules.d/60-ioschedulers.rules
|
|
content: |
|
|
# set scheduler for NVMe
|
|
ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none"
|
|
# set scheduler for SSD and eMMC
|
|
ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline"
|
|
# set scheduler for rotating disks
|
|
ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"
|
|
owner: root
|
|
group: root
|
|
mode: 0700
|
|
register: udev_iosched
|
|
|
|
- name: Reload udev
|
|
become: yes
|
|
command: /bin/bash -c 'udevadm control --reload; udevadm trigger'
|
|
when: udev_iosched.changed
|
|
|
|
|
|
- include_tasks: amd.yml
|
|
when: "'AMD' in ansible_processor[1]"
|
|
|
|
- include_tasks: intel.yml
|
|
when: "'Intel' in ansible_processor"
|
|
|
|
|
|
- include_tasks: cyberpower.yml
|
|
when: "ups == 'cyberpower'"
|
|
|
|
- include_tasks: aps.yml
|
|
when: "ups == 'aps'"
|