Create and configure Grafana before serving over Apache

This commit is contained in:
Salt 2020-08-07 04:35:04 -05:00
parent 1ef205ff54
commit bb73e21432

View File

@ -19,6 +19,29 @@
priv: "grafana.*:ALL,GRANT" priv: "grafana.*:ALL,GRANT"
login_user: root login_user: root
login_password: "{{ mysql.root_password }}" login_password: "{{ mysql.root_password }}"
- name: Add and configure packages
block:
- name: Add APT signing key
apt_key:
url: "https://packages.grafana.com/gpg.key"
- name: Add APT repo
apt_repository:
repo: "deb https://packages.grafana.com/oss/deb stable main"
- name: Install Grafana
apt:
name:
- grafana
- name: Configure Grafana
template:
src: "grafana.ini"
dest: "/etc/grafana/grafana.ini"
mode: "0640"
- name: Enable Grafana
systemd:
daemon_reload: yes
name: "grafana-server.service"
enabled: yes
state: "started"
- name: Set up Apache - name: Set up Apache
block: block:
- name: Enable modules - name: Enable modules
@ -48,27 +71,4 @@
name: https name: https
vars: vars:
website_url: "{{ grafana.url }}" website_url: "{{ grafana.url }}"
- name: Add and configure packages
block:
- name: Add APT signing key
apt_key:
url: "https://packages.grafana.com/gpg.key"
- name: Add APT repo
apt_repository:
repo: "deb https://packages.grafana.com/oss/deb stable main"
- name: Install Grafana
apt:
name:
- grafana
- name: Configure Grafana
template:
src: "grafana.ini"
dest: "/etc/grafana/grafana.ini"
mode: "0640"
- name: Enable Grafana
systemd:
daemon_reload: yes
name: "grafana-server.service"
enabled: yes
state: "started"
become: yes become: yes