Giter Club home page Giter Club logo

ansible-role-ohmyzsh's Introduction

#######################################################################################################

DEPRECATION

This repository and the role associated are deprecated in favor of the Manala Ansible Collection

You will find informations on its usage on the collection repository

#######################################################################################################

Ansible Role: Oh My Zsh Build Status

Report issues and send Pull Requests in the main Ansible Role repository

This role will deal with the setup of Oh My Zsh.

It's part of the Manala Ansible stack but can be used as a stand alone component.

Requirements

None.

Dependencies

None.

Installation

Ansible 2+

Using ansible galaxy cli:

ansible-galaxy install manala.ohmyzsh

Using ansible galaxy requirements file:

- src: manala.ohmyzsh

Role Handlers

None

Role Variables

Name Default Type Description
manala_ohmyzsh_dir '/usr/local/share/oh-my-zsh' String Oh My Zsh installation directory
manala_ohmyzsh_users_defaults [] Array Users config defaults
manala_ohmyzsh_users [] Array Collection of users with ohMyZsh custom configurations.
manala_ohmyzsh.update false Boolean Whether or not we should auto retrieve new revision of ohMyZsh
manala_ohmyzsh_custom_themes_exclusive false Boolean Exclusion of existing custom themes
manala_ohmyzsh_custom_themes_dir '/etc/supervisor/conf.d' String Custom themes directory path
manala_ohmyzsh_custom_themes_defaults {} Array Custom themes defaults
manala_ohmyzsh_custom_themes [] Array Custom themes

Oh My Zsh configuration

The manala_ohmyzsh_users_defaults key will allow you to define different users configuration default templates.

manala_ohmyzsh_users_defaults:
  template: my/.zshrc.j2

The manala_ohmyzsh_dir key is used to specify the path where to checkout oh-my-zsh

manala_ohmyzsh_dir: /usr/local/share/oh-my-zsh

User configuration

This part allow you, with the key manala_ohmyzsh_users, to configure each user account as following:

Name Default Type Description
user ~ (required) String User account name
home 'root' or '~' ~ item.user String User account home directory
template ~ String Template used for Oh My Zsh configuration
config ~ Array/String List of Oh My Zsh options
state 'present' String State
manala_ohmyzsh_users:
  # Template (recommended)
  - user: root
    template: users/manala/.zshrc.j2
    config:
      ZSH_THEME: default.prod
      plugins: [git, debian, common-aliases, history, history-substring-search]
  # Dict config
  - user: root
    group: foo # Default to user primary group, but can be overriden
    config:
      ZSH_THEME: default.prod
      plugins: [git, debian, common-aliases, history, history-substring-search]
  # Raw config
  - user: root
    config: |
      # Path to your oh-my-zsh installation.
      export ZSH=$HOME/.oh-my-zsh
  # Dict's array parameters (deprecated):
  - user: root
    config:
      - ZSH_THEME: default.prod
      - plugins: (git debian common-aliases history history-substring-search)
  - user: bar
    state: ignore # Entry will be ignored
  # Flatten users
  - "{{ my_custom_users_array }}"

Custom themes

manala_ohmyzsh_custom_themes_exclusive allow you to clean up existing custom themes into directory defined by the manala_ohmyzsh_custom_themes_dir key. Made to be sure no old or manually created files will alter current configuration.

manala_ohmyzsh_custom_themes_exclusive: true
manala_ohmyzsh_custom_themes:
  - file: foo.zsh-theme
    config: |
      PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
  # Template based (file name based on template)
  - template: ohmyzsh/custom/template.zsh-theme.j2
  # Template based (force file name)
  - file: bar.zsh-theme
    template: ohmyzsh/custom/template.zsh-theme.j2
  # Ensure config is absent
  - file: absent.zsh-theme
    state: absent # "present" by default
  # Ignore config
  - file: ignore.zsh-theme
    state: ignore
  # Flatten themes
  - "{{ my_custom_themes_array }}"

Note: to ensure backward compatibility, this role will install these custom themes templates by default:

  • custom/themes/default.dev.j2
  • custom/themes/default.demo.j2
  • custom/themes/default.staging.j2
  • custom/themes/default.prod.j2

Flags

Allow Oh My Zsh to retrieve new revisions from the repository

manala_ohmyzsh:
  update: true

# Can also be set across manala roles
manala:
  update: true

Example playbook

- hosts: servers
  roles:
    - role: manala.ohmyzsh

Licence

MIT

Author information

Manala (http://www.manala.io/)

ansible-role-ohmyzsh's People

Contributors

greedybro avatar nervo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.