Skip to content

Commit

Permalink
Fixed apt-key deprecation warning (#231)
Browse files Browse the repository at this point in the history
Ubuntu 22.04 will be the last release with `apt-key` (see https://manpages.ubuntu.com/manpages/jammy/man8/apt-key.8.html). `install-apt.yml` was updated to use the new (more secure) way of signing APT repos.

Co-authored-by: Juergen Hansmann <[email protected]>
  • Loading branch information
freemanjp and hansmannj authored Oct 7, 2022
1 parent 3e01497 commit 92c8cc1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tasks/install-apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,28 @@
- libxshmfence1
state: present

- name: Create APT keyrings dir
become: yes
ansible.builtin.file:
path: '/etc/apt/keyrings'
state: directory
mode: 'u=rwx,go=rx'

- name: Install key (apt)
become: yes
ansible.builtin.apt_key:
ansible.builtin.get_url:
url: '{{ visual_studio_code_mirror }}/keys/microsoft.asc'
state: present
dest: '/etc/apt/keyrings/'
mode: 'u=rw,go=r'
force: yes

- name: Install VS Code repo (apt)
become: yes
ansible.builtin.apt_repository:
repo: 'deb [arch=amd64{{ visual_studio_code_gpgcheck | ternary("", " trusted=yes") }}] {{ visual_studio_code_mirror }}/repos/code stable main'
repo: >-
deb [arch=amd64{{ visual_studio_code_gpgcheck | ternary("", " trusted=yes") }}
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
Expand Down

0 comments on commit 92c8cc1

Please sign in to comment.