created new package tasks for handler-based inclusions, otehrwise got username and home directory of SSH login for path purposes
This commit is contained in:
28
roles/init-server/tasks/contingent/pkg/rustup.yml
Normal file
28
roles/init-server/tasks/contingent/pkg/rustup.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Acquiring home of current user
|
||||
when: ansible_facts["system"] == "Linux"
|
||||
ansible.builtin.shell:
|
||||
cmd: "echo ~{{ ansible_user }}"
|
||||
register: ansible_user_home
|
||||
- name: Acquiring current user
|
||||
when: ansible_facts["system"] == "Linux"
|
||||
ansible.builtin.shell:
|
||||
cmd: "echo {{ ansible_user }}"
|
||||
register: current_user
|
||||
- name: Executing shell-scripted installation process for Rust
|
||||
become: true
|
||||
become_user: "{{ current_user.stdout }}"
|
||||
ansible.builtin.shell:
|
||||
cmd: "{{ ansible_user_home.stdout }}/.local/bin/rustup-install.sh -yq"
|
||||
creates: "{{ ansible_user_home.stdout }}/.cargo/bin"
|
||||
- name: Linking binaries to directories already in PATH environment variable
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
src: "{{ ansible_user_home.stdout }}/.cargo/bin/{{ item }}"
|
||||
dest: "/usr/local/bin/{{ item }}"
|
||||
state: link
|
||||
loop:
|
||||
- rustup
|
||||
- name: Reboot machine for shell environment change
|
||||
ansible.builtin.reboot:
|
||||
msg: Rebooting machine
|
||||
Reference in New Issue
Block a user