diff --git a/base/hardware/init.sls b/base/hardware/init.sls new file mode 100644 index 0000000..9ae313f --- /dev/null +++ b/base/hardware/init.sls @@ -0,0 +1,3 @@ + +include: + - base.hostconfig.{{ grains.get('hardware') | lower }} \ No newline at end of file diff --git a/base/hardware/raspberrypi.sls b/base/hardware/raspberrypi.sls new file mode 100644 index 0000000..2bb3ce1 --- /dev/null +++ b/base/hardware/raspberrypi.sls @@ -0,0 +1,22 @@ +systemd: + service: + raspberrypi_exporter: + Unit: + Description: Prometheus exporter for Raspberry Pi metrics + Wants: raspberrypi_exporter.timer + + Service: + ExecStart: /usr/local/sbin/raspberrypi_exporter + User: pi + Group: gpio + Type: oneshot + + timer: + raspberrypi_exporter: + Unit: + Description: Timer for the Raspberry Pi Prometheus exporter + Timer: + OnCalendar: '*:*:0,15,30,45' + Install: + WantedBy: timers.target + \ No newline at end of file diff --git a/base/hostconfig/init.sls b/base/hostconfig/init.sls index aa013df..8f9f0db 100644 --- a/base/hostconfig/init.sls +++ b/base/hostconfig/init.sls @@ -1,6 +1,4 @@ include: - base.hostconfig.{{ grains.get('nodename') }} - #{% if salt['file.file_exists']('{0}.sls'.format(grains.get('nodename'))) %} - #- base.hostconfig.{{ grains.get('nodename') }} - #{% endif %} + \ No newline at end of file diff --git a/base/init.sls b/base/init.sls index ff34ffb..cebcc61 100644 --- a/base/init.sls +++ b/base/init.sls @@ -3,5 +3,6 @@ --- include: + - base.hardware - base.sys.sysctl - base.hostconfig