29 lines
967 B
YAML
29 lines
967 B
YAML
---
|
|
- 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 a shell-scripted installation process
|
|
become: true
|
|
become_user: "{{ current_user.stdout }}"
|
|
ansible.builtin.shell:
|
|
cmd: "{{ ansible_user_home.stdout }}/.local/bin/uv-install.sh"
|
|
creates: "{{ ansible_user_home.stdout }}/.local/bin/uv"
|
|
- name: Linking binaries to directories already in PATH environment variable
|
|
become: true
|
|
ansible.builtin.file:
|
|
src: "{{ ansible_user_home.stdout }}/.local/bin/{{ item }}"
|
|
dest: "/usr/local/bin/{{ item }}"
|
|
state: link
|
|
loop:
|
|
- uv
|
|
- uvx
|
|
- name: Reboot machine for shell environment change
|
|
ansible.builtin.reboot:
|
|
msg: Rebooting machine |