prometheus/client/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 09 Feb 2020 20:34:46 -0600
changeset 5 4f014cdac0b1
parent 2 2556522a2a45
child 6 3b1f18f6a5a4
permissions -rw-r--r--
Completed prometheus basic roles.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
fd351734f007 Prometheus and WriteFreely roles are work in progress.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
fd351734f007 Prometheus and WriteFreely roles are work in progress.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
fd351734f007 Prometheus and WriteFreely roles are work in progress.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: install prometheus node exporter
5
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
     4
  become: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
     5
  apt: name="{{prometheus_client_apt_packages}}"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
     6
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
     7
- name: add prometheus user to video group for GPU stats
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
     8
  become: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
     9
  user: name="prometheus" groups="video" append="yes"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    10
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    11
- name: install prometheus rpi exporter
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    12
  unarchive:
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    13
    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"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    14
    remote_src: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    15
    dest: "/tmp/"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    16
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    17
- name: install systemd service for rpi exporter
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    18
  become: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    19
  copy:
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    20
    src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter.service"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    21
    remote_src: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    22
    dest: "/lib/systemd/system/rpi_exporter.service"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    23
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    24
- name: install rpi exporter binary
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    25
  become: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    26
  copy:
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    27
    src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    28
    remote_src: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    29
    dest: "/usr/local/bin/rpi_exporter"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    30
    mode: "0755"
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    31
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    32
- name: ensure systemd services are started
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    33
  become: yes
4f014cdac0b1 Completed prometheus basic roles.
Luke Hoersten <luke@hoersten.org>
parents: 2
diff changeset
    34
  systemd: name="rpi_exporter.service" enabled="yes" state="started"