56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
---
|
|
- name: determine install status
|
|
ansible.builtin.stat:
|
|
path: "{{ logcli_opt_path }}/logcli"
|
|
register: st
|
|
|
|
- name: create opt path
|
|
ansible.builtin.file:
|
|
path: "{{ logcli_opt_path }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
state: directory
|
|
|
|
- block:
|
|
- name: download
|
|
ansible.builtin.get_url:
|
|
url: "{{ logcli_release_url }}"
|
|
dest: "{{ logcli_download_path }}"
|
|
checksum: "{{ logcli_checksums[logcli_release_file] }}"
|
|
register: dl
|
|
until: dl is success
|
|
retries: 5
|
|
delay: 10
|
|
|
|
- name: extract
|
|
ansible.builtin.unarchive:
|
|
src: "{{ logcli_download_path }}"
|
|
dest: "{{ logcli_unarchive_dest_path }}"
|
|
remote_src: true
|
|
|
|
- name: install
|
|
ansible.builtin.copy:
|
|
src: "{{ logcli_extracted_path }}"
|
|
dest: "{{ logcli_opt_path }}/{{ item }}"
|
|
remote_src: true
|
|
loop: "{{ logcli_binaries }}"
|
|
when: not st.stat.exists
|
|
|
|
- name: permissions
|
|
ansible.builtin.file:
|
|
path: "{{ logcli_opt_path }}/{{ item }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
loop: "{{ logcli_binaries }}"
|
|
|
|
- name: symlink
|
|
ansible.builtin.file:
|
|
src: "{{ logcli_opt_path }}/{{ item }}"
|
|
dest: "/usr/local/bin/{{ item }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
state: link
|
|
loop: "{{ logcli_binaries }}" |