--- - hosts: kd.b8.nz roles: - role: prom tags: a prometheus_targets: node: - targets: - "{{ ansible_fqdn }}:9100" prometheus_scrape_configs: - job_name: "prometheus" metrics_path: "{{ prometheus_metrics_path }}" static_configs: - targets: - "{{ ansible_fqdn }}:9090" - job_name: "node" basic_auth: username: prom password_file: /etc/prometheus-pass #scheme: "https" file_sd_configs: - files: - "{{ prometheus_config_dir }}/file_sd/node.yml" # added because of warning in log prometheus_alertmanager_config: - static_configs: - targets: - "{{ ansible_fqdn }}:9093" - role: node-exporter tags: a # node_exporter_tls_server_config: # cert_file: /etc/node_exporter/fullchain.pem # key_file: /etc/node_exporter/privkey.pem node_exporter_web_listen_address: "127.0.1.1:9100" node_exporter_basic_auth_users: prom: incarnadine.bloodied.maker - role: alertmanager alertmanager_smtp: smarthost: 'mx.iankelling.org:587' from: "alerts@iankelling.org" require_tls: false hello: 'defaultnn.b8.nz' alertmanager_route: receiver: defaultreceiver repeat_interval: 7d alertmanager_receivers: - name: defaultreceiver email_configs: - to: alerts@iankelling.org send_resolved: true # the html was a bit ugly and just a huge waste of text, # https://github.com/prometheus/alertmanager/issues/2232 # lead me to find a convenient text option to use html: text: '{% raw -%}{{ template "opsgenie.default.description" . }}{% endraw -%}' alertmanager_web_listen_address: '127.0.1.1:9093' - role: grafana grafana_address: "127.0.1.1" # iank: playbook will halt if no password is set. this is only # available to localhost, so i dont really care, but might as well # generate a pass isntead of putting in pw123 etc. grafana_security: { admin_user: admin, admin_password: spheroid.recantation.shank } grafana_datasources: - name: prometheus type: prometheus access: proxy url: 'http://{{ prometheus_web_listen_address }}' basicAuth: false isDefault: true # This is based on looking at highly downloaded dashboards here # https://grafana.com/dashboards?dataSource=prometheus&collector=nodeExporter # Which is where you are lead to from # https://prometheus.io/docs/visualization/grafana/ grafana_dashboards: - dashboard_id: 1860 revision_id: 21 datasource: prometheus - dashboard_id: 405 revision_id: 8 datasource: prometheus