From 39308a45914cc452362b6f4442785ddc7e0c26c7 Mon Sep 17 00:00:00 2001 From: Isaac Prior Date: Wed, 22 Apr 2020 15:29:01 +0000 Subject: [PATCH] Define default variables for Monasca config Sets 'monasca_install_type: source' to remove need for kolla-ansible var boilerplate. Also use default Monasca parameters to configure Grafana post deploy. Change-Id: I2b6d62104c9c127cb8f6b4f4930dd695cd00da17 Story: 2007597 Task: 39587 --- ansible/group_vars/all/grafana | 2 +- ansible/group_vars/all/monasca | 12 ++++++++++++ ansible/overcloud-grafana-configure.yml | 4 ++-- .../kolla-ansible/templates/globals.yml.j2 | 6 ++++++ etc/kayobe/monasca.yml | 18 ++++++++++++++++++ .../add-monasca-defaults-8486abe37ed3a13b.yaml | 9 +++++++++ 6 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 ansible/group_vars/all/monasca create mode 100644 etc/kayobe/monasca.yml create mode 100644 releasenotes/notes/add-monasca-defaults-8486abe37ed3a13b.yaml diff --git a/ansible/group_vars/all/grafana b/ansible/group_vars/all/grafana index 38f37f311..c9a90b3fb 100644 --- a/ansible/group_vars/all/grafana +++ b/ansible/group_vars/all/grafana @@ -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: "monasca_control_plane@default" +grafana_control_plane_organisation: "{{ monasca_control_plane_project }}@{{ monasca_control_plane_domain }}" # A dict of datasources to configure. See the stackhpc.grafana-conf role # for all supported datasources. Example: diff --git a/ansible/group_vars/all/monasca b/ansible/group_vars/all/monasca new file mode 100644 index 000000000..da061e4af --- /dev/null +++ b/ansible/group_vars/all/monasca @@ -0,0 +1,12 @@ +--- +############################################################################### +# Monasca configuration. + +# Monasca OpenStack Project name. +monasca_control_plane_project: "monasca_control_plane" + +# Monasca OpenStack Domain name. +monasca_control_plane_domain: "default" + +# Monasca Grafana Server port. +monasca_grafana_server_port: "3001" diff --git a/ansible/overcloud-grafana-configure.yml b/ansible/overcloud-grafana-configure.yml index b4794dbfd..d280c3a23 100644 --- a/ansible/overcloud-grafana-configure.yml +++ b/ansible/overcloud-grafana-configure.yml @@ -41,7 +41,7 @@ - name: Look up Monasca control plane project ID shell: > source {{ venv }}/bin/activate && - openstack project show {{ grafana_control_plane_organisation.split("@")[0] }} --format json --column id + openstack project show {{ monasca_control_plane_project }} --format json --column id register: monasca_project_show changed_when: False environment: "{{ openstack_auth_env }}" @@ -81,5 +81,5 @@ version: "{{ grafana_monitoring_node_dashboard_repo_version }}" checkout_path: "{{ grafana_monitoring_node_dashboard_repo_checkout_path }}" relative_path: "{{ grafana_monitoring_node_dashboard_repo_path }}" - grafana_conf_grafana_url: "http://{{ kolla_internal_vip_address }}:3000" + grafana_conf_grafana_url: "http://{{ kolla_internal_vip_address }}:{{ monasca_grafana_server_port }}" grafana_conf_grafana_datasources: "{{ grafana_datasources }}" diff --git a/ansible/roles/kolla-ansible/templates/globals.yml.j2 b/ansible/roles/kolla-ansible/templates/globals.yml.j2 index b7a90ec51..fdc10d367 100644 --- a/ansible/roles/kolla-ansible/templates/globals.yml.j2 +++ b/ansible/roles/kolla-ansible/templates/globals.yml.j2 @@ -531,6 +531,12 @@ ironic_inspector_kernel_cmdline_extras: # The Bifrost deployment image only supports a source installation. bifrost_install_type: source +################################# +# Monasca - Monitoring & Alerting +################################# + +# Monasca doesn't support binary type container builds +monasca_install_type: source ############################################ # Grafana - Data visualisation & Monitoring diff --git a/etc/kayobe/monasca.yml b/etc/kayobe/monasca.yml new file mode 100644 index 000000000..235bc3796 --- /dev/null +++ b/etc/kayobe/monasca.yml @@ -0,0 +1,18 @@ +--- +############################################################################### +# Monasca configuration. + +# Monasca OpenStack Project name. +# The default is "monasca_control_plane". +#monasca_control_plane_project: + +# Monasca OpenStack Domain name. Default is "default". +#monasca_control_plane_domain: + +# Monasca Grafana Server port. Must match kolla-ansible +# var of the same name. Default is "3001". +#monasca_grafana_server_port: + +############################################################################### +# Dummy variable to allow Ansible to accept this file. +workaround_ansible_issue_8743: yes diff --git a/releasenotes/notes/add-monasca-defaults-8486abe37ed3a13b.yaml b/releasenotes/notes/add-monasca-defaults-8486abe37ed3a13b.yaml new file mode 100644 index 000000000..064307a17 --- /dev/null +++ b/releasenotes/notes/add-monasca-defaults-8486abe37ed3a13b.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Provides project and domain default variables for Monasca. + Defaults can be overridden from the Monasca config file etc/kayobe/monasca.yml. +fixes: + - | + Fixes the Monasca install type causing issues pulling container images. See + `story 2007597 `__ for details.