-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yaml
140 lines (119 loc) · 3.61 KB
/
playbook.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
- hosts: localhost:vagrant
connection: local
vars_files:
- variables.yaml
tasks:
- name: Install dependencies
become: "{{ ansible_distribution != 'MacOSX' }}"
package:
name: "{{ mac_dependencies if ansible_distribution == 'MacOSX' else linux_dependencies }}"
state: present
- name: Install ropevim python package
pip:
name: ropevim
extra_args: --user
- name: Clone oh-my-zsh
command: 'git clone -c core.autocrlf=input --depth=1 https://github.com/robbyrussell/oh-my-zsh.git .oh-my-zsh'
args:
chdir: '$HOME'
creates: '$HOME/.oh-my-zsh'
- name: Set oh-my-zsh perms
file:
path: '$HOME/.oh-my-zsh'
mode: 'go-w'
recurse: yes
- name: Set zsh as default shell
become: "{{ ansible_distribution != 'MacOSX' }}"
user:
name: "{{ lookup('env', 'USER') }}"
shell: /bin/zsh
- name: Install vim and zsh packages
git:
repo: "{{ item.repo }}"
dest: "{{ item.dest }}"
clone: yes
update: yes
force: yes
version: '{{ item.version | default("master") }}'
recursive: '{{ item.recursive | default("no") }}'
track_submodules: '{{ item.track_submodules | default("no") }}'
loop: "{{ packages }}"
- name: Write .zshrc
vars:
theme: agnoster_latest
plugins:
- git
- git-flow
- fzf
- brew
- history
- kubectl
- history-substring-search
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-kubectl-prompt
template:
src: zshrc.j2
dest: '~/.zshrc'
mode: 'u=rw,go=r'
backup: yes
# The agnoster theme that comes with oh-my-zsh is a bit outdated
# and the AGNOSTER_PROMPT_SEGMENTS does not work there
- name: Install latest zsh agnoster theme
get_url:
url: https://raw.githubusercontent.com/agnoster/agnoster-zsh-theme/master/agnoster.zsh-theme
dest: ~/.oh-my-zsh/themes/agnoster_latest.zsh-theme
- name: helptags
shell:
cmd: "{{ item.vim_helptags }}"
when: '"vim_helptags" in item'
loop: "{{ packages }}"
- name: install FZF
shell:
cmd: ~/.fzf/install
- name: write .vimrc
template:
src: vimrc.j2
dest: '~/.vimrc'
mode: 'u=rw,go=r'
backup: yes
- name: Ensures ~/.vim/autoload exists
file: path=~/.vim/autoload state=directory
- name: Install vim-plug
get_url:
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: ~/.vim/autoload/
- name: Install plugins
shell: vim +PlugInstall +qall
- name: Ensures .tmux.d exists
file: path=~/.tmux.d state=directory
- name: Ensures .tmux.d/themes exists
file: path=~/.tmux.d/themes state=directory
- name: Install tmux powerline
git:
repo: https://github.com/erikw/tmux-powerline.git
dest: '~/.tmux.d/tmux-powerline'
clone: yes
update: yes
force: yes
- name: Write .tmux.conf
vars:
history_limit: 30000
template:
src: tmux.j2
dest: '~/.tmux.conf'
mode: 'u=rw,go=r'
backup: yes
- name: Write tmux powerline theme
template:
src: tmux_powerline_theme.j2
dest: '~/.tmux.d/themes/powerlinetheme.sh'
mode: 'u=rw,go=r'
backup: yes
- name: Write tmux powerlinerc
template:
src: tmux_powerlinerc.j2
dest: '~/.tmux-powerlinerc'
mode: 'u=rw,go=r'
backup: yes