-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVscode.yml
More file actions
79 lines (69 loc) · 2.06 KB
/
Copy pathVscode.yml
File metadata and controls
79 lines (69 loc) · 2.06 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
---
- name: Install VScode
hosts: all
vars_files:
- config.yml
remote_user: "{{ username }}"
become: true
connection: local
gather_facts: false
tasks:
- name: Install dependencies
ansible.builtin.apt:
name:
- wget
- gpg
- apt-transport-https
state: present
update_cache: yes
- name: Install several packages required for VScode
ansible.builtin.apt:
name:
- "{{ libasound }}"
- xorg
- xauth
state: present
- name: Add Microsoft GPG key
ansible.builtin.apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc
state: present
- name: Add VSCode repository
ansible.builtin.apt_repository:
repo: "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main"
state: present
filename: vscode
- name: Install VSCode
ansible.builtin.apt:
name: code
state: present
update_cache: yes
- name: Verify VSCode installation
ansible.builtin.command:
cmd: code --version
register: vscode_version
changed_when: false
become: true
become_user: "{{ username }}"
- name: Display installation summary
ansible.builtin.debug:
msg:
- "Visual Studio Code installed successfully!"
- "Version: {{ vscode_version.stdout_lines[0] }}"
- ""
- "To start VS Code:"
- " code"
- " code /path/to/folder"
- " code file.txt"
# see https://stackoverflow.com/questions/78422507/vs-code-github-auth-not-working-on-linux-due-to-gnome-environment-os-keyring-err
# Because the GNOME keyring, which is used to store credentials securely, is not available or is not running correctly
- name: Run apt update
apt:
update_cache: yes
- name: Install dependencies
ansible.builtin.apt:
name:
- gnome-keyring
- libsecret-1-0
- libsecret-1-dev
state: present
update_cache: yes