Franzi 9 months ago
parent
commit
1fc1867362
Signed by: kunsi GPG Key ID: 12E3D2136B818350
  1. 19
      bundles/users/items.py
  2. 12
      bundles/users/metadata.py
  3. 18
      groups.py
  4. 13
      nodes.py
  5. 1
      requirements.txt

19
bundles/users/items.py

@ -0,0 +1,19 @@
users = {
'root': {
'password': repo.vault.password_for(f'{node.name} root password'),
},
}
for user, config in node.metadata['users'].items():
directories[f'/home/{user}'] = {
'owner': user,
'mode': '0700',
}
users[user] = {
'password': config['password'],
'groups': {
'sudo',
},
'shell': '/bin/bash',
}

12
bundles/users/metadata.py

@ -0,0 +1,12 @@
@metadata_reactor
def generate_password_for_every_user(metadata):
users = {}
for user in metadata.get('users', {}).keys():
users[user] = {
'password': repo.vault.human_password_for(f'{node.name} user {user}'),
}
return {
'users': users,
}

18
groups.py

@ -0,0 +1,18 @@
groups = {
#'group-1': {
# 'bundles': (
# 'bundle-1',
# ),
# 'members': (
# 'node-1',
# ),
# 'subgroups': (
# 'group-2',
# ),
#},
'all': {
'member_patterns': (
r".*",
),
},
}

13
nodes.py

@ -0,0 +1,13 @@
nodes = {
'node-1': {
'hostname': "172.19.138.9",
'bundles': {
'users',
},
'metadata': {
'users': {
'kunsi': {},
},
},
},
}

1
requirements.txt

@ -0,0 +1 @@
bundlewrap>=4.2.2
Loading…
Cancel
Save