From 41b8c17356fa1273761c3d864f959fbcb11813e7 Mon Sep 17 00:00:00 2001 From: fmount Date: Thu, 31 Oct 2019 10:49:22 +0100 Subject: [PATCH] Set grafana-server user and password in ceph-dashboard role This change adds two tasks to set grafana-api user and password that are required to inject dashboard layouts to the external grafana instance. Without these two parameters the ceph-ansible playbook fails showing an authorization error (HTTPError: 401 Client Error: Unauthorized"). Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1767365 Signed-off-by: fmount --- roles/ceph-dashboard/tasks/configure_dashboard.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/ceph-dashboard/tasks/configure_dashboard.yml b/roles/ceph-dashboard/tasks/configure_dashboard.yml index 7084ced45..f39709701 100644 --- a/roles/ceph-dashboard/tasks/configure_dashboard.yml +++ b/roles/ceph-dashboard/tasks/configure_dashboard.yml @@ -100,6 +100,18 @@ run_once: true changed_when: false +- name: set grafana api user + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-username {{ grafana_admin_user }}" + delegate_to: "{{ groups[mon_group_name][0] }}" + run_once: true + changed_when: false + +- name: set grafana api password + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-password {{ grafana_admin_password }}" + delegate_to: "{{ groups[mon_group_name][0] }}" + run_once: true + changed_when: false + - name: set alertmanager host command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ grafana_server_addr }}:{{ alertmanager_port }}" delegate_to: "{{ groups[mon_group_name][0] }}"