change get_url in combination with unarchiv or apt

This commit is contained in:
Oli
2023-02-04 16:40:03 +00:00
parent 5435284e75
commit a44b410265
8 changed files with 79 additions and 81 deletions

View File

@@ -14,32 +14,28 @@
systemd_exporter_version: "{{ systemd_exporter_version | replace ('v', '', 1) | trim }}"
run_once: true
- name: download systemd_exporter {{ systemd_exporter_version.tag }} from GitHub
- name: Download systemd_exporter {{ systemd_exporter_version.tag }} from GitHub
get_url:
url: "https://github.com/povilasv/systemd_exporter/releases/download/\
v{{ systemd_exporter_version.tag }}/systemd_exporter-{{ systemd_exporter_version.tag }}\
.linux-{{ deb_architecture }}.tar.gz"
dest: "/tmp/systemd_exporter-{{ systemd_exporter_version.tag }}-linux-{{ deb_architecture }}.tar.gz"
dest: "/var/tmp/systemd_exporter.tar.gz"
register: _download_archive
until: _download_archive is succeeded
retries: 3
delay: 5
- name: unpack systemd_exporter binaries
- name: Unpack systemd_exporter
unarchive:
src: "/tmp/systemd_exporter-{{ systemd_exporter_version.tag }}-linux-{{ deb_architecture }}.tar.gz"
dest: "/tmp"
creates: "/tmp/systemd_exporter-{{ systemd_exporter_version.tag }}.linux-{{ deb_architecture }}"
remote_src: true
- name: Copy systemd_exporter
copy:
src: "/tmp/systemd_exporter-{{ systemd_exporter_version.tag }}.linux-{{ deb_architecture }}/systemd_exporter"
dest: "{{ systemd_exporter_install_dir }}/systemd_exporter"
remote_src: true
src: "/var/tmp/systemd_exporter.tar.gz"
dest: "{{ systemd_exporter_install_dir }}"
owner: "{{ systemd_exporter_system_user }}"
group: "{{ systemd_exporter_system_group }}"
mode: 0755
extra_opts:
- --strip-components=1
include:
- "systemd_exporter-{{ systemd_exporter_version.tag }}.linux-{{ deb_architecture }}/systemd_exporter"
notify: restart systemd_exporter
- name: Copy the systemd_exporter systemd service file