From 1c777421a16a8b315b07a5c5db61212a11020229 Mon Sep 17 00:00:00 2001 From: Leo Maroni Date: Thu, 2 Apr 2020 01:48:52 +0200 Subject: [PATCH] Fixed and make better --- tasks/main.yml | 4 ++-- templates/zshrc.j2 | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 0e615fc..7e77b6e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,4 @@ -- name: install dependencies +- name: install oh-my-zsh dependencies become: yes package: name: @@ -9,7 +9,7 @@ - name: clone oh-my-zsh for users git: repo: 'https://github.com/robbyrussell/oh-my-zsh.git' - dest: '~{{ user.username }}/.oh-my.zsh' + dest: '~{{ user.username }}/.oh-my-zsh' clone: yes depth: 1 become: yes diff --git a/templates/zshrc.j2 b/templates/zshrc.j2 index 179eb3d..a6d054d 100644 --- a/templates/zshrc.j2 +++ b/templates/zshrc.j2 @@ -1,5 +1,7 @@ {{ ansible_managed | comment }} +{% set oh_my_zsh = user.oh_my_zsh|default({}) %} + # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH @@ -10,7 +12,7 @@ export ZSH=$HOME/.oh-my-zsh # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -ZSH_THEME="{{ user.oh_my_zsh.theme }}" +ZSH_THEME="{{ oh_my_zsh.theme | default(oh_my_zsh_theme) }}" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load @@ -70,7 +72,7 @@ DISABLE_AUTO_UPDATE="true" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=({{ user.oh_my_zsh.plugins | default('') | join(' ') }}) +plugins=({{ oh_my_zsh.plugins | default(oh_my_zsh_plugins) | join(' ') }}) source $ZSH/oh-my-zsh.sh @@ -98,4 +100,4 @@ source $ZSH/oh-my-zsh.sh # # Example aliases # alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" +# alias ohmyzsh="mate ~/.oh-my-zsh" \ No newline at end of file