Skip to content

Commit

Permalink
Switch from installations via snap
Browse files Browse the repository at this point in the history
Ubuntu snaps do not work in WSL 2.

microsoft/WSL#9026
microsoft/WSL#8709
  • Loading branch information
conradhodge committed Jan 7, 2024
1 parent cc7a5e8 commit 274c67e
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This will:
- zip
- [jq](https://stedolan.github.io/jq/)
- [yq](https://mikefarah.gitbook.io/yq/)
- [Node.js](https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions)
- [Node.js LTS](https://nodejs.org/en)
- [Go](https://golang.org/)
- [Rush](https://rushjs.io/pages/intro/welcome/)
- [pip and venv](https://docs.microsoft.com/en-us/windows/python/web-frameworks#install-python-pip-and-venv)
Expand Down
19 changes: 15 additions & 4 deletions ansible/roles/wsl/tasks/go.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
---
- name: Install Go
# https://go.dev/wiki/Ubuntu
- name: Add PPA repository for golang
become: yes
community.general.snap:
name: go
classic: true
apt_repository:
repo: ppa:longsleep/golang-backports

- name: Update apt packages
become: yes
ansible.builtin.apt:
update_cache: yes

- name: Install golang
become: yes
ansible.builtin.apt:
name: golang-go
state: latest
7 changes: 4 additions & 3 deletions ansible/roles/wsl/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
- import_tasks: apt.yml
- import_tasks: snap.yml
- import_tasks: bash.yml
- import_tasks: zsh.yml
- import_tasks: git.yml
- import_tasks: node.yml
#- import_tasks: gh.yml
- import_tasks: go.yml
- import_tasks: npm.yml
- import_tasks: go.yml
#- import_tasks: gh.yml
- import_tasks: yq.yml
- import_tasks: ngrok.yml
- import_tasks: aws.yml
- import_tasks: azure.yml
- import_tasks: liquibase.yml
Expand Down
9 changes: 9 additions & 0 deletions ansible/roles/wsl/tasks/ngrok.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# https://ngrok.com/download
- name: Download ngrok
become: yes
ansible.builtin.unarchive:
src: https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
dest: /usr/local/bin
remote_src: yes
creates: /usr/local/bin/ngrok
4 changes: 0 additions & 4 deletions ansible/roles/wsl/tasks/snap.yml

This file was deleted.

8 changes: 8 additions & 0 deletions ansible/roles/wsl/tasks/yq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# https://github.com/mikefarah/yq/#install
- name: Download yq
become: yes
ansible.builtin.get_url:
url: https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
dest: /usr/bin/yq
mode: '0755'
6 changes: 0 additions & 6 deletions ansible/roles/wsl/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ apt_packages:
- tmpreaper
- qdirstat

snap_packages:
- ngrok
- yq

node_packages:
- "@microsoft/rush"
- aws-cdk

node_version: 20

liquibase_version: 4.25.0

0 comments on commit 274c67e

Please sign in to comment.