refactor: reorganize Ansible tasks for better structure and include common package installations
All checks were successful
Nix Format Check / check-format (pull_request) Successful in 40s
All checks were successful
Nix Format Check / check-format (pull_request) Successful in 40s
This commit is contained in:
22
config/ansible/tasks/global/rust.yml
Normal file
22
config/ansible/tasks/global/rust.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
- name: Check if Rust is installed
|
||||
ansible.builtin.shell: source $HOME/.cargo/env && rustc --version
|
||||
register: rust_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
- name: Download Rust installation script
|
||||
ansible.builtin.get_url:
|
||||
url: https://sh.rustup.rs
|
||||
dest: /tmp/rustup.sh
|
||||
mode: '0755'
|
||||
when: rust_check.rc != 0
|
||||
|
||||
- name: Install Rust and Cargo
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
/tmp/rustup.sh -y
|
||||
args:
|
||||
creates: ~/.cargo/bin/rustc
|
||||
when: rust_check.rc != 0
|
Reference in New Issue
Block a user