summaryrefslogtreecommitdiff
path: root/ansible/roles/rust-rustup/tasks/main.yml
blob: 0deb891aa2958d78ac7cd76e7b3d0ef46834a0bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
- name: "install necessary packagers"
  apt:
    name:
      - build-essential
      - curl
- name: "install Rust toolchain using rustup"
  shell: |
    set -eu
    if command -v rustup > /dev/null
    then
        sudo -u liw rustup update
    else
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh
        sudo -u liw -i sh /tmp/rustup.sh -y
    fi
    sudo -u liw -i rustup component add clippy
- name: "install rust-src component"
  shell: |
    rustup component add rust-src
- name: "cargo install applications"
  when: rustup_cargo_install is defined
  args:
    warn: no
  shell: |
    sudo -i -u liw cargo install {{ rustup_cargo_install }}