This commit is contained in:
do
2020-05-24 17:07:51 +02:00
parent 95898f3b48
commit a319ee0abc
3 changed files with 19 additions and 3 deletions

View File

@@ -1,11 +1,26 @@
{%
set has_fan = salt['pillar.get'](
'hardware:raspberrypi:fan:has_fan',
default=False
)
%}
include:
- systemd.units
file-fan-control:
file:
- managed
- name: /usr/local/bin/fan_ctrl.py
- name: {{ salt['pillar.get']('hardware:raspberrypi:fan:controller') }}
- source: salt://hardware/raspberrypi/fan/files/fan_ctrl.py
- user: root
- group: root
- mode: 0755
{{ salt['pillar.get']('hardware:raspberrypi:fan:service_name') }}:
service.running:
- enable: {{ has_fan }}
- reload: {{ has_fan }}
- watch:
- file: {{ salt['pillar.get']('hardware:raspberrypi:fan:controller') }}

View File

@@ -1,7 +1,7 @@
{%
set has_fan = salt['pillar.get'](
'hardware:raspberrypi:has_fan',
'hardware:raspberrypi:fan:has_fan',
default=False
)
%}