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