This commit is contained in:
parent
a64b5b2325
commit
01991435ae
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- name: Initialize tempfolder
|
||||||
|
ansible.builtin.tempfile:
|
||||||
|
state: directory
|
||||||
|
register: archive
|
||||||
|
|
||||||
|
- name: Download, extract & install archived static binary
|
||||||
|
ansible.builtin.unarchive:
|
||||||
|
src: "{{ item.url }}"
|
||||||
|
dest: "{{ archive.path }}"
|
||||||
|
remote_src: yes
|
||||||
|
extra_opts: "{{ item.extra_opts | default(omit) }}"
|
||||||
|
|
||||||
|
- name: Install extracted binary
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ archive.path }}/{{ item.filename }}"
|
||||||
|
dest: /usr/local/bin/{{ item.filename }}
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Cleanup tempfolder
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ archive.path }}"
|
||||||
|
state: absent
|
||||||
|
when: archive.path is defined
|
@ -14,40 +14,9 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
loop: "{{ dependencies.static_binaries | selectattr('archive', 'undefined') }}"
|
loop: "{{ dependencies.static_binaries | selectattr('archive', 'undefined') }}"
|
||||||
|
|
||||||
- block:
|
- name: Download, extract & install archived static binaries
|
||||||
- name: Initialize tempfolder
|
include_tasks: dependencies.archive_compressed.yml
|
||||||
ansible.builtin.tempfile:
|
loop: "{{ dependencies.static_binaries | rejectattr('archive', 'undefined') | selectattr('archive', 'equalto', 'compressed') }}"
|
||||||
state: directory
|
|
||||||
register: archives
|
|
||||||
|
|
||||||
- name: Create destination sub folder
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ archives.path }}/{{ item.filename }}"
|
|
||||||
state: directory
|
|
||||||
loop: "{{ dependencies.static_binaries | selectattr('archive', 'defined') | selectattr('archive', 'equalto', 'compressed') }}"
|
|
||||||
|
|
||||||
- name: Download, extract & install archived static binaries
|
|
||||||
ansible.builtin.unarchive:
|
|
||||||
src: "{{ item.url }}"
|
|
||||||
dest: "{{ archives.path }}/{{ item.filename }}"
|
|
||||||
remote_src: yes
|
|
||||||
extra_opts: "{{ item.extra_opts | default(omit) }}"
|
|
||||||
loop: "{{ dependencies.static_binaries | selectattr('archive', 'defined') | selectattr('archive', 'equalto', 'compressed') }}"
|
|
||||||
|
|
||||||
- name: Install extracted binaries
|
|
||||||
ansible.builtin.file:
|
|
||||||
src: "{{ archives.path }}/{{ item.filename }}/{{ item.filename }}"
|
|
||||||
dest: /usr/local/bin/{{ item.filename }}
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0755
|
|
||||||
loop: "{{ dependencies.static_binaries | selectattr('archive', 'defined') | selectattr('archive', 'equalto', 'compressed') }}"
|
|
||||||
|
|
||||||
- name: Cleanup tempfolder
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ archives.path }}"
|
|
||||||
state: absent
|
|
||||||
when: archives.path is defined
|
|
||||||
|
|
||||||
- name: Install ansible-galaxy collections
|
- name: Install ansible-galaxy collections
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
|
Loading…
Reference in New Issue
Block a user