28 lines
604 B
YAML
28 lines
604 B
YAML
---
|
|
- name: Check if ~/.cargo exists
|
|
stat:
|
|
path: ~/.cargo
|
|
register: cargo_dir
|
|
|
|
- name: Uninstall rustup if installed without package manager
|
|
command: rustup self uninstall
|
|
when: cargo_dir.stat.exists
|
|
|
|
- name: Install rust (Archlinux)
|
|
become: true
|
|
pacman:
|
|
name:
|
|
- rustup
|
|
when: ansible_distribution == 'Archlinux'
|
|
|
|
- name: Install rust (Debian)
|
|
become: true
|
|
apt:
|
|
name:
|
|
- rustup
|
|
when: ansible_distribution == 'Debian'
|
|
|
|
- name: Setup rustup stable
|
|
command: rustup default stable
|
|
register: result
|
|
changed_when: "'using existing install' not in result.stderr"
|