Skip to content

Commit

Permalink
Add check for Curl and failure step if Agent Version is not retrieved (
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanjainn authored Sep 19, 2023
1 parent 35ca584 commit 0de11c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions roles/grafana_agent/tasks/preflight/download.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
---
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto

- name: Fail if Curl is not installed
ansible.builtin.fail:
msg: "curl is not installed!"
when: "'curl' not in ansible_facts.packages"


- name: Get Grafana Agent version from Github
when: grafana_agent_version == 'latest' and not __grafana_agent_local_install
block:
Expand All @@ -13,6 +23,11 @@
become: false
register: _grafana_agent_version_request

- name: Fail if cannot get Grafana Agent Version
ansible.builtin.fail:
msg: Issue getting the Grafana Agent Version
when: _grafana_agent_version_request == ""

- name: Set the Grafana Agent version
ansible.builtin.set_fact:
grafana_agent_version: "{{ _grafana_agent_version_request.stdout }}"
Expand Down

0 comments on commit 0de11c1

Please sign in to comment.