Update file main.yml
This commit is contained in:
parent
9108da01b1
commit
516bf7a243
@ -219,16 +219,27 @@
|
||||
create_home: no
|
||||
become: yes
|
||||
|
||||
- name: Set node_exporter architecture
|
||||
tags: node_exporter
|
||||
set_fact:
|
||||
node_exporter_arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else 'arm64' if ansible_architecture == 'aarch64' else ansible_architecture }}"
|
||||
|
||||
- name: Download node_exporter
|
||||
tags: node_exporter
|
||||
get_url:
|
||||
url: "https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-{{ ansible_architecture }}.tar.gz"
|
||||
url: "https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-{{ node_exporter_arch }}.tar.gz"
|
||||
dest: /tmp/node_exporter.tar.gz
|
||||
mode: '0644'
|
||||
timeout: 60
|
||||
when: ansible_architecture == "x86_64" or ansible_architecture == "aarch64"
|
||||
when: node_exporter_arch in ['amd64', 'arm64']
|
||||
become: yes
|
||||
|
||||
- name: Fail on unsupported architecture
|
||||
tags: node_exporter
|
||||
fail:
|
||||
msg: "Unsupported architecture {{ ansible_architecture }} for node_exporter"
|
||||
when: node_exporter_arch not in ['amd64', 'arm64']
|
||||
|
||||
- name: Create temporary extraction directory
|
||||
tags: node_exporter
|
||||
file:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user