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

@@ -10,3 +10,4 @@ include:
- prometheus - prometheus
- rsyslog - rsyslog
- sudoers - sudoers
- systemd

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-fan-control:
file: file:
- managed - 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 - source: salt://hardware/raspberrypi/fan/files/fan_ctrl.py
- user: root - user: root
- group: root - group: root
- mode: 0755 - 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']( set has_fan = salt['pillar.get'](
'hardware:raspberrypi:has_fan', 'hardware:raspberrypi:fan:has_fan',
default=False default=False
) )
%} %}