refactor: yml -> yaml
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
18
roles/node_exporter/tasks/get_version.yaml
Normal file
18
roles/node_exporter/tasks/get_version.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Determine latest GitHub release (local)
|
||||
delegate_to: localhost
|
||||
ansible.builtin.uri:
|
||||
url: "https://api.github.com/repos/prometheus/node_exporter/releases/{{ version }}"
|
||||
body_format: json
|
||||
register: _github_release
|
||||
until: _github_release.status == 200
|
||||
retries: 3
|
||||
|
||||
- name: Set version
|
||||
ansible.builtin.set_fact:
|
||||
tag: "{{ _github_release.json.tag_name
|
||||
| regex_replace('^v?([0-9\\.]+)$', '\\1') }}"
|
||||
|
||||
- name: Set download_url
|
||||
ansible.builtin.set_fact:
|
||||
download_url: "https://github.com/prometheus/node_exporter/releases/download/v{{ tag }}/node_exporter-{{ tag }}.linux-{{ go_arch }}.tar.gz"
|
||||
Reference in New Issue
Block a user