-
Notifications
You must be signed in to change notification settings - Fork 39
/
install-apt.yml
42 lines (38 loc) · 1.15 KB
/
install-apt.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
# code: language=ansible
---
- name: Install dependencies (apt)
become: true
ansible.builtin.apt:
name:
- ca-certificates
- apt-transport-https
state: present
- name: Create APT keyrings dir
become: true
ansible.builtin.file:
path: '/etc/apt/keyrings'
state: directory
mode: 'u=rwx,go=rx'
- name: Install key (apt)
become: true
ansible.builtin.get_url:
url: '{{ visual_studio_code_mirror }}/keys/microsoft.asc'
dest: '/etc/apt/keyrings/'
mode: 'u=rw,go=r'
force: true
- name: Install VS Code repo (apt)
become: true
ansible.builtin.apt_repository:
repo: >-
deb [arch={{ visual_studio_code_deb_architecture }}
{{ visual_studio_code_gpgcheck | ternary("", " trusted=true") }}
signed-by=/etc/apt/keyrings/microsoft.asc]
{{ visual_studio_code_mirror }}/repos/code stable main
filename: vscode
state: present
when: not visual_studio_code_skip_add_repo
- name: Install VS Code (apt)
become: true
ansible.builtin.apt:
name: "{{ visual_studio_code_package }}{{ (visual_studio_code_version | length > 0) | ternary('=' + visual_studio_code_version, '') }}"
state: present