Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download tarball on ansible host #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---

# minimum supported version: 0.15
prometheus_node_exporter_local_download: true

prometheus_node_exporter_version: 0.18.1
prometheus_node_exporter_release_name: "node_exporter-{{ prometheus_node_exporter_version }}.linux-{{ go_arch }}"
Expand Down
13 changes: 11 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@
module: get_url
url: "{{ url }}"
dest: "/tmp/{{ prometheus_node_exporter_release_name }}.tar.gz"

when: prometheus_node_exporter_local_download | bool

- name: download prometheus node exporter binary remotely
become: no
get_url:
url: "{{ url }}"
dest: "{{ prometheus_exporters_common_dist_dir }}/{{ prometheus_node_exporter_release_name }}.tar.gz"
when: not prometheus_node_exporter_local_download

- name: transfer local node exporter binary
copy:
copy:
src: "/tmp/{{ prometheus_node_exporter_release_name }}.tar.gz"
dest: "{{ prometheus_exporters_common_dist_dir }}/{{ prometheus_node_exporter_release_name }}.tar.gz"
owner: "{{ prometheus_exporters_common_user}}"
group: "{{ prometheus_exporters_common_group }}"
mode: '0755'
when: prometheus_node_exporter_local_download | bool

- name: unarchive binary tarball
unarchive:
Expand Down