-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.yml
166 lines (146 loc) · 4.27 KB
/
setup.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
---
- hosts: acs
tasks:
- name: Allow current user to have passwordless sudo
become: yes
copy:
content: "{{ ansible_user_id }} ALL=(ALL) NOPASSWD: ALL"
dest: /etc/sudoers.d/{{ ansible_user_id }}
- name: create .ssh directory
file:
path: /home/{{ ansible_user_id }}/.ssh
state: directory
- name: write .ssh/config
copy:
content: "{{ item.content }}"
dest: /home/{{ ansible_user_id }}/.ssh/{{ item.name }}
mode: 0600
with_items:
- content: "{{ ssh_config }}"
name: config
- content: "{{ ssh_private_key }}"
name: id_rsa
- content: "{{ ssh_public_key }}"
name: id_rsa.pub
- name: add apt keys
become: yes
apt_key:
url: "{{ item }}"
state: present
with_items:
- https://dl.google.com/linux/linux_signing_key.pub
- https://packages.microsoft.com/keys/microsoft.asc
- https://download.docker.com/linux/ubuntu/gpg
- https://packages.cloud.google.com/apt/doc/apt-key.gpg
- name: add apt repositories
become: yes
apt_repository:
repo: "{{ item }}"
state: present
with_items:
- deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
- deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
- deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
- deb [arch=amd64] https://packages.cloud.google.com/apt/ kubernetes-xenial main
- deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ bionic main
- ppa:ubuntu-mozilla-security/ppa
- deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
#- name: add deb packages
# become: yes
# apt:
# deb: "{{ item }}"
# with_items:
# - https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
- name: install apps
become: yes
apt:
autoclean: yes
autoremove: yes
update_cache: yes
name: "{{ item }}"
with_items:
- git
- google-chrome-stable
- code
- openjdk-8-jdk
- libstdc++5:i386
- libpam0g:i386
- libx11-6:i386
- docker-ce
- kubectl
- azure-cli
- dotnet-sdk-2.1
- thunderbird
- openvpn
- terminator
- name: remove duplicate repositories
become: yes
file:
path: /etc/apt/sources.list.d/{{ item }}
state: absent
with_items:
- google-chrome.list
- vscode.list
- name: download snx script
get_url:
url: "{{ vpn_url }}"
dest: "{{ playbook_dir }}/snx_install.sh"
mode: +x
- name: install snx
become: yes
script: "{{ playbook_dir }}/snx_install.sh"
- name: create docker group
become: yes
group:
name: docker
state: present
- name: Add current user to docker group
become: yes
user:
name: "{{ ansible_user_id }}"
groups: docker
append: yes
- name: Add kubectl completion
lineinfile:
path: ~/.bashrc
state: present
regexp: '^source \<\(kubectl completion bash\)'
line: 'source <(kubectl completion bash)'
- name: install vscode extensions
shell: code --install-extension {{ item }}
with_items:
- ms-python.python
- msjsdiag.debugger-for-chrome
- ms-vscode.csharp
- eamodio.gitlens
- ms-vscode.go
- peterjausovec.vscode-docker
- ms-vscode.powershell
- formulahendry.auto-close-tag
- formulahendry.code-runner
- davidanson.vscode-markdownlint
- humao.rest-client
- christian-kohler.path-intellisense
- rebornix.ruby
- formulahendry.auto-rename-tag
ignore_errors: yes
- name: download lastpass
get_url:
url: https://lastpass.com/lplinux.tar.bz2
dest: "/home/{{ ansible_user_id }}/Downloads"
- name: create lastpass directory
file:
path: /home/{{ ansible_user_id }}/Downloads/lastpass
state: directory
- name: unarchive lastpass
unarchive:
src: /home/{{ ansible_user_id }}/Downloads/lplinux.tar.bz2
dest: /home/{{ ansible_user_id }}/Downloads/lastpass
- name: set lastpass execute
file:
path: /home/{{ ansible_user_id }}/Downloads/lastpass/install_lastpass.sh
mode: +x
- name: install lastpass
shell: ./install_lastpass.sh
args:
chdir: /home/{{ ansible_user_id }}/Downloads/lastpass/