Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.

Commit 50d04c8

Browse files
authored
download checksum file only once (#51)
[patch]
1 parent b863e88 commit 50d04c8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tasks/preflight.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
when: item in node_exporter_enabled_collectors
1616
with_items: "{{ node_exporter_disabled_collectors }}"
1717

18+
- name: Get checksum list from github
19+
set_fact:
20+
_checksums: "{{ lookup('url', 'https://github.com/prometheus/node_exporter/releases/download/v' + node_exporter_version + '/sha256sums.txt', wantlist=True) | list }}"
21+
run_once: true
22+
1823
- name: "Get checksum for {{ go_arch_map[ansible_architecture] | default(ansible_architecture) }} architecture"
1924
set_fact:
2025
node_exporter_checksum: "{{ item.split(' ')[0] }}"
21-
with_items:
22-
- "{{ lookup('url', 'https://github.com/prometheus/node_exporter/releases/download/v' + node_exporter_version + '/sha256sums.txt', wantlist=True) | list }}"
26+
with_items: "{{ _checksums }}"
2327
when: "('linux-' + (go_arch_map[ansible_architecture] | default(ansible_architecture)) + '.tar.gz') in item"

0 commit comments

Comments
 (0)