From ccf4e0433eb856005f800acf432aa74f1efb9a42 Mon Sep 17 00:00:00 2001 From: Albert van der Land Date: Thu, 28 Sep 2023 10:32:08 +0200 Subject: [PATCH] feat: disable repos when running offline Signed-off-by: Albert van der Land --- roles/node_exporter/defaults/main.yml | 1 + roles/node_exporter/tasks/selinux.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/roles/node_exporter/defaults/main.yml b/roles/node_exporter/defaults/main.yml index 40af0c934..c59945854 100644 --- a/roles/node_exporter/defaults/main.yml +++ b/roles/node_exporter/defaults/main.yml @@ -5,6 +5,7 @@ node_exporter_binary_url: "https://github.com/{{ _node_exporter_repo }}/releases node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz" node_exporter_checksums_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt" node_exporter_skip_install: false +node_exporter_offline: false node_exporter_web_listen_address: "0.0.0.0:9100" node_exporter_web_telemetry_path: "/metrics" diff --git a/roles/node_exporter/tasks/selinux.yml b/roles/node_exporter/tasks/selinux.yml index 754cbd0a2..875c5b535 100644 --- a/roles/node_exporter/tasks/selinux.yml +++ b/roles/node_exporter/tasks/selinux.yml @@ -5,6 +5,7 @@ if ansible_python_version is version('3', '<') else ['python3-libselinux', 'python3-policycoreutils'] }}" state: present + disablerepo: "{{ '*' if node_exporter_offline else '' }}" register: _install_selinux_packages until: _install_selinux_packages is success retries: 5