Dot_Files/tasks/install-rust.yml

32 lines
726 B
YAML
Raw Normal View History

2022-08-01 00:42:23 -05:00
---
- name: Check if Cargo is installed
2022-08-01 01:48:49 -05:00
ansible.builtin.command: which cargo
2022-08-01 00:42:23 -05:00
register: cargo_installed
2022-08-01 01:48:49 -05:00
failed_when: cargo_installed.rc > 1
2022-08-01 00:42:23 -05:00
changed_when: false
- name: Download Rust installer
2022-08-01 01:52:41 -05:00
when: cargo_installed.rc != 0
2022-08-01 00:42:23 -05:00
ansible.builtin.get_url:
url: http://sh.rustup.rs
dest: /tmp/sh.rustup.rs
mode: 0755
force: true
tags:
- rust
- prereq
- name: Install Rust & Cargo
2022-08-01 01:52:41 -05:00
when: cargo_installed.rc != 0
2022-08-01 00:42:23 -05:00
environment:
2022-08-01 01:48:49 -05:00
CARGO_HOME: "{{ cargo_home | default(xdg_data_home + 'cargo') }}"
RUSTUP_HOME: "{{ rustup_home | default(xdg_data_home + 'rustup') }}"
2022-08-01 00:42:23 -05:00
ansible.builtin.command:
argv:
2022-08-01 01:54:03 -05:00
- /tmp/sh.rustup.rs
2022-08-01 00:42:23 -05:00
- -y
changed_when: true
tags:
- rust
- prereq