From 86946636c41a3ba1930bbd25ecb0240fae846e98 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Tue, 13 Jul 2021 01:04:49 +0200 Subject: [PATCH] wip --- bundles/ssh/items.py | 6 +++++- bundles/users/items.py | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bundles/ssh/items.py b/bundles/ssh/items.py index 7c7de09..4771d5a 100644 --- a/bundles/ssh/items.py +++ b/bundles/ssh/items.py @@ -4,4 +4,8 @@ files['/etc/ssh/sshd_config'] = { ], } -svc_systemd['ssh'] = {} +svc_systemd['ssh'] = { + 'needs': [ + 'tag:ssh_users', + ], +} diff --git a/bundles/users/items.py b/bundles/users/items.py index 2e69108..730c8db 100644 --- a/bundles/users/items.py +++ b/bundles/users/items.py @@ -11,16 +11,25 @@ for name, config in node.metadata.get('users').items(): 'content': config['privkey'] + '\n', 'owner': name, 'mode': '0600', + 'tags': [ + 'ssh_users', + ], } files[f"{config['home']}/.ssh/id_{config['keytype']}.pub"] = { 'content': config['pubkey'] + '\n', 'owner': name, 'mode': '0600', + 'tags': [ + 'ssh_users', + ], } files[config['home'] + '/.ssh/authorized_keys'] = { 'content': '\n'.join(sorted(config['authorized_keys'])) + '\n', 'owner': name, 'mode': '0600', + 'tags': [ + 'ssh_users', + ], } users[name] = config