Skip to content

Commit a8ac30b

Browse files
committed
Module for installing zsh through ansible
0 parents  commit a8ac30b

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

defaults/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
zsh_theme: alanpeabody
2+
zsh_plugins: [ 'git', 'laravel' ]

tasks/main.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
3+
- name: Install zsh
4+
yum: name=zsh state=latest
5+
6+
- name: Install git
7+
yum: name=git state=latest
8+
9+
- name: Clone oh-my-zsh repo
10+
git: repo=https://github.com/robbyrussell/oh-my-zsh.git dest=~/.oh-my-zsh
11+
12+
- name: Remove standart config
13+
file: path=~/.zshrc state=absent
14+
15+
- name: Create config folder in home directory
16+
file: path=~/conf state=directory owner={{ ansible_user_id }}
17+
18+
- name: Deploy config file
19+
template: src=templates/zshrc.j2 dest=~/conf/zshrc owner={{ ansible_user_id }}
20+
21+
- name: Create symlinc to zshrc
22+
file: path=~/.zshrc src=~/conf/zshrc state=link owner={{ ansible_user_id }}
23+
24+
- name: Set zsh as default shell
25+
user: name={{ ansible_user_id }} shell=/bin/zsh

templates/zshrc.j2

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# {{ ansible_managed }}
2+
# DO NOT EDIT THIS FILE
3+
4+
# Path to your oh-my-zsh installation.
5+
export ZSH=~/.oh-my-zsh
6+
7+
# Set name of the theme to load.
8+
# Look in ~/.oh-my-zsh/themes/
9+
# Optionally, if you set this to "random", it'll load a random theme each
10+
# time that oh-my-zsh is loaded.
11+
ZSH_THEME="{{ zsh_theme }}"
12+
13+
# Uncomment the following line to use case-sensitive completion.
14+
# CASE_SENSITIVE="true"
15+
16+
# Uncomment the following line to disable bi-weekly auto-update checks.
17+
DISABLE_AUTO_UPDATE="true"
18+
19+
# Uncomment the following line to change how often to auto-update (in days).
20+
# export UPDATE_ZSH_DAYS=13
21+
22+
# Uncomment the following line to disable colors in ls.
23+
# DISABLE_LS_COLORS="true"
24+
25+
# Uncomment the following line to disable auto-setting terminal title.
26+
# DISABLE_AUTO_TITLE="true"
27+
28+
# Uncomment the following line to enable command auto-correction.
29+
# ENABLE_CORRECTION="true"
30+
31+
# Uncomment the following line to display red dots whilst waiting for completion.
32+
# COMPLETION_WAITING_DOTS="true"
33+
34+
# Uncomment the following line if you want to disable marking untracked files
35+
# under VCS as dirty. This makes repository status check for large repositories
36+
# much, much faster.
37+
# DISABLE_UNTRACKED_FILES_DIRTY="true"
38+
39+
# Uncomment the following line if you want to change the command execution time
40+
# stamp shown in the history command output.
41+
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
42+
# HIST_STAMPS="mm/dd/yyyy"
43+
44+
# Would you like to use another custom folder than $ZSH/custom?
45+
# ZSH_CUSTOM=/path/to/new-custom-folder
46+
47+
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
48+
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
49+
# Example format: plugins=(rails git textmate ruby lighthouse)
50+
# Add wisely, as too many plugins slow down shell startup.
51+
plugins=({{ zsh_plugins | join(" ") }})
52+
53+
# User configuration
54+
55+
# export PATH=$HOME/bin:/usr/local/bin:$PATH
56+
# export MANPATH="/usr/local/man:$MANPATH"
57+
58+
# You may need to manually set your language environment
59+
# export LANG=en_US.UTF-8
60+
61+
# Preferred editor for local and remote sessions
62+
# if [[ -n $SSH_CONNECTION ]]; then
63+
# export EDITOR='vim'
64+
# else
65+
# export EDITOR='mvim'
66+
# fi
67+
68+
# Compilation flags
69+
# export ARCHFLAGS="-arch x86_64"
70+
71+
# ssh
72+
# export SSH_KEY_PATH="~/.ssh/dsa_id"
73+
74+
# Set personal aliases, overriding those provided by oh-my-zsh libs,
75+
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
76+
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
77+
# For a full list of active aliases, run `alias`.
78+
#
79+
# Example aliases
80+
# alias zshconfig="mate ~/.zshrc"
81+
# alias ohmyzsh="mate ~/.oh-my-zsh"
82+
83+
source $ZSH/oh-my-zsh.sh

0 commit comments

Comments
 (0)