From c7d3c665df05d96a05c5ca3401e4bef9bd2e0364 Mon Sep 17 00:00:00 2001 From: Salt Date: Fri, 7 Aug 2020 04:47:57 -0500 Subject: [PATCH] Add support for a configuration repo --- inventory/group_vars/9iron.club.yml | 1 + roles/grafana/tasks/main.yml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/inventory/group_vars/9iron.club.yml b/inventory/group_vars/9iron.club.yml index 40fcbb9..95490a3 100644 --- a/inventory/group_vars/9iron.club.yml +++ b/inventory/group_vars/9iron.club.yml @@ -85,6 +85,7 @@ grafana: 33303465616532313339393634386166363162393661393037323835323035386663 url: "monitor.9iron.club" webroot: "/var/www/grafana" + config_repo: "git@git.9iron.club:salt/grafana" # Matrix matrix: server_name: "9iron.club" diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index 304ae70..fa89669 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -39,6 +39,13 @@ dest: "/etc/grafana/grafana.ini" mode: "0640" notify: restart grafana + - name: Clone configuration repo + git: + repo: "{{ grafana.config_repo }}" + dest: "/etc/grafana/provisioning" + force: yes + notify: restart grafana + when: grafana.config_repo is defined - name: Enable Grafana systemd: daemon_reload: yes