-
Notifications
You must be signed in to change notification settings - Fork 22
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
grafana role improvements? #32
Comments
Not really - you need to specify that. I didn't want to specify a default one. Not sure how this should be documented in a user friendly manner. |
hmm.. when I tried it it was putting settings in the wrong place in the file. I re-wrote part of it to do a few things.. use ini_file because it handles ini_files correctly. use openssl to generate a random secret_key and only set it once etc... |
If you randomize the secret key reprovisioning will invalidate stuff in your browser - I'd prefer to keep it valid. ini_file: never heard, I am not the greatest Ansible expert. Looking forward to PR on that! |
it randomizes it just once, by touching a file that allows ansible to skip it next time. |
Not just reprovision-Grafana, but reprovision-from-scratch use case. |
reprovision from scratch? I'm unsure what you mean. It doesn't sound possible without writing an equivalent un-provision script to remove packages, revert system config files, etc.. |
From a base Raspbian image. |
I mean, install everything from scratch. |
looks like the secret_key is used for signing cookies: https://github.com/grafana/grafana/blob/6af62abd41c4f2b752772a9b816d4c68b734ef28/docs/sources/installation/configuration.md#secret_key So my changes would re-generate the secret key on the first (or next) pass through the grafana role, invalidating 'keep me signed in' and 'remember me' cookies that happen to already exist. Subsequent runs would skip the generation due to the touch file. It doesn't appear to have anything to do with saving dashboards or user's passwords. I was even able to stay logged in through a regeneration of the secret key, it didn't effect my current session. I suppose I could actually write out the generated secret to the "touch" file. That would make the setting persistent in the case of a wiped config file. The design choices of the automation depend on the use cases. Since I just installed for the first time, perhaps I don't understand all the use cases. The more rigid way to design this role, would be to generate the grafana config file from a template, then we could guarantee the state of it. However, that would increase the maintenance cost of the role and limit the customization a user could do outside of ansible. I guess we should ask ourselves, is the idea of this automation to fully manage the server and provide a rigid platform that we're trying to make reliable and upgradeable or are we providing a quick start launching point to get a server up and running and then the user is supposed to start managing it themselves? Cheers :-) |
I think we can eat & save the cake: if I created this project with "immutable server" in mind: there should be nothing valuable on the SD card - if it corrupts I can reprovision a fresh image and be good to go. And don't need to hassle with manual upgrades. Another, more distant goal is to possibly use this as a way to create a distributable SD card image with a documented and sort of repeatable (subject to upgraded dependencies) provisioning process, so that I could point to these scripts when people ask what is on the image and how it was created. |
The grafana_secret being override-able makes sense to me. I'll take a stab at that later and resubmit a cleaner PR. Hmm, An immutable root partition would be neat, but would need careful design. It would either exclude certain features or require a writable partition somewhere (thumb drive?) for influxdb data or perhaps other things. I like the idea of distributing a pre-built image too. this would make it much easier for people to deploy a signalk pi in a reproducible way. the thumb drive could contain config files and data files (anything unique to a particular installation,) and allow the core software and device to be more of a black box. It's basically a release technique that other commercial products use for firmware. Just have to find a way to pay for the bandwidth of providing hundred MB downloads available to the public. Perhaps using OSTree to distribute atomic updates to the system maps well to this project? |
The text was updated successfully, but these errors were encountered: