-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu.yml
197 lines (191 loc) · 5.07 KB
/
ubuntu.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
- hosts: all
vars:
apt_keys:
- https://syncthing.net/release-key.txt
- https://download.docker.com/linux/ubuntu/gpg
apt_repos:
- ppa:ansible/ansible
- ppa:fish-shell/release-2
- ppa:tmate.io/archive
- "deb https://apt.syncthing.net/ syncthing stable"
- "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
fish_config_lines:
- "set PATH $HOME/.rbenv/bin $PATH"
- "set PATH $HOME/.rbenv/shims $PATH"
- "rbenv rehash >/dev/null ^&1"
default_gems: # gems installed with each new version of ruby
- bundler
- pry
fish_plugins: # find new fish plugins at http://fisherman.github.io/
- await
- fnm
- get_file_age
- git_util
- last_job_id
- menu
- rbenv
- vibrant
node_versions: # adapt to your needs
- lts
- latest
#- 4.8.1
packages: # adapt to your needs
- ack-grep
- ansible
- apt-transport-https
- autoconf
- bison
- build-essential
- ca-certificates
- chromium-browser
- cowsay
- curl
- docker-ce
- exfat-fuse
- figlet
- firefox
- fish
- gimp
- git
- golang
- gparted
- htop
- i3
- inkscape
- libffi-dev
- libgdbm3
- libgdbm-dev
- libncurses5-dev
- libreadline6-dev
- libsqlite3-dev
- libssl-dev
- libyaml-dev
- network-manager-openvpn-gnome
- pcmanfm
- postgresql
- redshift
- sakura
- software-properties-common
- sqlite3
- syncthing
- tmate
- tmux
- transmission-gtk
- tree
- viewnior
- vim
- vlc
- wget
- zlib1g-dev
rbenv_plugins: # find new rbenv plugins at https://github.com/rbenv/rbenv/wiki/Plugins
ruby-build:
repo: https://github.com/rbenv/ruby-build.git
rbenv-default-gems:
repo: https://github.com/rbenv/rbenv-default-gems.git
ruby_versions: # adapt to your needs
- 2.1.5
- 2.4.1
tasks:
# APT packages
- name: Add extra apt keys
become: yes
apt_key:
url: "{{ item }}"
state: present
with_items: "{{ apt_keys }}"
- name: Add extra apt repos
become: yes
apt_repository:
repo: "{{ item }}"
state: present
with_items: "{{ apt_repos }}"
- name: Update apt cache
become: yes
apt: update_cache=yes
- name: Update all packages to the latest version
apt: upgrade=dist
become: yes
- name: Install libraries with apt
apt: name={{ item }} state=latest
become: yes
with_items: "{{ packages }}"
# Fish shell plugins
- name: Install fisherman (fish plugins manager)
get_url:
url: https://git.io/fisher
dest: ~/.config/fish/functions/fisher.fish
- name: Install fish plugins
shell: "fisher install {{item}}"
args:
chdir: ~/
executable: /usr/bin/fish
with_items: "{{ fish_plugins }}"
- name: Update fish plugins
shell: fisher update
args:
chdir: ~/
executable: /usr/bin/fish
# Install nodes
- name: List available node versions
shell: fnm ls
args:
executable: /usr/bin/fish
register: available_nodes
- name: Install node versions
shell: "fnm use {{ item }}"
args:
executable: /usr/bin/fish
with_items: "{{ node_versions }}"
# Install rubies
- name: Clone rbenv from git
git:
repo: https://github.com/rbenv/rbenv.git
dest: ~/.rbenv
- name: Install rbenv plugins from git
git:
repo: "{{ item.value.repo }}"
dest: "~/.rbenv/plugins/{{ item.key }}"
with_dict: "{{ rbenv_plugins }}"
- name: Compile bash extensions for rbenv
shell: "src/configure && make -C src"
args:
chdir: ~/.rbenv
- name: Add rbenv in path for fish
# source: https://github.com/rbenv/rbenv/issues/195#issuecomment-6168636
lineinfile:
dest: ~/.config/fish/config.fish
line: "{{ item }}"
with_items: "{{ fish_config_lines }}"
- name: Set default gems
lineinfile:
dest: ~/.rbenv/default-gems
line: "{{ item }}"
create: yes
with_items: "{{ default_gems }}"
- name: List ruby versions
shell: rbenv versions
args:
executable: /usr/bin/fish
register: installed_rubies
- name: Install missing ruby versions
shell: "rbenv install {{ item }}"
args:
executable: /usr/bin/fish
with_items: "{{ ruby_versions }}"
when: installed_rubies.stdout.find(item) == -1
# Install hub
- name: Check if hub is installed
shell: hub version
ignore_errors: True
register: hub_execution
- block:
- name: Clone hub repo
git:
repo: https://github.com/github/hub.git
dest: /tmp/hub
- name: Compile and install hub
shell: "script/build -o ~/bin/hub"
args:
chdir: /tmp/hub
when: hub_execution|failed