tomereli.oh_my_zsh_p10k
Ansible Role: oh_my_zsh_p10k
This Ansible role installs and sets up oh-my-zsh with the powerlevel10k theme for specific users. You can use your own configuration files (.zshrc
and .p10k.zsh
) or the ones provided.
Requirements
Make sure you have internet access. If you are behind a proxy, use the tomereli.proxy
role first.
Role Variables
You can customize the following variables (see defaults/main.yml
for default values):
Theme: Set the default theme:
oh_my_zsh_theme: powerlevel10k
Plugins: Set the default plugins to use:
oh_my_zsh_plugins: - git - zsh-autosuggestions - zsh-syntax-highlighting
Custom Template for
.zshrc
: Specify your own template:zshrc_src_template: .zshrc.j2
Custom File for
.p10k.zsh
: Specify your own file:p10k_src_file: .p10k.zsh
Dependencies
This role does not have any dependencies and only uses built-in modules.
Example Playbook
Here's how to set up oh-my-zsh with powerlevel10k for testuser1
and testuser2
:
- hosts: all
roles:
- role: tomereli.oh_my_zsh_p10k
vars:
users:
- username: testuser1
- username: testuser2
If you want to use your own .zshrc
template, set the zshrc_src_template
variable to your custom template (e.g., templates/custom.zshrc.j2
):
- hosts: all
roles:
- role: tomereli.oh_my_zsh_p10k
vars:
users:
- username: testuser1
zshrc_src_template: custom.zshrc.j2
p10k_src_file: custom.p10k.zsh
.zshrc Notes:
- Don’t name your custom template
.zshrc.j2
, as it will use the default template.- You can provide your
.zshrc
directly without using Jinja2 templates.
p10k.zsh Notes:
- It’s best to create your own
.p10k.zsh
file usingp10k configure
on a system with oh-my-zsh and powerlevel10k already set up, then copy the file from~/.p10k.zsh
to your project.- Avoid naming your custom file
.p10k.zsh
, as it will also use the default.- Your custom
.p10k.zsh
will be copied as-is, without any changes, and will not support Jinja2 syntax.
License
MIT / BSD
Author Information
This role was created by Tomer Arbel-Eliyahu in 2020.
Set up oh-my-zsh with p10k theme on Linux.
ansible-galaxy install tomereli.oh_my_zsh_p10k