-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathone_installer.yml
244 lines (211 loc) · 7.47 KB
/
one_installer.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
- name: Onboarding Tasks
hosts: localhost
become: yes
gather_facts: no
vars:
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: Update package repository
shell: sudo apt update
ignore_errors: yes
- name: Install necessary tools
shell: sudo apt-get install -y "{{ item }}"
with_items:
- gpg
- wget
- software-properties-common
- name: Get the current username
shell: echo $SUDO_USER || echo $USER
register: current_user
changed_when: false
- name: Install required dependencies
become: yes
apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg
- lsb-release
state: present
update_cache: yes
ignore_errors: yes
- name: Update the apt package index
become: yes
apt:
update_cache: yes
ignore_errors: yes
- name: Install Podman and podman-docker
become: yes
become_user: "{{ current_user.stdout }}"
shell: |
sudo apt-get update
sudo apt-get install -y podman
sudo apt-get install -y podman-docker
args:
executable: /bin/bash
register: podman_status
- name: Install Git
package:
name: git
state: present
- name: Install pyenv
become: yes
become_user: "{{ current_user.stdout }}"
shell: |
curl https://pyenv.run | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
source ~/.bashrc
args:
executable: /bin/bash
register: pyenv_status
- name: Display pyenv installation status
debug:
msg: "pyenv installation status: {{ pyenv_status.stdout }}"
- name: Install Homebrew
become: no
shell: |
if ! command -v brew &> /dev/null; then
echo "Homebrew not found. Installing Homebrew."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
. ~/.bashrc
else
echo "Homebrew is already installed."
fi
args:
executable: /bin/bash
ignore_errors: yes
- name: Install rupa/z and mcfly
become: yes
become_user: "{{ current_user.stdout }}"
shell: |
# Install rupa/z
curl -fsSL https://raw.githubusercontent.com/rupa/z/master/z.sh -o ~/.z.sh
echo 'source ~/.z.sh' >> ~/.bashrc
# Install mcfly
curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sudo sh -s -- --git cantino/mcfly
echo 'eval "$(mcfly init bash)"' >> ~/.bashrc
# Apply changes
. ~/.bashrc
args:
executable: /bin/bash
- name: Install GVM dependencies
shell: sudo apt-get install -y "{{ item }}"
with_items:
- curl
- git
- mercurial
- make
- binutils
- bison
- gcc
- build-essential
- bsdmainutils
ignore_errors: yes
- name: Download and install tools via shell scripts
shell: "{{ item.pkg }}"
loop:
- { name: "lama2", pkg: "curl -sSL https://hexmos.com/lama2/install.sh | bash -s" }
- { name: "python poetry", pkg: "curl -sSL https://install.python-poetry.org | python3 -" }
- { name: "nvm", pkg: "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -s" }
- { name: "zotero", pkg: "curl -sSL https://raw.githubusercontent.com/retorquere/zotero-deb/master/install.sh | sudo bash" }
- { name: "vscode", pkg: "curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg" }
- { name: "google chrome", pkg: "curl -sSL https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -" }
ignore_errors : yes
- name: Configure apt repositories
shell: sudo add-apt-repository -y "{{ item }}"
with_items:
- ppa:deadsnakes/ppa
- ppa:phoerious/keepassxc
ignore_errors: yes
- name: Add environment variable paths
lineinfile:
dest: ~/.bashrc
line: '{{ item }}'
with_items:
- export PATH="$HOME/.poetry/bin:$PATH"
- export PATH="$HOME/.local/bin:$PATH"
- name: Setup VS Code
shell: |
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
- name: Setup Google Chrome
shell: sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
- name: Update package repository
shell: sudo apt update
ignore_errors: yes
- name: Install Packages
become: yes
apt:
name: "{{ item }}"
state: present
loop:
- python3-apt
- python3.10
- python3-pip
- git
- keepassxc
- zotero
- ripgrep
- apt-transport-https
- code
- google-chrome-stable
ignore_errors : yes
- name: Install NVM (Node Version Manager)
become: yes
become_user: "{{ current_user.stdout }}"
shell: |
source ~/.bashrc
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> ~/.bashrc
source ~/.bashrc
args:
executable: /bin/bash
register: nvm_status
- name: Display NVM installation status
debug:
msg: "NVM installation status: {{ nvm_status.stdout }}"
- name: Install Python packages
shell: pip3 install "{{ item }}"
with_items:
- black
- mypy
ignore_errors : yes
- name: Install VSCode extensions
become_user: "{{ current_user.stdout }}"
shell: code --install-extension "{{ item }}"
with_items:
- ms-python.python
- formulahendry.auto-rename-tag
- ritwickdey.LiveServer
- kisstkondoros.vscode-gutter-preview
- VisbyDev.folder-path-color
- usernamehw.errorlens
- esbenp.prettier-vscode
- hexmos.Lama2
- golang.Go
- ryanluker.vscode-coverage-gutters
ignore_errors : yes
- name: Install GVM (Go Version Manager)
become: yes
become_user: "{{ current_user.stdout }}"
shell: |
source ~/.bashrc
curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer | bash
echo 'source ~/.gvm/scripts/gvm' >> ~/.bashrc
source ~/.bashrc
args:
executable: /bin/bash
register: gvm_status
- name: Display GVM installation status
debug:
msg: "GVM installation status: {{ gvm_status.stdout }}"