prometheus/rpi-client/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 10 Feb 2020 07:49:58 -0600
changeset 7 dc3fca0131a7
parent 6 3b1f18f6a5a4
child 8 20975062661d
permissions -rw-r--r--
Updated some permissions on conf files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: add prometheus user to video group for rpi GPU stats
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  user: name="prometheus" groups="video" append="yes"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
- name: install prometheus rpi exporter
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
  unarchive:
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
    src: "https://github.com/lukasmalkmus/rpi_exporter/releases/download/v{{prometheus_client_rpi_exporter_version}}/rpi_exporter-{{prometheus_client_rpi_exporter_version}}.linux-{{prometheus_client_arch}}.tar.gz"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
    remote_src: yes
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    dest: "/tmp/"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
- name: install systemd service for rpi-exporter
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
  become: yes
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
  copy:
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
    src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter.service"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
    remote_src: yes
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
    dest: "/lib/systemd/system/rpi_exporter.service"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
- name: install rpi-exporter binary
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
  become: yes
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
  copy:
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
    src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
    remote_src: yes
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
    dest: "/usr/local/bin/rpi_exporter"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
    mode: "0755"
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
- name: ensure systemd service is started
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
  become: yes
3b1f18f6a5a4 Updated prometheus roles. WIP psql, nginx exporters.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
  systemd: name="rpi_exporter.service" enabled="yes" state="started"