prometheus/client/tasks/main.yaml
changeset 6 3b1f18f6a5a4
parent 5 4f014cdac0b1
child 15 6d7db9bae6c2
equal deleted inserted replaced
5:4f014cdac0b1 6:3b1f18f6a5a4
     1 ---
     1 ---
     2 
     2 
     3 - name: install prometheus node exporter
     3 - name: install prometheus node exporter
     4   become: yes
     4   become: yes
     5   apt: name="{{prometheus_client_apt_packages}}"
     5   apt: name="prometheus-node-exporter"
     6 
     6 
     7 - name: add prometheus user to video group for GPU stats
     7 #   # Nginx
     8   become: yes
     8 # - name: check if running nginx
     9   user: name="prometheus" groups="video" append="yes"
     9 #   stat: path="/etc/nginx/"
       
    10 #   register: stat_nginx_conf
    10 
    11 
    11 - name: install prometheus rpi exporter
    12 # - name: install prometheus-nginx-exporter
    12   unarchive:
    13 #   become: yes
    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"
    14 #   apt: name="prometheus-nginx-exporter"
    14     remote_src: yes
    15 #   when: stat_nginx_conf.stat.exists
    15     dest: "/tmp/"
       
    16 
    16 
    17 - name: install systemd service for rpi exporter
    17 #   # PostgreSQL
    18   become: yes
    18 # - name: check if running postgresql
    19   copy:
    19 #   stat: path="/etc/postgresql/"
    20     src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter.service"
    20 #   register: stat_postgresql_conf
    21     remote_src: yes
       
    22     dest: "/lib/systemd/system/rpi_exporter.service"
       
    23 
    21 
    24 - name: install rpi exporter binary
    22 # - name: install prometheus-postgresql-exporter
    25   become: yes
    23 #   become: yes
    26   copy:
    24 #   apt: name="prometheus-postgres-exporter"
    27     src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter"
    25 #   when: stat_postgresql_conf.stat.exists
    28     remote_src: yes
       
    29     dest: "/usr/local/bin/rpi_exporter"
       
    30     mode: "0755"
       
    31 
       
    32 - name: ensure systemd services are started
       
    33   become: yes
       
    34   systemd: name="rpi_exporter.service" enabled="yes" state="started"