Add Ansible configuration and remove NixOS
All checks were successful
Nix Format Check / check-format (pull_request) Successful in 39s
All checks were successful
Nix Format Check / check-format (pull_request) Successful in 39s
This commit is contained in:
20
config/ansible/tasks/rust.yml
Normal file
20
config/ansible/tasks/rust.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
- 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: Install Rust and Cargo
|
||||
shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
args:
|
||||
creates: ~/.cargo/bin/rustc
|
||||
when: rust_check.rc != 0
|
||||
|
||||
- name: Add Cargo to PATH
|
||||
ansible.builtin.lineinfile:
|
||||
path: ~/.bashrc
|
||||
line: 'source $HOME/.cargo/env'
|
||||
create: yes
|
||||
when: rust_check.rc != 0
|
||||
Reference in New Issue
Block a user