Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-10-08 11:31:26 +02:00
parent 0c1a8a95f2
commit 5d0f56ce38
15 changed files with 49 additions and 38 deletions

View File

@@ -1,7 +1,7 @@
---
- name: Determine latest GitHub release (local)
delegate_to: localhost
uri:
ansible.builtin.uri:
url: "https://api.github.com/repos/prometheus/node_exporter/releases/{{ version }}"
body_format: json
register: _github_release
@@ -9,10 +9,10 @@
retries: 3
- name: Set version
set_fact:
ansible.builtin.set_fact:
tag: "{{ _github_release.json.tag_name
| regex_replace('^v?([0-9\\.]+)$', '\\1') }}"
- name: Set download_url
set_fact:
ansible.builtin.set_fact:
download_url: "https://github.com/prometheus/node_exporter/releases/download/v{{ tag }}/node_exporter-{{ tag }}.linux-{{ go_arch }}.tar.gz"