-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal-playbook.yaml
More file actions
205 lines (166 loc) · 6.12 KB
/
local-playbook.yaml
File metadata and controls
205 lines (166 loc) · 6.12 KB
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
---
- name: Set up new machine
hosts: localhost
become: yes # escalate priviledge
vars:
go_version: "1.22.1"
ansible_user: protopapa
zsh_dependencies: []
tasks:
- name: update and upgrade apt packages
ansible.builtin.apt:
upgrade: yes
update-cache: yes
- name: apt update
become: yes
ansible.builtin.apt:
update_cache: yes
# - name: Add guake terminal repo
# ansible.builtin.apt_repository:
# repo: ppa:linuxuprising/guake
# - name: apt update
#become: yes
# ansible.builtin.apt:
# update_cache: yes
- name: Install packages basic packages
ansible.builtin.apt:
pkg:
- guake
- zsh
- zplug
- curl
- unzip
- vim
- git
- npm
- scdaemon
- ca-certificates
- gnupg
- snapd
- name: Create Repositories folder
ansible.builtin.file:
path: /home/{{ ansible_user }}/Repositories
state: directory
mode: '0755'
###### Update npm and install node
- name: Update npm
ansible.builtin.shell: npm install -g npm
- name: Install nodejs from nodesource
become: true
ansible.builtin.shell: curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
- name: Install nodejs
ansible.builtin.apt:
pkg: nodejs
#### zsh setup
- name: Ensure Zsh with dependencies are installed
ansible.builtin.apt:
name: "{{ ['zsh'] + zsh_dependencies }}"
state: present
update_cache: yes
become: true
- name: Ensure zsh is the default shell
ansible.builtin.user:
name: "{{ ansible_user }}"
shell: "/usr/bin/zsh"
become: true
- name: Download Oh My Zsh script
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
dest: /tmp/install_ohmyzsh.sh
- name: Run Oh My Zsh script
ansible.builtin.command: sh /tmp/install_ohmyzsh.sh --unattended
register: ohmyzsh_result
failed_when: "'FAILED' in ohmyzsh_result.stderr"
#### Install Golang
- name: download go tar
ansible.builtin.get_url:
url: "https://go.dev/dl/go{{ go_version }}.linux-amd64.tar.gz"
dest: "/tmp/go{{ go_version }}.linux-amd64.tar.gz"
- name: remove any existing go path
ansible.builtin.file:
path: /usr/local/go
state: absent
- name: untar go
ansible.builtin.unarchive:
src: /tmp/go{{ go_version }}.linux-amd64.tar.gz
dest: /usr/local
- name: add go bin path to path
ansible.builtin.shell: export PATH=$PATH:/usr/local/go/bin
- name: add go path to dot profile
ansible.builtin.lineinfile:
line: export PATH=$PATH:/usr/local/go/bin
path: /home/{{ ansible_user }}/.zshrc
- name: source .zshrc
ansible.builtin.shell: ". /home/{{ ansible_user }}/.zshrc"
#### Install Dropbox
- name: Install Dropbox from deb
ansible.builtin.apt:
deb: "https://www.dropbox.com/download?dl=packages/debian/dropbox_2024.01.22_amd64.deb"
#### Install Slack Desktop
- name: Install Slack Desktop from deb
ansible.builtin.apt:
deb: "https://downloads.slack-edge.com/desktop-releases/linux/x64/4.41.105/slack-desktop-4.41.105-amd64.deb"
#### Install Joplin
- name: download joplin script
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh"
dest: "/tmp/Joplin_install_and_update.sh"
- name: run Joplin install script
ansible.builtin.shell: Joplin_install_and_update.sh
args:
chdir: /tmp/
#### Install Docker Engine
- name: Install Docker
become: yes
ansible.builtin.shell:
cmd: |
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
- name: Add the repository to Apt sources
block:
- name: Add repos
ansible.builtin.shell:
cmd: |
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- name: Update apt
ansible.builtin.apt:
upgrade: yes
update_cache: yes
- name: Install Docker packages
become: yes
ansible.builtin.apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: latest
update_cache: yes
- name: Ensure Docker group exists
become: yes
ansible.builtin.group:
name: docker
state: present
- name: Add User to docker group
become: yes
ansible.builtin.user:
name: "{{ ansible_user }}"
groups: docker
append: true
### Snap Installations
- name: Install packages with snap
community.general.snap:
name:
- goland
- pycharm-professional
- hugo
- kubectl
- kontena-lens
- code
- spotify
classic: true