A role for Ansible, that installs zsh and Oh My Zsh for better Terminal workflow.
This role does not need any additional required packages.
- First clone this repository and add into your project directory.
- Include the role in your Ansible playbook.
Example use of a role, that will install the latest version of zsh and Oh My Zsh.
- hosts: all
roles:
- role: krudi.zsh
zsh:
write_file: true
change_shell: true
omz:
install: true
user: bob
plugins:
- git
- zsh-autosuggestions| Variable | Default | Description |
|---|---|---|
zsh.write_file |
true |
Whether to write the user's ~/.zshrc from the role template. |
zsh.change_shell |
true |
Whether to change the user's default shell to zsh. |
omz.install |
true |
Whether Oh My Zsh should be installed. |
omz.user |
bob |
The user Oh My Zsh (and the .zshrc) is installed for. |
omz.plugins |
["git", "zsh-autosuggestions"] |
The Oh My Zsh plugins enabled in the generated .zshrc. |
See defaults/main.yml for the current defaults. Note omz.user defaults to bob, which you will typically want to override for your own user.
This role includes a Molecule test scenario under molecule/default. Run it with uvx --with-requirements requirements-ci.txt --from molecule molecule test (requires Docker and provisions real containers, so run it deliberately rather than as part of routine checks).
Lint the role with uvx --with-requirements requirements-ci.txt ansible-lint; uvx lefthook install runs it on staged files before each commit.
Have you found a bug in this project or have a suggestion for a new feature? Create a new ticket for the bug or feature, which can be found on the GitHub page.