diff --git a/ansible/group_vars/all/grafana b/ansible/group_vars/all/grafana index 6b60f7863..38f37f311 100644 --- a/ansible/group_vars/all/grafana +++ b/ansible/group_vars/all/grafana @@ -4,7 +4,7 @@ # Grafana local admin user name. If you are deploying Monasca Grafana this # should not conflict with an OpenStack user name. -grafana_local_admin_user_name: "admin" +grafana_local_admin_user_name: "grafana_local_admin" # Path to git repo containing Grafana dashboards. Eg. # https://github.com/stackhpc/grafana-reference-dashboards.git @@ -23,7 +23,7 @@ grafana_monitoring_node_dashboard_repo_path: # The Grafana organisation for the control plane. Note that for Monasca # Grafana with domain support the format is: # organisation_name@openstack_domain -grafana_control_plane_organisation: "control_plane" +grafana_control_plane_organisation: "monasca_control_plane@default" # A dict of datasources to configure. See the stackhpc.grafana-conf role # for all supported datasources. Example: diff --git a/ansible/overcloud-grafana-configure.yml b/ansible/overcloud-grafana-configure.yml index 5fd9cddc6..b4794dbfd 100644 --- a/ansible/overcloud-grafana-configure.yml +++ b/ansible/overcloud-grafana-configure.yml @@ -1,12 +1,12 @@ --- -- name: Check whether Grafana is enabled +- name: Check whether Monasca is enabled hosts: overcloud tags: - grafana tasks: - name: Create monitoring group with grafana enabled group_by: - key: "monitoring_with_grafana_enabled_{{ kolla_enable_grafana | bool }}" + key: "monitoring_with_grafana_enabled_{{ kolla_enable_monasca | bool }}" - name: Set the Monasca control plane project ID hosts: monitoring_with_grafana_enabled_True[0] @@ -15,6 +15,20 @@ - grafana vars: venv: "{{ virtualenv_path }}/openstacksdk" + pre_tasks: + - name: Validate OpenStack password authentication parameters + fail: + msg: > + Required OpenStack authentication parameter {{ item }} is + {% if item in openstack_auth %}empty{% else %}not present{% endif %} + in openstack_auth. Have you sourced the environment file? + when: + - openstack_auth_type == 'password' + - item not in openstack_auth or not openstack_auth[item] + with_items: "{{ openstack_auth_password_required_params }}" + tags: + - config-validation + roles: - role: stackhpc.os-openstackclient os_openstackclient_venv: "{{ venv }}" @@ -27,7 +41,7 @@ - name: Look up Monasca control plane project ID shell: > source {{ venv }}/bin/activate && - openstack project show monasca --format json --column id + openstack project show {{ grafana_control_plane_organisation.split("@")[0] }} --format json --column id register: monasca_project_show changed_when: False environment: "{{ openstack_auth_env }}" @@ -61,7 +75,7 @@ - role: stackhpc.grafana-conf grafana_conf_organisation: "{{ grafana_control_plane_organisation }}" grafana_conf_grafana_admin_user: "{{ grafana_local_admin_user_name }}" - grafana_conf_grafana_admin_pass: "{{ grafana_admin_password }}" + grafana_conf_grafana_admin_pass: "{{ monasca_grafana_admin_password }}" grafana_conf_grafana_dashboard_repo: repo: "{{ grafana_monitoring_node_dashboard_repo }}" version: "{{ grafana_monitoring_node_dashboard_repo_version }}" diff --git a/releasenotes/notes/bugfix-monasca-grafana-dashboard-config-b81781cf10c2a236.yaml b/releasenotes/notes/bugfix-monasca-grafana-dashboard-config-b81781cf10c2a236.yaml new file mode 100644 index 000000000..cc0ea9bdd --- /dev/null +++ b/releasenotes/notes/bugfix-monasca-grafana-dashboard-config-b81781cf10c2a236.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue where it was not possible to load dashboards into the + Monasca Grafana fork when the default Monasca control plane OpenStack + project name is used from Kolla Ansible.