bundles/users: add option to not automatically deploy configs

This commit is contained in:
Franzi 2020-04-04 17:54:26 +02:00
parent 4da792f522
commit 1856f4749c
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -58,33 +58,33 @@ for username, attrs in node.metadata['users'].items():
else:
files[home + '/.ssh/authorized_keys'] = {'delete': True}
if exists(join(repo.path, 'data', 'users', 'files', 'tmux', '{}.conf'.format(username))):
files[home + '/.tmux.conf'] = {
if attrs.get('deploy_configs', True):
if exists(join(repo.path, 'data', 'users', 'files', 'tmux', '{}.conf'.format(username))):
files[home + '/.tmux.conf'] = {
'content_type': 'mako',
'source': 'tmux/{}.conf'.format(username),
}
else:
files[home + '/.tmux.conf'] = {
'delete': True,
}
if exists(join(repo.path, 'data', 'users', 'files', 'fish', '{}.conf'.format(username))):
fish_src = 'fisk/{}.conf'.format(username)
else:
fish_src = 'fish.conf'
files[home + '/.config/fish/config.fish'] = {
'content_type': 'mako',
'source': 'tmux/{}.conf'.format(username),
}
else:
files[home + '/.tmux.conf'] = {
'delete': True,
'source': fish_src
}
if exists(join(repo.path, 'data', 'users', 'files', 'fish', '{}.conf'.format(username))):
fish_src = 'fisk/{}.conf'.format(username)
else:
fish_src = 'fish.conf'
files[home + '/.config/fish/config.fish'] = {
'content_type': 'mako',
'source': fish_src
}
if exists(join(repo.path, 'data', 'users', 'files', 'bash', '{}.bashrc'.format(username))):
files[home + '/.bashrc'] = {
'content_type': 'mako',
'source': 'bash/{}.bashrc'.format(username),
}
else:
files[home + '/.bashrc'] = {
'delete': True,
}
if exists(join(repo.path, 'data', 'users', 'files', 'bash', '{}.bashrc'.format(username))):
files[home + '/.bashrc'] = {
'content_type': 'mako',
'source': 'bash/{}.bashrc'.format(username),
}
else:
files[home + '/.bashrc'] = {
'delete': True,
}