Normalize the server_addr dashboard backend

The server_addr dashboard backend should be the same argument used as
instance of the current ceph-mgr container running on a controller node.
Due to a recent change in pacific the container name and the ceph-mgr
instance are not consistent anymore, and the purpose of this patch is to
rework the way this info is retrieved from ceph.

Closes-Bug: #1972729
Change-Id: Ifc9a0a9ac2f13c891ccde826aef2ab7cbdb5d690
This commit is contained in:
Francesco Pantano 2022-05-09 10:27:30 +02:00
parent 5cadc6c6c0
commit 0951120a9f
1 changed files with 3 additions and 3 deletions

View File

@ -16,20 +16,20 @@
- name: Get the current mgr
command: |
{{ container_cli }} ps -a -f 'name=ceph-?(.*)-mgr.*' --format \{\{\.Names\}\}
{{ container_cli }} ps -a -f 'name=ceph-?(.*)-mgr.*' --format \{\{\.Command\}\} --no-trunc
register: ceph_mgr
become: true
delegate_to: "{{ dashboard_backend }}"
- name: Check the resulting mgr container instance
debug:
msg: "{{ ceph_mgr.stdout | regex_replace('^ceph-?(.*)-mgr.', '') }}"
msg: "{{ ceph_mgr.stdout | regex_replace('^-n mgr.(.*)(?P<inst>) -f (.*)+$', '\\1') }}"
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('^ceph-?(.*)-mgr.', '') }}/server_addr \
mgr mgr/dashboard/{{ ceph_mgr.stdout | regex_replace('^-n mgr.(.*)(?P<inst>) -f (.*)+$', '\\1') }}/server_addr \
{{ hostvars[dashboard_backend][tripleo_ceph_dashboard_net] }}
become: true
changed_when: false