diff options
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 }}" |