bundles/raspberrypi: introduce

This commit is contained in:
Franzi 2020-09-27 16:46:26 +02:00
parent 01364c2c50
commit 5d1e71e83e
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 73 additions and 6 deletions

View file

@ -0,0 +1,14 @@
disable_overscan=1
hdmi_force_hotplug=1
dtparam=spi=on
dtparam=spi=on
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
% if node.os == 'debian':
arm_64bit=1
% endif
% for key, value in node.metadata['raspberrypi']['config.txt'].items():
${key}=${value}
% endfor

View file

@ -0,0 +1,27 @@
default_target = node.metadata['raspberrypi']['default-target']
# On a FAT filesystem.
file_perms = {
'owner': None,
'group': None,
'mode': None,
}
actions = {
'raspberrypi_assure_target': {
'command': f'systemctl set-default {default_target}',
'unless': f'[ $(systemctl get-default) = "{default_target}" ]',
},
}
files = {
'/boot/cmdline.txt': {
'content': ' '.join(sorted(node.metadata['raspberrypi']['cmdline'])),
**file_perms,
},
'/boot/config.txt': {
'content_type': 'mako',
'context': node.metadata['raspberrypi'],
**file_perms,
},
}

View file

@ -0,0 +1,16 @@
defaults = {
'raspberrypi': {
'default-target': 'multi-user.target',
'cmdline': {
'console=tty1',
'root=/dev/mmcblk0p2',
'rootfstype=ext4',
'elevator=deadline',
'fsck.repair=yes',
'rootwait',
'quiet',
'plymouth.ignore-serial-consoles',
},
'config.txt': {},
},
}

12
groups/os.py Normal file
View file

@ -0,0 +1,12 @@
groups['raspberry'] = {
'bundles': {
'raspberrypi',
},
'metadata': {
'users': {
'pi': {
'delete': True,
},
},
},
}

View file

@ -4,8 +4,11 @@ nodes['home.octoprint-vielschichtigkeit'] = {
'nginx',
'octoprint',
},
'groups': set(),
'groups': {
'raspberry',
},
'metadata': {
'hostname': 'octoprint-vielschichtigkeit',
'interfaces': {
'eth0': {
'ipv4': {
@ -32,11 +35,6 @@ nodes['home.octoprint-vielschichtigkeit'] = {
},
},
},
'users': {
'pi': {
'delete': True,
},
},
'vm': {
'cpu': 4,
'ram': 1,