Install and set up ZSH.
This role can also configure ~./zshrc
file, upload functions files or download and set up a nice standalone prompt
.
- RedHat family
- Debian + Ubuntu family
- Darwin (OSX) with homebrew package manager installed. (test are missing)
Unset by default, dictionary should defined like this:
__users__:
[username]:
[option]: [value]
Option | Type | Comments |
---|---|---|
zsh_default_shell | bool | Configure as default shell. Create .zshrc and .zfunctions . |
zsh_prompt_install | bool | Install prompt ?, default value is No |
zsh_prompt_name | string | Prompt name to load in .zshrc . |
zsh_prompt_download_url | string | Prompt download url, e.g mlpure |
zsh_prompt_additional_url | string | Prompt additional download url to put in .zfunctions . |
zsh_zfunctions_directory | string | Directory of files to upload on remote .zfunctions . |
zsh_zshrc_content | text | Lines to append in ~/.zshrc . |
Check defaults/main.yml for default values.
Variable | Type | Comments |
---|---|---|
zsh_default_prompt_name | string | Default prompt_name, pure . |
zsh_default_prompt_download_url | string | Prompt download url, pure |
zsh_default_prompt_download_md5 | string | md5 sum of zsh_default_prompt_download_url |
zsh_default_prompt_additional_url | string | pure async lib. |
zsh_default_prompt_additional_md5 | string | md5 sum of zsh_default_prompt_additional_url |
The following playbook will ensure zsh is present for root user and will setup dailyherold/pure-time
as prompt. This playbook will also append an alias in zshrc file.
# ./test/playbooks/configuration.yml
- hosts: localhost
remote_user: root
vars:
__users__:
root:
zsh_prompt_install: Yes
zsh_prompt_name: pure-time
zsh_prompt_download_url: https://raw.githubusercontent.com/dailyherold/pure-time/master/pure.zsh
zsh_prompt_download_md5: 968a6b6237dbce6c42fe173beb33275a
zsh_prompt_additional_url: https://raw.githubusercontent.com/dailyherold/pure-time/master/async.zsh
zsh_prompt_additional_md5: d5c77c6029c4594ac249ce6e44914a84
zfunctions_directory: ./files/zfunctions
zshrc_content: |
alias ls='ls -lah'
# Run
roles:
- zsh
MIT © Esolitos Based on: loliee/ansible-zsh MIT © Maxime Loliée