diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-09-24 15:05:48 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-09-24 15:05:48 +0200 |
commit | 9a47d5c3ef94cb09338a1b64d4dc9365d526bb54 (patch) | |
tree | 86164b8dc69beb65a1e60ca70c4f52a08548b5e7 /roles/monitoring/prometheus/exporter/node/tasks/main.yml | |
parent | fix some todos (diff) |
refactor textfile collector script handling
Diffstat (limited to 'roles/monitoring/prometheus/exporter/node/tasks/main.yml')
-rw-r--r-- | roles/monitoring/prometheus/exporter/node/tasks/main.yml | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/roles/monitoring/prometheus/exporter/node/tasks/main.yml b/roles/monitoring/prometheus/exporter/node/tasks/main.yml index 61e385f7..56903a33 100644 --- a/roles/monitoring/prometheus/exporter/node/tasks/main.yml +++ b/roles/monitoring/prometheus/exporter/node/tasks/main.yml @@ -2,7 +2,9 @@ ## TODO: pin version - name: install apt packages apt: - name: prom-exporter-node + name: + - prom-exporter-node + - moreutils state: present - name: create directory for textfile collector @@ -34,27 +36,9 @@ - name: create directory for textfile collector scripts file: - path: /usr/local/lib/prometheus-node-exporter + path: /usr/local/share/prometheus-node-exporter state: directory -- name: install textfile collector script wrapper - copy: - content: | - #!/bin/bash - - if [ -z "$1" ]; then - echo "Please specify which collector script to call!" - exit 1 - fi - collector="$1" - - set -e - rm -f "/var/lib/prometheus-node-exporter/textfile-collector/$collector.prom".* - "/usr/local/lib/prometheus-node-exporter/$collector" > "/var/lib/prometheus-node-exporter/textfile-collector/$collector.prom.$$" - mv "/var/lib/prometheus-node-exporter/textfile-collector/$collector.prom.$$" "/var/lib/prometheus-node-exporter/textfile-collector/$collector.prom" - dest: /usr/local/lib/prometheus-node-exporter/run-collector - mode: 0755 - - name: install the apt textfile collector script when: ansible_pkg_mgr == "apt" vars: |