forked from craigfurman/linux-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
130 lines (111 loc) · 3.66 KB
/
playbook.yml
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
---
- hosts: all
vars:
downloads_dir: /tmp/downloads
tasks:
- name: add apt repositories
become: yes
become_method: sudo
apt_repository: repo={{ item }}
with_items:
- ppa:git-core/ppa
- ppa:neovim-ppa/unstable
- deb [trusted=yes] https://repo.iovisor.org/apt/xenial xenial-nightly main
- name: install apt packages
become: yes
become_method: sudo
apt: name={{ item }} state=latest update_cache=yes
with_items:
- automake
- autotools-dev
- build-essential
- curl
- debootstrap
- direnv
- exuberant-ctags
- git
- htop
- libcap-dev
- libncurses5-dev
- libseccomp-dev
- libtool
- neovim
- pkg-config
- python-dev
- python-pip
- python3-dev
- python3-pip
- shellcheck
- silversearcher-ag
- tree
- util-linux
- valgrind
- vim-nox
- wget
- zsh
# For tmux
- libevent-dev
- bcc-tools
- libbcc-examples
- name: install neovim pip package
pip: name=neovim executable=/usr/bin/pip
- name: install neovim pip3 package
pip: name=neovim executable=/usr/bin/pip3
- name: clone oh my zsh
git: repo=https://github.com/robbyrussell/oh-my-zsh.git dest=~/.oh-my-zsh
- name: set zsh as default shell
become: yes
become_method: sudo
user: name={{ansible_env.USER}} shell=/bin/zsh
- name: ensure downloads directory exists
file: path={{downloads_dir}} state=directory
- name: download tmux
get_url: url=https://github.com/tmux/tmux/releases/download/2.5/tmux-2.5.tar.gz dest={{downloads_dir}}/tmux-2.5.tar.gz
- name: extract tmux
unarchive: copy=no src={{downloads_dir}}/tmux-2.5.tar.gz dest={{downloads_dir}} creates={{downloads_dir}}/tmux-2.5
- name: check tmux installed
command: tmux -V
register: tmux_version
failed_when: tmux_version.rc != 0 and tmux_version.rc != 127
- name: configure tmux
command: ./configure chdir={{downloads_dir}}/tmux-2.5
when: tmux_version.stdout != "tmux 2.5"
- name: compile tmux
make: chdir={{downloads_dir}}/tmux-2.5
when: tmux_version.stdout != "tmux 2.5"
- name: install tmux
become: yes
become_method: sudo
make: target=install chdir={{downloads_dir}}/tmux-2.5
when: tmux_version.stdout != "tmux 2.5"
- name: copy config files
copy: src={{item.src}} dest={{item.dst}} mode=0664 force=yes
with_items:
- {src: config/tmux.conf, dst: ~/.tmux.conf}
- {src: config/zshrc, dst: ~/.zshrc}
- {src: config/gitconfig, dst: ~/.gitconfig}
- {src: config/vimrc.local.plugins, dst: ~/.vimrc.local.plugins}
- name: get TPM
git:
repo: https://github.com/tmux-plugins/tpm
dest: ~/.tmux/plugins/tpm
- name: download go
get_url: url=https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz dest={{downloads_dir}}/go.tar.gz
- name: extract go
become: yes
become_method: sudo
unarchive: copy=no src={{downloads_dir}}/go.tar.gz dest=/usr/local creates=/usr/local/go
- name: clone vim config
git: repo=https://github.com/luan/vimfiles dest=~/.vim
- name: check kernel version
command: uname -r
register: kernel_version
- name: fancy new kernel
become: yes
become_method: sudo
apt: deb={{item}}
with_items:
- http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-headers-4.12.0-041200_4.12.0-041200.201707022031_all.deb
- http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-headers-4.12.0-041200-generic_4.12.0-041200.201707022031_amd64.deb
- http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12/linux-image-4.12.0-041200-generic_4.12.0-041200.201707022031_amd64.deb
when: kernel_version.stdout != "4.12.0-041200-generic"