Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Cross-platform ansible role for installing and configuring zsh with oh-my-zsh

License

Notifications You must be signed in to change notification settings

drew1kun/ansible-role-ohmyzsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible role: ohmyzsh

MIT licensed Galaxy Role

DEPRECATION NOTICE

This role is being deprecated in favor of ansible-collection-slickshell.

Collection on Galaxy: drew1kun.slickshell

Description

Cross-platform ansible role for installing and configuring zsh with oh-my-zsh

There is a choice between powerlevel10k and powerlevel9k Default oh-my-zsh theme is powerlevel10k

If only p10k is set to yes, then p9k will not be installed and configured. It is not recommended to set p9k only to yes, because it's slow). If both p9k and p10k are set to yes, then p10k will be used but the p9k style will be sourced. If installed both, but want to turn p9k off, then comment the following line in ~/.zshrc:

source ${HOME}/.zsh/omz_powerlevel9k.cfg

In combination with ansible-macterm role getting the following results(assuming you are using p9k or p10k+p9k combo):

alt text

Requirements

NOTE: Role requires Fact Gathering by ansible!

One of the following OS (or deriviatives):

For MacOS: if Homebrew is not installed on the managed host, install the following role via galaxy:

ansible-galaxy install geerlingguy.homebrew

And include it in the playbook:

roles:
- geerlingguy.homebrew

Role Variables

OS-Agnostic:

Variable Description Default
ohmyzsh_install_dir Directory oh-my-zsh to be installed in /usr/local/share/ohmyzsh
ohmyzsh_custom_aliases File containing custom shell config $HOME/.zsh/aliases.local
ohmyzsh_powerlevel10k Whether to install powerlevel10k theme or not yes
ohmyzsh_powerlevel9k Whether to install powerlevel9k theme or not yes
ohmyzsh_powerlevel9k_cfg Path to powerlevel9k config file ${HOME}/.zsh/omz_powerlevel9k.cfg
ohmyzsh_users[] List of users to install zsh/oh-my-zsh for see defaults/main.yml
ohmyzsh_default_theme Default theme to be configured for users which do not have theme specified robbyrussell
ohmyzsh_default_plugins[] The list of plugins for oh-my-zhs to be installed see defaults/main.yml
ohmyzsh_custom_plugins[] The list of custom plugins for oh-my-zhs to be installed see defaults/main.yml

OS-Specific:

Variable Description Default
ohmyzsh_root_dir Root directory
  • Darwin: /var/root
  • Debian: /root
ohmyzsh_home_dir User's home directory
  • Darwin: /Users/
  • Debian: /home/
ohmyzsh_zprofile_dir Zsh profile directory
  • Darwin: /etc/
  • Debian: /etc/zsh/

Dependencies

None

Example Playbook

- hosts: dev_clients_macos
  gather_facts: yes
  roles:
  - geerlingguy.homebrew
  - drew1kun.ohmyzsh

License

MIT

Author Information

Andrew Shagayev | e-mail

About

Cross-platform ansible role for installing and configuring zsh with oh-my-zsh

Resources

License

Stars

Watchers

Forks

Packages

No packages published