env/roles/dev-toolchain/tasks/main.yml
2024-10-13 19:36:06 -04:00

19 lines
638 B
YAML

---
- name: Check if rustup is installed
shell: which rustup
register: which_rustup
ignore_errors: true
- name: Install rustup
shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
when: which_rustup.rc == 1
- name: Check if go is installed
shell: go version
register: check_go_version
ignore_errors: true
- name: Install go
become: true
shell: |
curl -o /tmp/go.tar.gz -L https://go.dev/dl/go{{go_version}}.linux-amd64.tar.gz &&
rm -rf /usr/local/go &&
sudo tar -C /usr/local -xzf /tmp/go.tar.gz
when: check_go_version.rc == 1 or check_go_version.stdout.find(go_version) == -1