Files
kayobe/ansible/overcloud-grafana-configure.yml
Mark Goddard 1862e24bb5 Add variables for API VIP address and FQDN
Kayobe currently supports definition of various different networks -
public, internal, tunnel, etc. These typically map to a VLAN or flat
network, with an IP subnet. When a cloud exceeds the size of a single
VLAN/subnet, this approach no longer works.

One way to resolve this is to have multiple subnets that map to a single
logical network, and provide routing between them. This is a similar
concept to neutron's routed networks, but for the control plane.

An issue arising from this is that if different hosts can have different
network definitions for the internal and public networks, it is no
longer trivial to use a network attribute [1] to specify the VIP address
and FQDN. Furthermore, the play that generates Kolla Ansible's
globals.yml containing the VIP and FQDN variables runs as localhost,
which does not necessarily have the internal and public networks
defined.

To resolve this, we add global variables for the VIPs and FQDNs. The
default values are as before, except in the case where HAProxy is
disabled, which we no longer provide a useful default for. That
configuration is very rarely used in practice, and the need to reference
the IP address of a host in the network group makes it difficult to
define safely.

[1] https://docs.openstack.org/kayobe/latest/configuration/reference/network.html#global-network-configuration

Story: 2008180
Task: 40937

Change-Id: I2c428ffc2b285aee03d8f59ae7cd3fb7230ce4ae
2020-10-05 19:59:53 +00:00

76 lines
2.9 KiB
YAML

---
- 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_monasca | bool }}"
- name: Set the Monasca control plane project ID
hosts: monitoring_with_grafana_enabled_True[0]
gather_facts: False
tags:
- 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 }}"
os_openstackclient_install_epel: "{{ dnf_install_epel }}"
os_openstackclient_state: latest
os_openstackclient_upper_constraints_file: "{{ pip_upper_constraints_file }}"
when: kolla_enable_monasca | bool
tasks:
- name: Look up Monasca control plane project ID
shell: >
source {{ venv }}/bin/activate &&
openstack project show {{ monasca_control_plane_project }} --format json --column id
register: monasca_project_show
changed_when: False
environment: "{{ openstack_auth_env }}"
when: kolla_enable_monasca | bool
- name: Set Monasca control plane ID
set_fact:
monasca_control_plane_project_id: "{{ (monasca_project_show.stdout | from_json).get('id') }}"
when: kolla_enable_monasca | bool
- name: Configure control plane monitoring for Grafana
# Only required to run on a single host.
hosts: monitoring_with_grafana_enabled_True[0]
gather_facts: False
tags:
- grafana
pre_tasks:
- name: Include Kolla passwords for Grafana local admin account credentials
include_vars: "{{ kayobe_config_path }}/kolla/passwords.yml"
roles:
- 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: "{{ monasca_grafana_admin_password }}"
grafana_conf_grafana_dashboard_repo:
repo: "{{ grafana_monitoring_node_dashboard_repo }}"
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 }}:{{ monasca_grafana_server_port }}"
grafana_conf_grafana_datasources: "{{ grafana_datasources }}"