liquidctl
This commit is contained in:
11
liquidctl/files/liquidcfg.service
Normal file
11
liquidctl/files/liquidcfg.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=AIO startup service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/root/liquidctl/bin/liquidctl --match {{ salt.grains.get('corsair_aio') }} initialize --pump-mode=extreme
|
||||
ExecStart=/root/liquidctl/bin/liquidctl --match {{ salt.grains.get('corsair_aio') }} set fan speed 90
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
36
liquidctl/init.sls
Normal file
36
liquidctl/init.sls
Normal file
@@ -0,0 +1,36 @@
|
||||
# Ref: https://github.com/liquidctl/liquidctl#set-up-linux-using-systemd
|
||||
|
||||
{% set venv = '/usr/local/lib/liquidctl' %}
|
||||
|
||||
setup liquidctl venv:
|
||||
cmd.run:
|
||||
- name: python3 -m venv {{ venv }}
|
||||
- creates: {{ venv }}
|
||||
|
||||
install liquidctl:
|
||||
cmd.run:
|
||||
- name: {{ venv }}/bin/pip3 install liquidctl
|
||||
- unless: /usr/local/lib/liquidctl/bin/pip3 freeze | grep -q ^liquidctl==
|
||||
- require:
|
||||
- cmd: setup liquidctl venv
|
||||
|
||||
/etc/systemd/system/liquidcfg.service:
|
||||
file.managed:
|
||||
- template: jinja
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- source: salt://liquidctl/files/liquidcfg.service
|
||||
|
||||
systemd reload for liquidcfg.service:
|
||||
module.run:
|
||||
- name: service.systemctl_reload
|
||||
- onchanges:
|
||||
- file: /etc/systemd/system/liquidcfg.service
|
||||
|
||||
liquidcfg.service:
|
||||
service.running:
|
||||
- enable: true
|
||||
- watch:
|
||||
- file: /etc/systemd/system/liquidcfg.service
|
||||
- module: systemd reload for liquidcfg.service
|
||||
Reference in New Issue
Block a user