Skip to content
Snippets Groups Projects
Commit 7e38ac86 authored by MichiK's avatar MichiK
Browse files

Add initial simple Grafana role

parent 793144f3
No related branches found
No related tags found
No related merge requests found
# Install and configure Prometheus and Grafana for angel system etc.
# monitoring
- name: install and configure Prometheus and Grafana
hosts: monitoring
become: yes
roles:
- grafana
grafana_listen_address: "127.0.0.1"
grafana_public_access: true
- name: restart Grafana
systemd:
name: "grafana-server"
state: restarted
- name: add Grafana key
apt_key:
data: '{{ lookup("file", "grafana.key") }}'
state: present
- name: add Grafana repo
apt_repository:
repo: "deb https://packages.grafana.com/oss/deb stable main"
state: present
update_cache: yes
- name: install Grafana
apt:
package: grafana
state: present
- name: enable Grafana
systemd:
name: "grafana-server"
enabled: yes
- name: configure Grafana
template:
src: "grafana.ini.j2"
dest: "/etc/grafana/grafana.ini"
owner: root
group: grafana
mode: 0640
notify: restart Grafana
# {{ ansible_managed }}
[server]
http_addr = {{ grafana_listen_address }}
{% if grafana_public_access %}
[auth.anonymous]
enabled = true
org_name = Heaven
org_role = Viewer
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment