prometheus/server/tasks/main.yaml
changeset 52 5a5071d4eaad
parent 8 20975062661d
child 53 9e4f750f5d36
equal deleted inserted replaced
51:19fa7aa47bf1 52:5a5071d4eaad
    19     dest: "/etc/prometheus/prometheus.yml"
    19     dest: "/etc/prometheus/prometheus.yml"
    20   notify:
    20   notify:
    21     - restart prometheus service
    21     - restart prometheus service
    22     - restart grafana service
    22     - restart grafana service
    23 
    23 
    24 # /etc/grafana/grafana.ini
    24 - name: install grafana prometheus data source
       
    25   become: yes
       
    26   grafana_datasource:
       
    27     name: "Prometheus"
       
    28     ds_type: "prometheus"
       
    29     ds_url: "http://localhost:9090"
       
    30     grafana_url: "http://localhost:3000"
       
    31     is_default: yes
       
    32 
       
    33 - name: install grafana plugins
       
    34   become: yes
       
    35   grafana_plugin: name="{{item}}"
       
    36   loop: "{{prometheus_server_grafana_plugins}}"
       
    37 
       
    38 - name: copy dashboards to target
       
    39   become: yes
       
    40   copy:
       
    41     src: "{{prometheus_server_grafana_dashboard_src}}/{{item}}"
       
    42     dest: "/tmp/"
       
    43     mode: "0640"
       
    44   loop: "{{prometheus_server_grafana_dashboards}}"
       
    45 
       
    46 - name: install grafana dashboards
       
    47   become: yes
       
    48   grafana_dashboard:
       
    49     grafana_url: "http://localhost:3000"
       
    50     path: "/tmp/{{item}}"
       
    51   loop: "{{prometheus_server_grafana_dashboards}}"