ansible/roles/node_exporter/tasks/get_version.yml

19 lines
596 B
YAML
Raw Normal View History

---
- name: Determine latest GitHub release (local)
delegate_to: localhost
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
set_fact:
version: "{{ _github_release.json.tag_name
| regex_replace('^v?([0-9\\.]+)$', '\\1') }}"
- name: Set download_url
set_fact:
download_url: "https://github.com/prometheus/node_exporter/releases/download/v{{ version }}/node_exporter-{{ version }}.linux-{{ go_arch }}.tar.gz"