pincher95.pimpmyshell
Ansible Role: PimpMyShell
NOTE:
- MacOS and Freebsd support under development.
- oh-my-posh under development.
Installs zsh, oh-my-zsh/oh-my-posh, fzf, exa, bat, fd, powerline10k on MacOS, Ubuntu/Debian, Redhat/Centos/Alma/Rocky, FreeBSD and configures packages, .zshrc and aliases according to supplied variables.
Requirements
None.
Operating Systems
The role tested the following operating systems:
Ubuntu 18.04, 20.04Debian 11CentOS 8AlmaLinux/RockyLinuxRed Hat Enterprise Linux 8
Untested operating systems:
MacOSFreeBSDCentOS 7
Role Variables
| Variable | Default | Comments (type) |
|---|---|---|
enable_zsh_plugins |
true | Enable zsh plugins from zsh-users repo. |
zsh_plugins |
[] | List of zsh plugins zsh-users repo. |
enable_bat |
true | Enable bat, a cat clone with syntax highlighting and Git integration, installing latest version from bat. |
enable_exa |
true | Enable exa, a modern replacement for ls, installing latest version from exa. |
enable_fd |
true | Enable fd While it does not aim to support all of find's powerful functionality, it provides sensible (opinionated) defaults for a majority of use cases, installing latest version from fd. |
enable_fzf |
true | Enable fzf, fzf is a general-purpose command-line fuzzy finder, installing latest version from fzf. |
enable_zsh_powerline10k |
true | Enable enable_zsh_powerline10k, Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience., installing latest version from Powerlevel10k. |
prompt_renderer |
oh-my-zsh | Choose prompt rendener available oh-my-zsh(https://ohmyz.sh/) or oh-my-posh(https://ohmyposh.dev/). |
upgrade_os |
fasle | Upgrade OS before installation. |
apps_source |
package | For Debian, Darwin and FreeBSD extra cli application can be installed via package manager. RedHat flavor will always use git as source |
fzf_env_config |
string | Block of fzf key binding and configurations. |
Available variables are listed below, along with default values (see defaults/main.yml):
zsh_plugins:
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-completions
- zsh-history-substring-search
Example zsh plugins.
fzf_env_config: |
# Setting for fzf
export FZF_DEFAULT_COMMAND='{{ "fd --type f --hidden --follow" if enable_fd | default(true) else "find . -type f" }}'
export FZF_DEFAULT_OPTS='--height 100% --multi --layout=reverse-list --inline-info'
# To apply the command to CTRL-T as well
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS="--preview '{{ "bat --color=always --line-range :500 {}" if enable_bat | default(true) else "less {}" }}'"
Example of fzf block key bunding and configurations.
Dependencies
For MacOS the following role and collection recommended:
Example Playbook
ansible-playbook -i inventory -u user -k -K --become-user root --become-method su test.yml
Example run for user user
---
- hosts: all
connection: local
vars:
prompt_renderer: "oh-my-zsh"
zsh_plugins:
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-completions
- zsh-history-substring-search
tasks:
- name: "Include pincher95.pimpmyshell"
ansible.builtin.include_role:
name: "pincher95.pimpmyshell"
See the tests/test.yml directory for an example of running this role over
Ansible's local connection.
License
Author Information
This role was created in 2022 by Yuri Tsuprun
Maintainer(s)
About
Role to pimp my shell, install zsh, oh-my-zsh/oh-my-posh, exa, bat, fzf, fd, tmux, git, etc.
Install
ansible-galaxy install pincher95.pimpmyshellLicense
Unknown
Downloads
40
Owner
DevOps engineer and love penguins
