summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/node/tasks/main.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-03-22 18:49:38 +0100
committerChristian Pointner <equinox@spreadspace.org>2022-03-22 18:49:38 +0100
commit72bb0c5655fefc13d59323334da30a570929478a (patch)
tree94d12f4147a3bae5f8209e37d0e35df61fb4271c /roles/monitoring/prometheus/exporter/node/tasks/main.yml
parentprometheus: minor fixes and improvements (diff)
monitoring/prometheus: pinning packages
Diffstat (limited to 'roles/monitoring/prometheus/exporter/node/tasks/main.yml')
-rw-r--r--roles/monitoring/prometheus/exporter/node/tasks/main.yml19
1 files changed, 17 insertions, 2 deletions
diff --git a/roles/monitoring/prometheus/exporter/node/tasks/main.yml b/roles/monitoring/prometheus/exporter/node/tasks/main.yml
index 27bf3a4d..7860212b 100644
--- a/roles/monitoring/prometheus/exporter/node/tasks/main.yml
+++ b/roles/monitoring/prometheus/exporter/node/tasks/main.yml
@@ -1,11 +1,26 @@
---
- ## TODO: pin version
+- name: generate apt pin file for exporter-node package
+ when: prometheus_exporter_node_version is defined
+ copy:
+ dest: "/etc/apt/preferences.d/prom-exporter-node.pref"
+ content: |
+ Package: prom-exporter-node
+ Pin: version {{ prometheus_exporter_node_version }}-1
+ Pin-Priority: 1001
+
+- name: remove apt pin file for exporter-node package
+ when: prometheus_exporter_node_version is not defined
+ file:
+ path: "/etc/apt/preferences.d/prom-exporter-node.pref"
+ state: absent
+
- name: install apt packages
apt:
name:
- - prom-exporter-node
+ - "prom-exporter-node{% if prometheus_exporter_node_version is defined %}={{ prometheus_exporter_node_version }}-1{% endif %}"
- moreutils
state: present
+ allow_downgrade: yes
- name: create directory for textfile collector
file: