# This repository is a clone of https://github.com/ctorgalson/ansible-role-oh-my-zsh/tree/master, edited to make the installation of Zsh, Oh-My-ZSH for root user. # Ansible Role Oh My ZSH - Powerlevel10k This is a basic Ansible role to enable and configure Oh My Zsh on Fedora, Ubuntu or Debian. It should also work on many other \*nix variants. It performs the following tasks: - Install and minimally configure Zsh: - make sure it exists, - set it as the default shell for the user specified by the role. - Install Oh My Zsh for each specified user (in `~/.oh-my-zsh` by default). - Configure (Oh My) Zsh by optionally creating a `.zshrc` file for each specified user. - Alternately, configure Zsh by adding a block of lines to individual users' `.zshrc` files. - Installs and configure PowerLevel10k theme ## Role variables - ZSH - Oh My ZSH | Variable name | Default value | Description | |----------------|---------------|-------------| | `omz_install_zsh` | `false` | Defines whether or not the role should attempt to install Zsh. | | `omz_user` | `[]` | The user to install/configure (Oh My) Zsh for. See below for its properties. | | `omz_user.name` | `-` | The name of the user. | | `omz_user.group` | `-` | The group of the user | | `omz_user.settings` | `-` | Extra settings (as a mult-line string) such as variable exports or aliases to add to the user's `.zshrc` file. Only used if `omz_zshrc_create` is `true`. | | `omz_git_repository` | `https://github.com/robbyrussell/oh-my-zsh.git` | The git repo to clone Oh My Zsh from. | | `omz_install_directory` | `.oh-my-zsh` | The name of the directory to clone Oh My Zsh into. | | `omz_zshrc_create` | `true` | Whether or not to create `.zshrc`. If `true`, will create `.zshrc` from a template. | | `omz_zshrc_template` | `templates/zshrc.zsh-template.j2` | The template used to create the user's `.zshrc` file when `omz_zshrc_create` is `true`. | | `omz_zshrc_backup` | `true` | Whether or not to create backup the existing `.zshrc` files when the role changes it. | | `omz_zsh_theme` | `robbyrussell` | See `templates/zshrc.zsh-template`. | | `omz_case_sensitive` | `false` | See `templates/zshrc.zsh-template`. | | `omz_hyphen_insensitive` | `false` | See `templates/zshrc.zsh-template`. | | `omz_disable_auto_update` | `false` | See `templates/zshrc.zsh-template`. | | `omz_update_zsh_days` | `13` | See `templates/zshrc.zsh-template`. | | `omz_disable_ls_colors` | `false` | See `templates/zshrc.zsh-template`. | | `omz_disable_auto_title` | `false` | See `templates/zshrc.zsh-template`. | | `omz_enable_correction` | `false` | See `templates/zshrc.zsh-template`. | | `omz_completion_waiting_dots` | `false` | See `templates/zshrc.zsh-template`. | | `omz_disable_untracked_files_dirty` | `false` | See `templates/zshrc.zsh-template`. | | `omz_hist_stamps` | `mm/dd/yyyy` | See `templates/zshrc.zsh-template`. | | `omz_zsh_custom` | `$ZSH/custom` | See `templates/zshrc.zsh-template`. | | `omz_plugins` | `[]` | A list of Oh My Zsh plugins to enable. | ## Role variables - ZSH - Oh My ZSH Available variables are listed below, along with default values (see `defaults/main.yml`): ```yaml --- # defaults file for ansible-role-p10k # Powerlevel10k Git repository url p10k_repository_url: 'https://github.com/romkatv/powerlevel10k.git' # Install p10k for the following linux users # Default: the linux user running Ansible p10k_users: - "{{ ansible_user_id }}" # Zsh plugin used, zsh, ohmyzsh, prezto, Zim, etc.. # All plugin names can be found here https://github.com/romkatv/powerlevel10k#installation zsh_plugin: zsh # Setup p10k theme to use # Valid values: lean, classic, rainbow, pure p10k_prompt_style: "classic" # Show current time # Valid values: no, 24-hour, 12-hour p10k_prompt_time: "24-hour" # Prompt sperator # Valid values: angled, vertical, slanted, round p10k_prompt_separator: "angled" # Prompt heads # Valid values: sharp, blurred, slanted, round p10k_prompt_head: "sharp" # Prompt tails # Valid values: flat, blurred, sharp, slanted, round p10k_prompt_tails: flat # Terminal prompt height # Valid values: one-line, two-lines p10k_prompt_height: two-lines # Prompt connection, only used if "p10k_prompt_height" value is "two-lines" # Valid values: disconnected, dotted, solid p10k_prompt_connection: disconnected # Prompt connection color, only used if # "p10k_prompt_connection" value is "dotted" or "solid" # or "p10k_prompt_frame" is not "no" # Valid values: lightest, light, dark, darkest, black, white, green, blue p10k_prompt_connection_color: "dark" # Prompt frame connection # Valid values: no, left, right, full p10k_prompt_frame: left # Sparse prompt with an empty line before promp # Valid values: compact, sparse p10k_prompt_spacing: compact # Terminal flow # Valid values: concise, fluent p10k_prompt_flow: concise # Enable transient prompt # Valid values: yes, no p10k_transient_prompt: "no" ``` ### Sources: - https://github.com/diodonfrost/ansible-role-p10k/tree/master - https://github.com/ctorgalson/ansible-role-oh-my-zsh/tree/master