Add role rust
This commit is contained in:
parent
7d5f0ea4fa
commit
f9683a6248
3 changed files with 29 additions and 9 deletions
|
@ -25,15 +25,6 @@ mariadb:
|
||||||
command: sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql && sudo systemctl start mysqld.service && sudo mysql_secure_installation
|
command: sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql && sudo systemctl start mysqld.service && sudo mysql_secure_installation
|
||||||
condition: "sudo find /var/lib/mysql -mindepth 1 | read"
|
condition: "sudo find /var/lib/mysql -mindepth 1 | read"
|
||||||
|
|
||||||
rust:
|
|
||||||
- run:
|
|
||||||
command: rustup self uninstall
|
|
||||||
condition: "[ -e ~/.cargo ]"
|
|
||||||
- install:
|
|
||||||
- rustup
|
|
||||||
- run:
|
|
||||||
- rustup default stable
|
|
||||||
|
|
||||||
pacman_hooks:
|
pacman_hooks:
|
||||||
- run:
|
- run:
|
||||||
- sudo mkdir -p /etc/pacman.d/hooks
|
- sudo mkdir -p /etc/pacman.d/hooks
|
||||||
|
|
|
@ -23,4 +23,5 @@
|
||||||
- { role: lilypond, tags: lilypond }
|
- { role: lilypond, tags: lilypond }
|
||||||
- { role: latex, tags: latex }
|
- { role: latex, tags: latex }
|
||||||
- { role: powershell, tags: powershell }
|
- { role: powershell, tags: powershell }
|
||||||
|
- { role: rust, tags: rust }
|
||||||
- { role: protonvpn, tags: protonvpn }
|
- { role: protonvpn, tags: protonvpn }
|
||||||
|
|
28
roles/rust/tasks/main.yml
Normal file
28
roles/rust/tasks/main.yml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
---
|
||||||
|
- 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"
|
Loading…
Add table
Reference in a new issue