bundles/users: get default user data from users.json

This commit is contained in:
Franzi 2020-11-10 13:12:36 +01:00
parent c090a9c2c2
commit cca4fec761
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 52 additions and 19 deletions

View file

@ -30,7 +30,11 @@ for username, attrs in node.metadata['users'].items():
user['home'] = home
user['shell'] = '/bin/bash'
user['password_hash'] = 'x'
if 'password' in attrs:
user['password'] = attrs['password']
else:
user['password_hash'] = 'x' if node.use_shadow_passwords else '*'
if 'groups' in attrs:
user['groups'] = attrs['groups']