Set current ceph dashboard mgr backend fact

Due to a potential issue related to regex_replace combinated to an
ansible varialble value rendering, it's recommended setting the
fact and simplify the Ceph command that is supposed to set the backend.

Change-Id: I56d8862522fe82cb9f2373574ee067fbe4cae98d
This commit is contained in:
Francesco Pantano 2022-06-08 12:38:51 +02:00
parent fce91ae356
commit a2200b6eea

View File

@ -21,17 +21,20 @@
become: true
delegate_to: "{{ dashboard_backend }}"
- name: Check the resulting mgr container instance
set_fact:
current_mgr: "{{ ceph_mgr.stdout | regex_replace('^-n mgr.(.*)(?P<inst>) -f (.*)+$', '\\1') }}"
- name: Check the resulting mgr container instance
debug:
msg: "{{ ceph_mgr.stdout | regex_replace('^-n mgr.(.*)(?P<inst>) -f (.*)+$', '\\1') }}"
msg: "{{ current_mgr }}"
when: tripleo_cephadm_verbose | bool
- name: config the current dashboard backend
command: |
{{ tripleo_cephadm_ceph_cli }} config set \
mgr mgr/dashboard/{{ ceph_mgr.stdout | regex_replace('^-n mgr.(.*)(?P<inst>) -f (.*)+$', '\\1') }}/server_addr \
mgr mgr/dashboard/{{ current_mgr }}/server_addr \
{{ hostvars[dashboard_backend][tripleo_ceph_dashboard_net] }}
become: true
changed_when: false
vars:
tripleo_ceph_dashboard_net: "{{ service_net_map['ceph_grafana_network'] + '_ip' }}"