Skip to content

grafana: Fixes to foldersFromFilesStructure option #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

root-expert
Copy link
Contributor

This PR includes some additional fixes for the foldersFromFilesStructure introduced in #326 which was incomplete.

  1. It correctly handles creating folders from the file structures under {{ grafana_dashboards_dir }} while
  2. Registers the created and present dashboards folders and adds a task to remove the folders that should not be present if grafana_provisioning_synced is enabled
  3. Fixes folders permissions to be 0755 and files permissions to be 0644 by using u=rwX,g=rX,o=rX

Given a {{ grafana_dashboards_dir }} directory structure of:

├── dash1.json
├── dash2.json
└── folder
    └── dash3.json

the role will create this exact structure under /var/lib/grafana/dashboards.

@voidquark
Copy link
Collaborator

I can also see that this could cause issues, as __dashboards_copied is being overwritten between two tasks.
In my opinion, this needs to be properly tested for edge cases, since users can provision dashboards both via Grafana.net and from a folder on the deployer machine.

@root-expert root-expert force-pushed the fixes-graafana-dashboards branch from 8a893b6 to f40d3e1 Compare June 3, 2025 13:50
@ishanjainn
Copy link
Collaborator

@root-expert Could you resolve conflicts, Should be good to merge post that right @voidquark ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants