change get_url in combination with unarchiv or apt
This commit is contained in:
@@ -14,30 +14,28 @@
|
||||
postgres_exporter_version: "{{ postgres_exporter_version | replace ('v', '', 1) | trim }}"
|
||||
run_once: true
|
||||
|
||||
- name: download postgres_exporter {{ postgres_exporter_version.tag }} from GitHub
|
||||
- name: Download postgres_exporter {{ postgres_exporter_version.tag }} from GitHub
|
||||
get_url:
|
||||
url: "https://github.com/prometheus-community/postgres_exporter/releases/download/\
|
||||
v{{ postgres_exporter_version.tag }}/postgres_exporter-{{ postgres_exporter_version.tag }}\
|
||||
.linux-{{ deb_architecture }}.tar.gz"
|
||||
dest: "/tmp/postgres_exporter-{{ postgres_exporter_version.tag }}-linux-{{ deb_architecture }}.tar.gz"
|
||||
dest: "/var/tmp/postgres_exporter.tar.gz"
|
||||
register: _download_archive
|
||||
until: _download_archive is succeeded
|
||||
retries: 3
|
||||
delay: 5
|
||||
|
||||
- name: unpack postgres_exporter binaries
|
||||
- name: Unpack postgres_exporter
|
||||
unarchive:
|
||||
src: "/tmp/postgres_exporter-{{ postgres_exporter_version.tag }}-linux-{{ deb_architecture }}.tar.gz"
|
||||
dest: "/tmp"
|
||||
creates: "/tmp/postgres_exporter-{{ postgres_exporter_version.tag }}.linux-{{ deb_architecture }}"
|
||||
remote_src: true
|
||||
|
||||
- name: Copy postgres_exporter
|
||||
copy:
|
||||
src: "/tmp/postgres_exporter-{{ postgres_exporter_version.tag }}.linux-{{ deb_architecture }}/postgres_exporter"
|
||||
dest: "{{ pgsql_exporter_install_dir }}/postgres_exporter"
|
||||
remote_src: true
|
||||
mode: 0755
|
||||
src: "/var/tmp/postgres_exporter.tar.gz"
|
||||
dest: "{{ pgsql_exporter_install_dir }}"
|
||||
owner: root
|
||||
group: root
|
||||
extra_opts:
|
||||
--strip-components=1
|
||||
include:
|
||||
- "postgres_exporter-{{ postgres_exporter_version.tag }}.linux-{{ deb_architecture }}/postgres_exporter"
|
||||
notify: restart postgres_exporter
|
||||
|
||||
- name: Copy the postgres_exporter systemd service file
|
||||
|
||||
Reference in New Issue
Block a user