Compare commits
2 commits
34b42832ac
...
b9ff7e5953
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b9ff7e5953 | ||
![]() |
8063833950 |
2 changed files with 21 additions and 8 deletions
9
bundles/zsh/files/zprofile
Normal file
9
bundles/zsh/files/zprofile
Normal file
|
@ -0,0 +1,9 @@
|
|||
# /etc/zsh/zprofile: system-wide .zprofile file for zsh(1).
|
||||
#
|
||||
# This file is sourced only for login shells (i.e. shells
|
||||
# invoked with "-" as the first character of argv[0], and
|
||||
# shells invoked with the -l flag.)
|
||||
#
|
||||
# Global Order: zshenv, zprofile, zshrc, zlogin
|
||||
|
||||
alias s='sudo su - root -s /usr/bin/zsh'
|
|
@ -1,10 +1,14 @@
|
|||
from os.path import join
|
||||
|
||||
files = {
|
||||
'/etc/zsh/zprofile': {},
|
||||
}
|
||||
|
||||
for name, user_config in node.metadata.get('users').items():
|
||||
if user_config.get('shell', None) != '/usr/bin/zsh':
|
||||
continue
|
||||
|
||||
directories = {
|
||||
directories.update({
|
||||
join(user_config['home'], '.zsh'): {
|
||||
'owner': name,
|
||||
'group': name,
|
||||
|
@ -20,9 +24,9 @@ for name, user_config in node.metadata.get('users').items():
|
|||
f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}",
|
||||
]
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
git_deploy = {
|
||||
git_deploy.update({
|
||||
join(user_config['home'], '.zsh/oh-my-zsh'): {
|
||||
'repo': 'https://github.com/ohmyzsh/ohmyzsh.git',
|
||||
'rev': 'master',
|
||||
|
@ -37,9 +41,9 @@ for name, user_config in node.metadata.get('users').items():
|
|||
f'action:chown_zsh_{name}',
|
||||
],
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
files = {
|
||||
files.update({
|
||||
join(user_config['home'], '.zshrc'): {
|
||||
'owner': name,
|
||||
'group': name,
|
||||
|
@ -52,11 +56,11 @@ for name, user_config in node.metadata.get('users').items():
|
|||
f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}",
|
||||
]
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
actions = {
|
||||
actions.update({
|
||||
f'chown_zsh_{name}': {
|
||||
'command': f"chown -R {name}:{name} {user_config['home']}",
|
||||
'triggered': True,
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue