...
 
Commits (2)
......@@ -5,5 +5,13 @@
# then run the `bootstrap-hetzner-debian.yml` playbook to perform the base
# configuration of the new machine.
[hetzner]
test01.heaven.michik.net
monitoring.c3heaven.de
sso.c3heaven.de
# Monitoring host
#
# These are the hosts where Prometheus is running to collect and store
# metrics and where they are rendered into nice graphs on the web using
# Grafana
#[monitoring]
#monitoring.c3heaven.de
# 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 %}