diff options
| author | Alex Welsh <alex@stackhpc.com> | 2026-09-02 09:22:39 +0100 |
|---|---|---|
| committer | Bartosz Bezak <bartosz@stackhpc.com> | 2026-09-03 07:41:03 +0000 |
| commit | 0848902bef126de880448977307fe7d6bcc9a5d4 (patch) | |
| tree | 39c366f63b9db072dee6e8280ed7c028eec8757c | |
| parent | 2a76a1f0b98de0ed035224f6cdd02edee99d2dfc (diff) | |
| download | kolla-ansible-0848902bef126de880448977307fe7d6bcc9a5d4.tar.gz kolla-ansible-0848902bef126de880448977307fe7d6bcc9a5d4.zip | |
Remove Disable Getting Started panel Grafana tasks
Since Grafana 13.2, the api/user/helpflags/1 endpoint has been removed
[1]. This means the "Disable Getting Started panel" deployment task
fails with 404 when a custom home dashboard is added.
The best alternative I can find is to set default_home_dashboard_path in
grafana.ini, which disables the panel anyway [2]
[1] https://github.com/grafana/grafana/pull/124916
[2] https://github.com/grafana/grafana/pull/28750
Change-Id: I78b8657b6ca94d81e3becbba9d5a476d9427658f
Signed-off-by: Alex Welsh <alex@stackhpc.com>
Closes-Bug: #2166048
(cherry picked from commit c8e7b85b2707f762b2560ad8bed9d107a30ff521)
5 files changed, 18 insertions, 17 deletions
diff --git a/ansible/roles/grafana/defaults/main.yml b/ansible/roles/grafana/defaults/main.yml index e7aac005a..402519d78 100644 --- a/ansible/roles/grafana/defaults/main.yml +++ b/ansible/roles/grafana/defaults/main.yml @@ -122,6 +122,11 @@ grafana_start_first_node_retries: 12 grafana_remove_old_volume: true +grafana_custom_home_dashboard: >- + {{ 'grafana_home_dashboard.json' in + check_extra_conf_grafana.files | default([], true) | + map(attribute='path') | map('basename') }} + ############ # Prometheus ############ diff --git a/ansible/roles/grafana/tasks/post_config.yml b/ansible/roles/grafana/tasks/post_config.yml index e90a2ab47..949ef31f6 100644 --- a/ansible/roles/grafana/tasks/post_config.yml +++ b/ansible/roles/grafana/tasks/post_config.yml @@ -41,20 +41,3 @@ failed_when: response.status not in [200, 409] or response.status == 409 and ("name already exists" not in response.json.message | default("")) with_dict: "{{ grafana_data_sources }}" when: item.value.enabled | bool - -- name: Disable Getting Started panel - become: true - kolla_toolbox: - container_engine: "{{ kolla_container_engine }}" - module_name: uri - module_args: - url: "{{ grafana_internal_endpoint }}/api/user/helpflags/1" - method: PUT - user: "{{ grafana_admin_username }}" - password: "{{ grafana_admin_password }}" - force_basic_auth: true - status_code: 200 - register: grafana_response - changed_when: grafana_response.status == 200 - run_once: true - when: "'grafana_home_dashboard.json' in check_extra_conf_grafana.files | map(attribute='path') | map('basename')" diff --git a/ansible/roles/grafana/templates/grafana.ini.j2 b/ansible/roles/grafana/templates/grafana.ini.j2 index 763915796..4aae4caa5 100644 --- a/ansible/roles/grafana/templates/grafana.ini.j2 +++ b/ansible/roles/grafana/templates/grafana.ini.j2 @@ -41,3 +41,8 @@ enabled = true config_file = /etc/grafana/ldap.toml allow_sign_up = true {% endif %} + +{% if grafana_custom_home_dashboard | bool %} +[dashboards] +default_home_dashboard_path = /usr/share/grafana/public/dashboards/home.json +{% endif %} diff --git a/doc/source/reference/logging-and-monitoring/grafana-guide.rst b/doc/source/reference/logging-and-monitoring/grafana-guide.rst index 412ca88e1..8b896d1d8 100644 --- a/doc/source/reference/logging-and-monitoring/grafana-guide.rst +++ b/doc/source/reference/logging-and-monitoring/grafana-guide.rst @@ -90,6 +90,9 @@ sub-folders is also supported when using a custom ``provisioning.yaml`` file. Dashboards will be imported into the Grafana dashboards 'General' folder by default. +To set a custom home dashboard, place the dashboard file in +``{{ node_custom_config }}/grafana/grafana_home_dashboard.json``. + Grafana provisioner config can be altered by placing ``provisioning.yaml`` to ``{{ node_custom_config }}/grafana/`` folder. diff --git a/releasenotes/notes/bug-2166048-9707508fca725bd7.yaml b/releasenotes/notes/bug-2166048-9707508fca725bd7.yaml new file mode 100644 index 000000000..0004097ab --- /dev/null +++ b/releasenotes/notes/bug-2166048-9707508fca725bd7.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes Grafana deployment with custom home dashboard in Grafana 13.2. + `LP#2166048 <https://launchpad.net/bugs/2166048>`__ |
