bundles/users: add option to enable lingering
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-07-17 11:33:43 +02:00
parent 9fc86a4d9f
commit 6a144cf991
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 62 additions and 5 deletions

View file

@ -1,9 +1,5 @@
from os.path import join, exists
directories = {}
users = {}
groups = {}
files = {
'/etc/bash.bashrc': {
'source': 'bashrc',
@ -76,3 +72,18 @@ for username, attrs in node.metadata['users'].items():
files[home + '/.bashrc'] = {
'delete': True,
}
if attrs.get('enable_linger', False):
linger_test = ''
linger_command = 'enable'
else:
linger_test = '!'
linger_command = 'disable'
actions[f'ensure_linger_state_for_user_{username}'] = {
'command': f'loginctl {linger_command}-linger {username}',
'unless': f'{linger_test} test -f /var/lib/systemd/linger/{username}',
'needs': {
f'user:{username}',
},
}

View file

@ -196,6 +196,7 @@ nodes['htz-cloud.miniserver'] = {
},
'users': {
'sophie': {
'enable_linger': True,
'ssh_pubkey': [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDILcYrMQNRVXAm5L+7No1ZumqfCyRc1QZmTY3O7Q8hsE4+fCAvwsWm2aSMfLL3NnIl8Nm1Rixzic5jdYKYNIY3SlX1wvTB+MhGb2eyVSd7c/Y98aCLSlDkQ2sebjpdA1FoJOeGD3qxqDwj0+KckXU2ZaSSQY7CxVsjH65UxCHqVAg+6uLdNbj7j850s1B9NXVXef+sBQ5jUngXxnqQWwNh2Mn8auwumkeEG4SYf96wyFkLvmBitOng/GyLWl9YPnXXHHDnatcVipy7y34qw4CQ4P84anecbA+Bqr9IcxBW6qYmYgRKEnAcmEfjQd+BI1gCLB1BBEmb/qp+mVLd4tOh sophie@carbon"
],

View file

@ -416,6 +416,7 @@ nodes['htz.ex42-1048908'] = {
},
'users': {
'kunsi': {
'enable_linger': True,
'groups': [
'www-data',
'libvirt',

View file

@ -48,14 +48,41 @@ nodes['rx300'] = {
# more php
'php-imagick': {},
'php-yaml': {},
# used by user:kunsi
'mosh': {},
'weechat': {},
'weechat-core': {},
'weechat-curses': {},
'weechat-perl': {},
'weechat-plugins': {},
'weechat-python': {},
'weechat-ruby': {},
},
# XXX remove this once nginx.org has packages for debian bullseye
'repos': {
# XXX remove this once nginx.org has packages for debian bullseye
'nginx': {
'items': atomic({
'deb http://nginx.org/packages/debian buster nginx',
}),
},
'weechat': {
'items': {
'deb https://weechat.org/debian {os_release} main',
},
},
},
},
'backup-client': {
'pre-hooks': {
# 'kunsi-weechat': \
# 'echo \'core.weechat */layout store\' >> /home/kunsi/.weechat/weechat_fifo\n' \
# 'echo \'core.weechat */save\' >> /home/kunsi/.weechat/weechat_fifo\n',
},
},
'backups': {
'paths': {
'/home/kunsi/.weechat',
},
},
'check-mail-received': {
@ -117,6 +144,22 @@ nodes['rx300'] = {
'install_ssh_key': True,
'domain': 'jenkins.franzi.business',
},
'letsencrypt': {
# 'concat_and_deploy': {
# 'kunsi-weechat': {
# 'match_domain': 'part.of.the.trans-agenda.eu',
# 'target': '/home/kunsi/.weechat/ssl/relay.pem',
# 'chown': 'kunsi:kunsi',
# 'chmod': '0440',
# 'commands': [
# 'echo \'core.weechat */relay sslcertkey\' >> /home/kunsi/.weechat/weechat_fifo'
# ],
# },
# },
# 'domains': {
# 'part.of.the.trans-agenda.eu': set(),
# },
},
'miniflux': {
'domain': 'rss.franzi.business',
},
@ -256,6 +299,7 @@ nodes['rx300'] = {
},
'users': {
'kunsi': {
'enable_linger': True,
'groups': {
'libvirt',
},