bundles/pacman: introduce, support pkg_pacman in some other bundles

This commit is contained in:
Franzi 2021-02-18 14:24:57 +01:00
parent 9bf7f856af
commit 32d129015e
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 46 additions and 3 deletions

View file

@ -26,22 +26,29 @@ files = {
}, },
} }
if node.has_bundle('pacman'):
package = 'pkg_pacman:openssh'
service = 'sshd'
else:
package = 'pkg_apt:openssh-server'
service = 'ssh'
actions = { actions = {
'sshd_check_config': { 'sshd_check_config': {
'command': 'sshd -T -C user=root -C host=localhost -C addr=localhost', 'command': 'sshd -T -C user=root -C host=localhost -C addr=localhost',
'triggered': True, 'triggered': True,
'triggers': { 'triggers': {
'svc_systemd:ssh:restart', 'svc_systemd:{}:restart'.format(service),
}, },
}, },
} }
svc_systemd = { svc_systemd = {
'ssh': { service: {
'needs': { 'needs': {
'pkg_apt:openssh-server',
'file:/etc/systemd/system/ssh.service.d/bundlewrap.conf', 'file:/etc/systemd/system/ssh.service.d/bundlewrap.conf',
'file:/etc/ssh/sshd_config', 'file:/etc/ssh/sshd_config',
package,
}, },
}, },
} }

View file

@ -6,4 +6,9 @@ defaults = {
'openssh-sftp-server': {}, 'openssh-sftp-server': {},
}, },
}, },
'pacman': {
'packages': {
'openssh': {},
},
},
} }

19
bundles/pacman/items.py Normal file
View file

@ -0,0 +1,19 @@
assert node.os == 'arch'
# This is more targeted to GUI systems. This is intentional.
pkg_pacman = {
'fish': {},
'fwupd': {},
'dialog': {},
'linux': {},
'netctl': {},
'rfkill': {},
'tmux': {},
'vim': {},
'wpa_supplicant': {},
'wpa_actiond': {},
}
for pkg, config in node.metadata.get('pacman', {}).get('packages', {}).items():
pkg_pacman[pkg] = config

12
bundles/sudo/metadata.py Normal file
View file

@ -0,0 +1,12 @@
defaults = {
'apt': {
'packages': {
'sudo': {},
},
},
'pacman': {
'packages': {
'sudo': {},
},
},
}