diff --git a/home.yml b/home.yml index b319cdf..a3f1eaf 100644 --- a/home.yml +++ b/home.yml @@ -3,6 +3,7 @@ hosts: localhost roles: - system-packages + - dev-toolchain - shell-tweaks - editor-tweaks - tool-config diff --git a/roles/dev-toolchain/tasks/main.yml b/roles/dev-toolchain/tasks/main.yml new file mode 100644 index 0000000..9c8d2fd --- /dev/null +++ b/roles/dev-toolchain/tasks/main.yml @@ -0,0 +1,17 @@ +--- +- name: Check if rustup is installed + shell: which rustup + register: which_rustup +- 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 +- 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 diff --git a/roles/dev-toolchain/vars/main.yml b/roles/dev-toolchain/vars/main.yml new file mode 100644 index 0000000..b470603 --- /dev/null +++ b/roles/dev-toolchain/vars/main.yml @@ -0,0 +1,2 @@ +--- +go_version: 1.23.1