From 5180f48c3b340843166b1ff491bb05053adac271 Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Tue, 29 Sep 2020 15:33:40 +0200 Subject: [PATCH] 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 (cherry picked from commit 469623fdc6a323a3543161cb488bb8cf62b137db) --- .../tripleo_ceph_work_dir/tasks/prepare.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/prepare.yml b/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/prepare.yml index d2ca94c7d..9ef421420 100644 --- a/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/prepare.yml +++ b/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/prepare.yml @@ -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: