-
Notifications
You must be signed in to change notification settings - Fork 0
/
localhost.yml
248 lines (229 loc) · 7.1 KB
/
localhost.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
---
- hosts: localhost
vars:
rbenv:
env: user
version: v1.1.1
default_ruby: 2.5.1
rubies:
- version: 2.5.1
handlers:
- name: ibus restart
command: ibus restart
# Install Ruby environment
roles:
- role: zzet.rbenv
rbenv_users:
- paul
tasks:
- command: lsb_release -cs
register: distribution_release
check_mode: no
- set_fact:
ansible_distribution_release: "{{ distribution_release.stdout }}"
# apt install common packages
- name: Install common packages
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 86400
with_items: [sudo, rsync, curl, byobu, emacs, git, apt-transport-https, ca-certificates, bash-completion, python-pip, pass, htop, peek, sqlite3, ibus, im-config, pulseaudio, pulseaudio-module-bluetooth, pavucontrol, bluez, bluez-firmware, gnupg2, gnupg-agent, pinentry-curses, scdaemon, pcscd, yubikey-personalization, libusb-1.0-0-dev, haskell-stack, jq]
- name: Install cheat python package
pip:
name: cheat
# Install ibus-emoji (Emoji keyboard)
- name: Fetch repostiory for ibus-uniemoji
git:
repo: "https://github.com/salty-horse/ibus-uniemoji.git"
dest: ~/devel/ibus-uniemoji/
become: true
become_user: paul
- name: Check existing ibus-uniemoji installation
stat:
path: /home/paul/devel/ibus-uniemoji/uniemoji.xml
register: ibus_uniemoji
- name: Install ibus-uniemoji
make:
chdir: /home/paul/devel/ibus-uniemoji
target: install
when: not ibus_uniemoji.stat.exists
notify: ibus restart
# Install stable version of Firefox
- name: Check existing firefox
stat:
path: /opt/firefox/firefox
register: firefox
- name: Install stable Firefox instead of firefox-esr
unarchive:
src: https://download-installer.cdn.mozilla.net/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2
dest: /opt/
remote_src: yes
when: not firefox.stat.exists
- name: Create firefox desktop link
copy:
src: firefox.desktop
dest: /usr/share/applications/firefox-stable.desktop
- name: Uninstall firefox-esr
apt:
name: firefox-esr
state: absent
# Install Docker
- name: Receive Docker gpg ke
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker repository
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
state: present
- name: Install docker
apt:
name: docker-ce
state: present
update_cache: yes
cache_valid_time: 86400
# Install kubectl
- name: Receive google cloud gpg key
apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
state: present
- name: Add Kubernetes repository
apt_repository:
repo: "deb http://apt.kubernetes.io/ kubernetes-stretch main"
state: present
- name: Install kubectl
apt:
name: kubectl
state: present
update_cache: yes
cache_valid_time: 86400
# Install nextcloud desktop client
- name: Receive nextcloud-devs gpg key
apt_key:
id: 1FCD77DD0DBEF5699AD2610160EE47FBAD3DD469
keyserver: keyserver.ubuntu.com
state: present
- name: Add PPA nextcloud-devs
apt_repository:
repo: "deb http://ppa.launchpad.net/nextcloud-devs/client/ubuntu bionic main"
state: present
- name: Install nextcloud-client
apt:
name: nextcloud-client
state: present
update_cache: yes
cache_valid_time: 86400
# Install Weechat
- name: Receive WeeChat gpg key
apt_key:
id: 11E9DE8848F2B65222AA75B8D1820DB22A11534E
keyserver: p80.pool.sks-keyservers.net
- name: Add WeeChat repository
apt_repository:
repo: "deb https://weechat.org/debian {{ ansible_distribution_release }} main"
state: present
- name: Install weechat
apt:
name: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 86400
with_items: [weechat-curses, weechat-plugins, weechat-python, weechat-perl]
- name: Install weeslack dependencies
pip:
name: websocket-client
# Install custom Emacs configuration
- name: Check existing emacs config
stat:
path: ~/.emacs.d
become: true
become_user: paul
register: sym
- name: Move emacs config if not a link
copy:
src: ~/.emacs.d
dest: ~/.emacs.d.bak
become: true
become_user: paul
when: sym.stat.islnk is defined and not sym.stat.islnk
- name: Remove emacs config if not a link
file:
state: absent
path: ~/.emacs.d
become: true
become_user: paul
when: sym.stat.islnk is defined and not sym.stat.islnk
- name: Install Paul s emacs config
git:
repo: 'https://github.com/paulrbr/emacs.d'
dest: ~/.emacs.d.git
become: true
become_user: paul
- name: Link emacs config
file:
state: link
src: ~/.emacs.d.git
dest: ~/.emacs.d
become: true
become_user: paul
# Install custom bash profile
- name: Check existing profile
stat:
path: ~/.profile
become: true
become_user: paul
register: sym
- name: Install profile
command: "curl -s https://raw.githubusercontent.com/paulRbr/profile/master/install | bash"
become: true
become_user: paul
when: sym.stat.islnk is defined and not sym.stat.islnk
# Install "$HOME" opt dir
- name: Check existing /opt directory
stat:
path: /opt
register: sym
- name: Move /opt if not a link
copy:
src: /opt
dest: /opt.bak
when: sym.stat.islnk is defined and not sym.stat.islnk
- name: Remove /opt if not a link
file:
state: absent
path: /opt
when: sym.stat.islnk is defined and not sym.stat.islnk
- name: Link ~/opt
file:
state: link
src: /home/paul/opt
dest: /opt
# Setup ruby env (install common ruby gems)
- name: Install ruby gems
gem:
name: "{{ item }}"
state: present
with_items: [bundler, rotp]
become: true
become_user: paul
# Upgrade Haskell Stack tool
- name: Upgrade Stack (Haskell)
command: stack upgrade --binary-only
- name: Install hindent for Haskell formatting
command: "stack install {{ item }}"
with_items: [hindent, stylish-haskell]
become: true
become_user: paul
# Install NVM
- name: Get NVM installation script
get_url:
url: https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh
dest: /tmp/nvm_install.sh
register: nvm_script
- name: Install NVM
command: sh /tmp/nvm_install.sh
become: true
become_user: paul
- name: Install node
command: nvm install 8.9.3