added armbian and os_flavor grain

This commit is contained in:
do
2021-07-23 16:35:25 +02:00
parent f4c3467d65
commit a03211dff9
4 changed files with 26 additions and 0 deletions

16
_grains/os_flavor.py Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python3
import re
import os.path
def _os_flavor():
if os.path.isfile('/etc/armbian-release'):
h = "Armbian"
else:
h = "Debian"
return h
def main():
grains = {}
grains['os_flavor'] = _hardware()
return grains

4
os/armbian.sls Normal file
View File

@@ -0,0 +1,4 @@
# remove this pesky thing,
# we knwo what we are doing
/etc/cron.d/armbian-updates:
file.absent:

5
os/init.sls Normal file
View File

@@ -0,0 +1,5 @@
include:
{% if grains['os_flavor'] == 'Armbian' %}
- .armbian
{% endif %}

View File

@@ -6,6 +6,7 @@ base:
'*':
- base
- hardware
- os
'tumor*':
- base.pki.ca
'adm01.wks':