Install Grafana after deploying configs

This solves an issue with cloning to a nonempty directory
This commit is contained in:
Salt 2020-08-07 05:05:59 -05:00
parent c7d3c665df
commit 10fdd3453e

View File

@ -19,20 +19,15 @@
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 - name: Configure Grafana
block: block:
- name: Create configuration directories
file:
path: "{{ item }}"
state: directory
loop:
- /etc/grafana
- /etc/grafana/provisioning
- name: Template out main config - name: Template out main config
template: template:
src: "grafana.ini" src: "grafana.ini"
@ -46,6 +41,18 @@
force: yes force: yes
notify: restart grafana notify: restart grafana
when: grafana.config_repo is defined when: grafana.config_repo is defined
- 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: Enable Grafana - name: Enable Grafana
systemd: systemd:
daemon_reload: yes daemon_reload: yes