sync roles with changes from OWS

This commit is contained in:
Oli
2023-10-21 13:13:20 +00:00
parent e14271eab0
commit ccd75528ed
43 changed files with 479 additions and 107 deletions

View File

@@ -28,15 +28,26 @@
register: node_exporter_version
- name: "{{ node_exporter_version }}"
set_fact:
node_exporter_version: "{{ node_exporter_version | replace ('v', '', 1) | trim }}"
node_exporter_version: "{{ node_exporter_version | replace('v', '', 1) | trim }}"
run_once: true
- name: Download node_exporter {{ node_exporter_version.tag }} from GitHub
- name: Set architecture alias
set_fact:
architecture_alias: "amd64" # noqa: var-naming[no-role-prefix]
when: ansible_architecture == "x86_64"
- name: Set architecture alias
set_fact:
architecture_alias: "arm64" # noqa: var-naming[no-role-prefix]
when: ansible_architecture == "aarch64"
- name: "Download node_exporter from GitHub (v{{ node_exporter_version.tag }})"
get_url:
url: "https://github.com/prometheus/node_exporter/releases/download/\
v{{ node_exporter_version.tag }}/node_exporter-{{ node_exporter_version.tag }}\
.linux-{{ deb_architecture }}.tar.gz"
.linux-{{ architecture_alias }}.tar.gz"
dest: "/var/tmp/node_exporter.tar.gz"
mode: "0644"
register: node_exporter_download_archive
until: node_exporter_download_archive is succeeded
retries: 3
@@ -52,7 +63,7 @@
extra_opts:
- --strip-components=1
include:
- "node_exporter-{{ node_exporter_version.tag }}.linux-{{ deb_architecture }}/node_exporter"
- "node_exporter-{{ node_exporter_version.tag }}.linux-{{ architecture_alias }}/node_exporter"
notify: Restart node_exporter
- name: Copy node_exporter systemd service