Skip to content

Instantly share code, notes, and snippets.

@carreirorco
Created September 2, 2021 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carreirorco/d58b0ef842a250be5c2e389a60ca48ee to your computer and use it in GitHub Desktop.
Save carreirorco/d58b0ef842a250be5c2e389a60ca48ee to your computer and use it in GitHub Desktop.
---
- hosts: localhost
tasks:
- name: Import a key from a url
become: yes
ansible.builtin.rpm_key:
state: present
key: https://packages.microsoft.com/keys/microsoft.asc
- name: Create the repository file
become: yes
copy:
dest: /etc/yum.repos.d/vscode.repo
content: |
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
- name: Install Visual Studio Code
become: yes
dnf:
name: code
state: present
update_cache: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment