Dot_Files/tasks/install-rust.yml

31 lines
698 B
YAML

---
- name: Check if Cargo is installed
ansible.builtin.command: command -v cargo
register: cargo_installed
changed_when: false
- name: Download Rust installer
when: cargo_installed is failed
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
when: cargo_installed is failed
environment:
CARGO_HOME: "{{ cargo_home | default(XDG_DATA_HOME + 'cargo') }}"
RUSTUP_HOME: "{{ rustup_home | default(XDG_DATA_HOME + 'rustup') }}"
ansible.builtin.command:
cmd: /tmp/sh.rustup.rs
argv:
- -y
changed_when: true
tags:
- rust
- prereq