]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Set grafana-server user and password in ceph-dashboard role
authorfmount <fpantano@redhat.com>
Thu, 31 Oct 2019 09:49:22 +0000 (10:49 +0100)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 31 Oct 2019 15:43:54 +0000 (11:43 -0400)
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 <fpantano@redhat.com>
(cherry picked from commit 41b8c17356fa1273761c3d864f959fbcb11813e7)

roles/ceph-dashboard/tasks/configure_dashboard.yml

index 7084ced455234b98a8b733c2d4f8eff1bb63c81c..f39709701511d49a3f764329237326b0dc60d31e 100644 (file)
   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] }}"