Add grafana datasource provisioning and update workflow docs
- Configure grafana to use provisioned datasources instead of UI config - Add prometheus datasource template managed by ansible - Create minimal grafana.ini with custom provisioning path - Move ansible_managed to group_vars (fixes deprecation warning) - Add Remote Hosts and Git Workflow sections to CLAUDE.md - Document feature branch workflow with tea CLI for PRs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
fb5d6314e8
commit
4283f2237d
6 changed files with 84 additions and 1 deletions
2
ansible/group_vars/all.yml
Normal file
2
ansible/group_vars/all.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
ansible_managed: "Managed by ansible - do not edit. Source: ssh://forgejo@forge.tail8d86e.ts.net/eblume/blumeops.git"
|
||||
|
|
@ -4,6 +4,30 @@
|
|||
name: grafana
|
||||
state: present
|
||||
|
||||
- name: Create grafana provisioning directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop:
|
||||
- /opt/homebrew/etc/grafana/provisioning
|
||||
- /opt/homebrew/etc/grafana/provisioning/datasources
|
||||
- /opt/homebrew/etc/grafana/provisioning/dashboards
|
||||
|
||||
- name: Configure grafana.ini
|
||||
ansible.builtin.template:
|
||||
src: grafana.ini.j2
|
||||
dest: /opt/homebrew/etc/grafana/grafana.ini
|
||||
mode: '0644'
|
||||
notify: restart grafana
|
||||
|
||||
- name: Deploy grafana datasources config
|
||||
ansible.builtin.template:
|
||||
src: datasources.yaml.j2
|
||||
dest: /opt/homebrew/etc/grafana/provisioning/datasources/datasources.yaml
|
||||
mode: '0644'
|
||||
notify: restart grafana
|
||||
|
||||
- name: Ensure grafana service is started
|
||||
ansible.builtin.command: brew services start grafana
|
||||
register: brew_start
|
||||
|
|
|
|||
12
ansible/roles/grafana/templates/datasources.yaml.j2
Normal file
12
ansible/roles/grafana/templates/datasources.yaml.j2
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# {{ ansible_managed }}
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
orgId: 1
|
||||
uid: prometheus
|
||||
url: http://localhost:9090
|
||||
isDefault: true
|
||||
editable: false
|
||||
7
ansible/roles/grafana/templates/grafana.ini.j2
Normal file
7
ansible/roles/grafana/templates/grafana.ini.j2
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# {{ ansible_managed }}
|
||||
#
|
||||
# Minimal grafana config - only non-default values.
|
||||
# See /opt/homebrew/opt/grafana/share/grafana/conf/defaults.ini for all options.
|
||||
|
||||
[paths]
|
||||
provisioning = /opt/homebrew/etc/grafana/provisioning
|
||||
Loading…
Add table
Add a link
Reference in a new issue