summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_sensors.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_sensors.yml')
-rw-r--r--roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_sensors.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_sensors.yml b/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_sensors.yml
new file mode 100644
index 00000000..966c6d7f
--- /dev/null
+++ b/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_sensors.yml
@@ -0,0 +1,32 @@
+---
+- name: install lua and libs needed by sensors script
+ apt:
+ name:
+ - lua5.1
+ - lua-cjson
+ - lua-posix
+ state: present
+
+- name: create lua 5.1 module path in /usr/local
+ file:
+ path: /usr/local/share/lua/5.1
+ state: directory
+
+- name: install sensors module
+ copy:
+ src: "{{ global_files_dir }}/common/openwrt/sensors.module_lua"
+ dest: /usr/local/share/lua/5.1/sensors.lua
+
+- name: create configure directory
+ file:
+ path: /etc/prometheus/exporter/node
+ state: directory
+
+- name: generate senors config
+ copy:
+ content: "{{ prometheus_exporter_node_textfile_collector__sensors | to_nice_json }}\n"
+ dest: /etc/prometheus/exporter/node/sensors.json
+ notify: remove sensors state file
+
+- name: install the sensors textfile collector script
+ include_tasks: textfile_collector_generic.yml