Compute VIPs using net_vip_map instead of hiera

This change provides two improvements:
1. VIPs are computed using the existing net_vip_map instead of running
   hiera commands;
2. the monitoring_stack_vip (on the storage network) is provided for
   both prometheus and alertmanager: these two services are not exposed
   but we need the ceph_mgr being aware about the vip.

Depends-On: I0dbcde302a3abdfccc3dd996b1c238e25064dd12

[1] https://review.opendev.org/c/openstack/puppet-tripleo/+/785574/

Change-Id: I73a2a54afdf9739bd4c08406645809c9b47c3e01
(cherry picked from commit 9c4254c2bc)
This commit is contained in:
Francesco Pantano 2021-04-13 22:53:43 +02:00
parent d88e06950e
commit bfd32e74ee
No known key found for this signature in database
GPG Key ID: 0458D4D1F41BD75C
1 changed files with 14 additions and 11 deletions

View File

@ -45,21 +45,24 @@
- 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() }) }}"
ceph_ansible_group_vars_all: "{{ ceph_ansible_group_vars_all | combine({ 'dashboard_frontend_vip': dashboard_vip | default() })
| combine({ 'prometheus_frontend_vip': monitoring_stack_vip | default()})
| combine({ 'alertmanager_frontend_vip': monitoring_stack_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 }}
{% set dashboard_vip = control_virtual_ip %}
{% if 'StorageDashboard' in enabled_networks %}
{% set dashboard_vip = net_vip_map.get('storage_dashboard') %}
{% endif %}
{{ dashboard_vip }}
monitoring_stack_vip: |-
{% set monitoring_vip = control_virtual_ip %}
{% if 'Storage' in enabled_networks %}
{% set monitoring_vip = net_vip_map.get('storage') %}
{% endif %}
{{ monitoring_vip }}
when:
- tripleo_enabled_services | intersect(['ceph_grafana'])