Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Use 'provisioning' capability when possible #69

Merged

Conversation

rockandska
Copy link
Contributor

Use 'provisioning' capability when possible
Update datasource via API if already exist
Fix privileges escalation for datasources provisioning
Check that grafana_security.admin_user is set and not empty
Check that grafana_security.admin_password is set

Fix #68

Provisioning is active by default and is used only for datasources for now
Provisioning is force to be disable if grafana_version < 5.0
Assuming that grafana is >= 5.0 if grafana_version=latest
Let the user the ability to disable provisioning capability if needed

Maybe it will be a good idea to had a new molecule test too to test a previous version who don't provide "provisioning capability ? (like 4.6.0)

Update datasource via API if already exist
Fix privileges escalation for datasources provisioning
Check that grafana_security.admin_user is set and not empty
Check that grafana_security.admin_password is set
@@ -21,6 +21,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults

| Name | Default Value | Description |
| -------------- | ------------- | -----------------------------------|
| `grafana_use_provisioning` | true | Use Grafana provisioning capalibity when possible (**grafana_version=latest will assume >= 5.0**) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should keep it as something user-defined, especially when there is also logic which overwrites this behavior for grafana < 5.0. Maybe it would be better to just rely on autodetection and force usage of provisioning system for grafana >= 5.0 and API for grafana < 5.0? This would also lead to simpler role.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is 3 reasons for why i choose to let the user the possibility to force to not use the provisioning capability if he want to.

  • I plan to add the possibility to change the repository used for apt/yum like it was in a previous PR, because in company context, you can't always relay on WAN and have sometimes to change the repo for a mirror where you don't always have the latest release. So using "grafana_version=latest" don't always imply that the latest release would be a one with "provisioning" capability. So how someone in this context could use this role if we assume that "latest" would be always > 5.0 ?
  • The API seems stable, provisioning is pretty new feature and maybe will have breaking changes. So for whatever reason, if something is wrong with the provisioning capability, the user could fallback to the old way with API
  • Changes made to provisioning capability features require to restart Grafana, I assume that it could be problematic in some use case to having Grafana restart when changes occur. The API let the admin do some updates without having for some reason see the Grafana instance not restarting because there was a mistake in the configuration.

For the simpler role, i'm not sure it will be simpler to not having this possibility cause supporting Grafana < 5.0 will always require to test the version to see if we could use provisioning or not for a task and would be finally the same as what it is done in this PR 😄

Regards,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, thanks for extensive explanation 👍

@paulfantom paulfantom merged commit b9bc107 into cloudalchemy:master Jul 7, 2018
@lock
Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants