This commit is contained in:
mwiegand 2021-07-05 13:26:35 +02:00
parent 9e1f38d175
commit 13e4ea67c9
8 changed files with 39 additions and 64 deletions

View file

@ -53,7 +53,6 @@ def dns(metadata):
}
@metadata_reactor.provides(
'users/backup-receiver/authorized_keys'
)

View file

@ -1,43 +0,0 @@
from os.path import join
for name, user_config in node.metadata.get('users').items():
if user_config.get('shell', None) != '/usr/bin/zsh':
continue
directories = {
join(user_config['home'], '.zsh'): {
'owner': name,
},
join(user_config['home'], '.zsh/oh-my-zsh'): {
'owner': name,
},
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
'owner': name,
},
}
git_deploy = {
join(user_config['home'], '.zsh/oh-my-zsh'): {
'repo': 'git://github.com/ohmyzsh/ohmyzsh.git',
'rev': 'master',
},
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
'repo': 'git://github.com/zsh-users/zsh-autosuggestions.git',
'rev': 'master',
},
}
files = {
join(user_config['home'], '.zshrc'): {
'owner': name,
'source': 'zshrc',
},
join(user_config['home'], '.zsh/oh-my-zsh/themes/bw.zsh-theme'): {
'owner': name,
'needs': [
f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}",
]
},
}

View file

@ -1,14 +1,43 @@
from os.path import join
for name, user_config in node.metadata.get('users').items():
print(user_config)
if 'oh_my_zsh' in user_config:
directories = {
join(user_config['home'], '.zsh'): {},
join(user_config['home'], '.zsh/oh-my-zsh'): {},
}
git_deploy[join(user_config['home'], '.zsh/oh-my-zsh')] = {
if user_config.get('shell', None) != '/usr/bin/zsh':
continue
directories = {
join(user_config['home'], '.zsh'): {
'owner': name,
},
join(user_config['home'], '.zsh/oh-my-zsh'): {
'owner': name,
},
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
'owner': name,
},
}
git_deploy = {
join(user_config['home'], '.zsh/oh-my-zsh'): {
'repo': 'git://github.com/ohmyzsh/ohmyzsh.git',
'rev': 'master',
}
},
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
'repo': 'git://github.com/zsh-users/zsh-autosuggestions.git',
'rev': 'master',
},
}
files = {
join(user_config['home'], '.zshrc'): {
'owner': name,
'source': 'zshrc',
},
join(user_config['home'], '.zsh/oh-my-zsh/themes/bw.zsh-theme'): {
'owner': name,
'needs': [
f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}",
]
},
}

View file

@ -5,13 +5,3 @@ defaults = {
}
}
}
@metadata_reactor.provides(
'users'
)
def users(metadata):
return {
'users': {
'user'
}
}

View file

@ -1,6 +1,7 @@
{
'bundles': [
'users',
'zsh',
],
'metadata': {
'dns': {},

View file

@ -12,7 +12,6 @@
],
'bundles': [
'nextcloud',
'oh-my-zsh',
'wireguard',
'zfs',
],