Merge branch 'master' of ssh://git.maketank.net:2222/chaos/salt-master
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
|
||||
apt-proxy:
|
||||
file.managed:
|
||||
file.absent:
|
||||
- name: /etc/apt/apt.conf.d/proxy
|
||||
- contents: |
|
||||
# SALT managed
|
||||
Acquire::http::proxy "http://apt-cache.lan:3142";
|
||||
Acquire::ftp::proxy "http://apt-cache.lan:3142";
|
||||
Acquire::http::proxy "http://apt-cache.lan";
|
||||
Acquire::ftp::proxy "http://apt-cache.lan";
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ set hardwaretype = salt['grains.get'](
|
||||
)
|
||||
%}
|
||||
|
||||
include:
|
||||
{%- if 'unknown' not in hardwaretype %}
|
||||
- .apt
|
||||
{%- endif %}
|
||||
#include:
|
||||
#{%- if 'unknown' not in hardwaretype %}
|
||||
# - .apt
|
||||
#{%- endif %}
|
||||
|
||||
5
hardware/espressobin/init.sls
Normal file
5
hardware/espressobin/init.sls
Normal file
@@ -0,0 +1,5 @@
|
||||
#!jinja|yaml|gpg
|
||||
|
||||
|
||||
include:
|
||||
- .pkgs
|
||||
6
hardware/espressobin/pkgs.sls
Normal file
6
hardware/espressobin/pkgs.sls
Normal file
@@ -0,0 +1,6 @@
|
||||
#!jinja|yaml|gpg
|
||||
|
||||
espressobin-pkgs:
|
||||
pkg.installed:
|
||||
- pkgs:
|
||||
- smartmontools
|
||||
@@ -3,3 +3,11 @@ include:
|
||||
{% if grains['hardware'] == 'RaspberryPi' %}
|
||||
- .raspberrypi
|
||||
{% endif %}
|
||||
|
||||
#{% if grains['hardware'] == 'Pine64' %}
|
||||
# - .pine64
|
||||
#{% endif %}
|
||||
|
||||
{% if grains['hardware'] == 'Espressobin' %}
|
||||
- .espressobin
|
||||
{% endif %}
|
||||
@@ -10,7 +10,7 @@ import sys
|
||||
|
||||
# Configuration
|
||||
FAN_PIN = getenv('RPI_FAN_PIN', 21) # BCM pin used to drive transistor's base
|
||||
WAIT_TIME = getenv('RPI_FAN_WAITTIME', 5) # [s] Time to wait between each refresh
|
||||
WAIT_TIME = getenv('RPI_FAN_WAITTIME', 10) # [s] Time to wait between each refresh
|
||||
FAN_MIN = getenv('RPI_FAN_MIN', 80) # [%] Fan minimum speed.
|
||||
PWM_FREQ = getenv('RPI_FAN_PWMFREQ', 25000) # [Hz] Change this value if fan has strange behavior
|
||||
# Fan speed will change only of the difference of temperature is higher than hysteresis
|
||||
@@ -21,7 +21,7 @@ prom_collect_dir = getenv('RPI_PROM_COLLECTDIR','/tmp/textfile-collector')
|
||||
prom_collect_file = prom_collect_dir + '/rpi_fan.prom'
|
||||
|
||||
# Configurable temperature and fan speed steps
|
||||
tempSteps = [60, 66, 70, 75] # [°C]
|
||||
tempSteps = [60, 70, 75, 80] # [°C]
|
||||
speedSteps = [0, 80, 90, 100] # [%]
|
||||
# tempSteps = [40, 45]
|
||||
# speedSteps = [0, 100]
|
||||
|
||||
@@ -13,6 +13,8 @@ set has_fan = salt['pillar.get'](
|
||||
%}
|
||||
|
||||
include:
|
||||
- .repo
|
||||
- .wifi
|
||||
{%- if 'node_exporter' in has_promexporter %}
|
||||
- .prometheus-exporter
|
||||
{%- endif %}
|
||||
|
||||
37
hardware/raspberrypi/repo.sls
Normal file
37
hardware/raspberrypi/repo.sls
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
---
|
||||
|
||||
{%- set cache_url = salt['pillar.get'](
|
||||
'services:apt-cache',
|
||||
default=''
|
||||
)
|
||||
%}
|
||||
|
||||
repo_raspi:
|
||||
pkgrepo.managed:
|
||||
- name: deb http://{{ cache_url }}raspbian.raspberrypi.org/raspbian/ {{ grains['oscodename'] }} main contrib firmware rpi
|
||||
- dist: {{ grains['oscodename'] }}
|
||||
- file: /etc/apt/sources.list.d/raspi.list
|
||||
- clean_file: True
|
||||
- key_url: http://archive.raspberrypi.org/debian/raspberrypi.gpg.key
|
||||
|
||||
repo_archive_raspi:
|
||||
pkgrepo.managed:
|
||||
- name: deb http://{{ cache_url }}archive.raspberrypi.org/debian/ {{ grains['oscodename'] }} main
|
||||
- dist: {{ grains['oscodename'] }}
|
||||
- file: /etc/apt/sources.list.d/raspi_archive.list
|
||||
- clean_file: True
|
||||
- key_url: https://archive.raspbian.org/raspbian.public.key
|
||||
|
||||
{% if grains.get('os_flavor') == 'OSMC' %}
|
||||
|
||||
repo_archive_osmc:
|
||||
pkgrepo.managed:
|
||||
- name: deb http://{{ cache_url }}apt.osmc.tv {{ grains['oscodename'] }} main
|
||||
- dist: {{ grains['oscodename'] }}
|
||||
- file: /etc/apt/sources.list.d/osmc.list
|
||||
- clean_file: True
|
||||
- key_url: https://ftp.fau.de/osmc/osmc/apt/osmc_repository.gpg
|
||||
|
||||
{% endif %}
|
||||
6
hardware/raspberrypi/wifi/files/interfaces-wlan0
Normal file
6
hardware/raspberrypi/wifi/files/interfaces-wlan0
Normal file
@@ -0,0 +1,6 @@
|
||||
# SALTSTACK
|
||||
allow-hotplug wlan0
|
||||
iface wlan0 inet dhcp
|
||||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
wireless-power off
|
||||
|
||||
8
hardware/raspberrypi/wifi/init.sls
Normal file
8
hardware/raspberrypi/wifi/init.sls
Normal file
@@ -0,0 +1,8 @@
|
||||
# disable wifi powermanagement
|
||||
|
||||
ifup-wlan0-powersave-off:
|
||||
file.managed:
|
||||
- name: /etc/network/interfaces.d/wlan0
|
||||
- source:
|
||||
- salt://hardware/raspberrypi/wifi/files/interfaces-wlan0
|
||||
|
||||
Reference in New Issue
Block a user