Do not keep binaries inside rust_build user home
This commit is contained in:
21
playbook.yml
21
playbook.yml
@@ -425,6 +425,7 @@
|
|||||||
- crate: watchexec-cli
|
- crate: watchexec-cli
|
||||||
binary: watchexec
|
binary: watchexec
|
||||||
version: 1.17.1
|
version: 1.17.1
|
||||||
|
|
||||||
- name: build rust crates
|
- name: build rust crates
|
||||||
shell: |
|
shell: |
|
||||||
cargo install --version {{ item.version }} {{ item.crate }}
|
cargo install --version {{ item.version }} {{ item.crate }}
|
||||||
@@ -435,9 +436,27 @@
|
|||||||
become_user: rust_build
|
become_user: rust_build
|
||||||
loop: "{{ cargo_crate_list }}"
|
loop: "{{ cargo_crate_list }}"
|
||||||
|
|
||||||
|
- name: create target directory
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: /usr/local/lib/binaries/
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0775'
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: move binaries
|
||||||
|
shell: |
|
||||||
|
mv /var/lib/rust_build/.cargo/bin/{{ item.binary }}.{{ item.version }} /usr/local/lib/binaries/{{ item.binary }}.{{ item.version }}
|
||||||
|
ln -s /usr/local/lib/binaries/{{ item.binary }}.{{ item.version }} /var/lib/rust_build/.cargo/bin/{{ item.binary }}.{{ item.version }}
|
||||||
|
args:
|
||||||
|
creates: /usr/local/lib/binaries/{{ item.binary }}.{{ item.version }}
|
||||||
|
become: true
|
||||||
|
loop: "{{ cargo_crate_list }}"
|
||||||
|
|
||||||
- name: link binaries
|
- name: link binaries
|
||||||
file:
|
file:
|
||||||
src: /var/lib/rust_build/.cargo/bin/{{ item.binary }}.{{ item.version }}
|
src: /usr/local/lib/binaries/{{ item.binary }}.{{ item.version }}
|
||||||
dest: /usr/local/bin/{{ item.binary }}
|
dest: /usr/local/bin/{{ item.binary }}
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|||||||
Reference in New Issue
Block a user