grafana-ansible-collection/roles/grafana_agent/tasks/preflight/download.yaml

20 lines
849 B
YAML
Raw Normal View History

2023-03-03 09:53:02 +01:00
---
- name: Set the Grafana Agent version to latest version
ansible.builtin.set_fact:
grafana_agent_version: "{{ (lookup('url', 'https://api.github.com/repos/{{ _grafana_agent_github_org }}/{{ _grafana_agent_github_repo }}/releases/latest',
split_lines=False) | from_json).get('tag_name') | replace('v', '') }}"
2023-03-03 09:53:02 +01:00
when: grafana_agent_version == 'latest' and not __grafana_agent_local_install
- name: Grafana Agent version to download
ansible.builtin.debug:
var: grafana_agent_version
2023-03-03 09:53:02 +01:00
2023-03-10 06:45:00 +01:00
- name: Set the Grafana Agent download URL
2023-03-03 09:53:02 +01:00
ansible.builtin.set_fact:
_grafana_agent_download_url: |-
{{ _grafana_agent_base_download_url }}/v{{ grafana_agent_version }}/{{ _grafana_agent_download_archive_file }}
2023-03-10 06:45:00 +01:00
- name: Grafana Agent download URL
2023-03-03 09:53:02 +01:00
ansible.builtin.debug:
var: _grafana_agent_download_url