Compute dashboard_frontend_vip according to the haproxy frontend

When Ceph dashboard is deployed, the mgr plugin is enabled on the
storage network, and, assuming that network is the value assigned
to 'CephDashboardNetwork', we need to change the way the frontend
vip is computed both in the standard scenario and when composable
networks are provided via tht.
The purpose of this change is to have a set of tasks to properly
compute the 'dashboard_frontend_vip' variable using the hieradata
generated for each service.
When StorageNetwork is present, 'ceph_dashboard_vip' will be set
and assigned to the haproxy frontend (because that's the network
used to expose and access the dashboard components), but when the
'ceph_dashboard_vip' ansible variable is not present, we can rely
(as assumed before) on ctlplane network.
This change is required to fix the tls-everywhere integration and
it is still valid for standard deployments.

Change-Id: Ie25aec842ed344a7bb313f51bb25eb51203dd72f
This commit is contained in:
Francesco Pantano 2020-09-29 15:33:40 +02:00
parent 42737784bc
commit 469623fdc6
No known key found for this signature in database
GPG Key ID: 799868C47301D458
1 changed files with 20 additions and 0 deletions

View File

@ -43,6 +43,26 @@
set_fact:
tripleo_enabled_services: "{{ enabled_services | default([]) }}"
- name: set dashboard_vip variable if dashboard is enabled
block:
- name: get the frontend_dashboard_vip from the overcloud vars
command: "hiera -c /etc/puppet/hiera.yaml ceph_dashboard_vip"
register: frontend_vip
become: true
delegate_to: "{{ groups['mgrs'][0] }}"
- name: set dashboard_frontend variable
set_fact:
ceph_ansible_group_vars_all: "{{ ceph_ansible_group_vars_all | combine({ 'dashboard_frontend_vip': dashboard_vip | default() }) }}"
vars:
dashboard_vip: |-
{% set dashboard_vip = control_virtual_ip %}
{% if frontend_vip.stdout != "nil" %}
{% set dashboard_vip = frontend_vip.stdout %}
{% endif %}
{{ dashboard_vip }}
when:
- tripleo_enabled_services | intersect(['ceph_grafana'])
- name: build the openstack pool list
import_tasks: build_pools.yml
vars: