summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/node/tasks/textfile_collector_sensors.yml
blob: 966c6d7fa87dd9b16b37981b595b47872b22af32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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