Skip to content

Commit

Permalink
Move _grafana_agent_base_download_url from /vars to /defaults (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-zhuravlev authored Aug 10, 2023
1 parent b312623 commit df05fce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions roles/grafana_agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All variables which can be overridden are stored in [./defaults/main.yaml](./def
| Variable | Default | Description |
| :------ | :------ | :--------- |
| `grafana_agent_version` | `latest` | version of the agent to install |
| `grafana_agent_base_download_url` | `https://github.com/{{ _grafana_agent_github_org }}/{{ _grafana_agent_github_repo }}/releases/download` | base download url. Github or mirror to download from |
| `grafana_agent_install_dir` | `/opt/grafana-agent/bin` | directory to install the binary to |
| `grafana_agent_binary` | `grafana-agent` | name to use for the binary |
| `grafana_agent_config_dir` | `/etc/grafana-agent` | directory to store the configuration files in |
Expand Down
3 changes: 3 additions & 0 deletions roles/grafana_agent/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# version of the agent to install
grafana_agent_version: latest

# base download url. Github or mirror to download from
grafana_agent_base_download_url: "https://github.com/{{ _grafana_agent_github_org }}/{{ _grafana_agent_github_repo }}/releases/download"

# directory to install the binary to
grafana_agent_install_dir: /opt/grafana-agent/bin

Expand Down
2 changes: 1 addition & 1 deletion roles/grafana_agent/tasks/preflight/download.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- name: Set the Grafana Agent download URL
ansible.builtin.set_fact:
_grafana_agent_download_url: |-
{{ _grafana_agent_base_download_url }}/v{{ grafana_agent_version }}/{{ _grafana_agent_download_archive_file }}
{{ grafana_agent_base_download_url }}/v{{ grafana_agent_version }}/{{ _grafana_agent_download_archive_file }}
- name: Grafana Agent download URL
ansible.builtin.debug:
Expand Down
1 change: 0 additions & 1 deletion roles/grafana_agent/vars/main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
_grafana_agent_github_org: grafana
_grafana_agent_github_repo: agent
_grafana_agent_base_download_url: "https://github.com/{{ _grafana_agent_github_org }}/{{ _grafana_agent_github_repo }}/releases/download"

# set the go cpu arch
_download_cpu_arch_map:
Expand Down

0 comments on commit df05fce

Please sign in to comment.