prometheus/rpi-client/tasks/main.yaml
changeset 24 c0dde2a4b276
parent 22 adeda2afeb75
child 27 8fddefdd948b
equal deleted inserted replaced
23:b4ad03deace1 24:c0dde2a4b276
     9     src: "{{prometheus_client_rpi_src}}"
     9     src: "{{prometheus_client_rpi_src}}"
    10     remote_src: yes
    10     remote_src: yes
    11     dest: "/tmp/"
    11     dest: "/tmp/"
    12   notify: restart rpi_exporter
    12   notify: restart rpi_exporter
    13 
    13 
       
    14 - name: disable GPU temp scraping
       
    15   become: yes
       
    16   lineinfile:
       
    17     path: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter.service"
       
    18     regexp: "^ExecStart=/usr/local/bin/rpi_exporter"
       
    19     line: "ExecStart=/usr/local/bin/rpi_exporter --no-collector.gpu"
       
    20   when: not prometheus_client_rpi_collect_gpu_temp
       
    21 
    14 - name: install systemd service for rpi-exporter
    22 - name: install systemd service for rpi-exporter
    15   become: yes
    23   become: yes
    16   copy:
    24   copy:
    17     src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter.service"
    25     src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter.service"
    18     remote_src: yes
    26     remote_src: yes
    19     dest: "/lib/systemd/system/rpi_exporter.service"
    27     dest: "/lib/systemd/system/rpi_exporter.service"
    20   notify: restart rpi_exporter
    28   notify: restart rpi_exporter
    21 
       
    22 - name: disable GPU temp scraping
       
    23   become: yes
       
    24   lineinfile:
       
    25     path: "/lib/systemd/system/rpi_exporter.service"
       
    26     regexp: "^ExecStart=/usr/local/bin/rpi_exporter"
       
    27     line: "ExecStart=/usr/local/bin/rpi_exporter --no-collector.gpu"
       
    28   when: not prometheus_client_rpi_collect_gpu_temp
       
    29   notify: restart rpi_exporter
       
    30 
       
    31 
    29 
    32 - name: install rpi-exporter binary
    30 - name: install rpi-exporter binary
    33   become: yes
    31   become: yes
    34   copy:
    32   copy:
    35     src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter"
    33     src: "/tmp/{{prometheus_client_rpi_dest}}/rpi_exporter"