diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2024-07-01 11:02:41 +0200 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2024-07-01 11:05:18 +0200 |
commit | ebc08d2c321e8b9e34fdb728151ff235757e9e18 (patch) | |
tree | 236d5493901d1ee940bd8d9bcd1c874f2b96ae27 /roles | |
parent | 71f95b50af3e4c4dd3ba240a156001e559297896 (diff) | |
download | rules-ebc08d2c321e8b9e34fdb728151ff235757e9e18.tar.gz |
feat(roles/copy_bin): add copy bin role with ldd deps
Diffstat (limited to 'roles')
-rw-r--r-- | roles/copy_bin/tasks/main.yml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/roles/copy_bin/tasks/main.yml b/roles/copy_bin/tasks/main.yml new file mode 100644 index 0000000..ccdfa52 --- /dev/null +++ b/roles/copy_bin/tasks/main.yml @@ -0,0 +1,25 @@ +--- + +- name: "retrieve dependencies for binary: {{ copy_bin__name }}" + ansible.builtin.shell: | + set -o pipefail + ldd $(command -v {{ copy_bin__name }} ) | tr -s " " | tail -n +3 | cut -d " " -f 7 + register: copy_bin__dependencies + changed_when: false + +- name: create dependencies directories + ansible.builtin.file: + path: "{{ copy_bin__root_dir }}{{ item | dirname }}" + owner: 0 + group: 0 + mode: "0755" + state: directory + loop: "{{ copy_bin__dependencies.stdout_lines }}" + +- name: copy dependencies + ansible.builtin.copy: + src: "{{ item }}" + dest: "{{ copy_bin__root_dir }}/{{ item }}" + mode: preserve + remote_src: true + loop: "{{ copy_bin__dependencies.stdout_lines }}" |