aboutsummaryrefslogblamecommitdiffstats
path: root/roles/copy_bin/tasks/main.yml
blob: ccdfa525d0e0b50ccd0312b4f65d580ac61d6fe8 (plain) (tree)
























                                                                                      
---

- 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 }}"
remember that computers suck.