tripleo-ansible/tripleo_ansible/roles/tripleo_cephadm/tasks/dashboard/configure_dashboard_backend...

38 lines
1.3 KiB
YAML

---
# Copyright 2021 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Get the current mgr
command: |
{{ container_cli }} ps -a -f 'name=ceph-?(.*)-mgr.*' --format \{\{\.Names\}\}
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.', '') }}"
when: tripleo_cephadm_verbose
- 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 \
{{ hostvars[dashboard_backend][tripleo_ceph_dashboard_net] }}
become: true
changed_when: false
vars:
tripleo_ceph_dashboard_net: "{{ service_net_map['ceph_dashboard_network'] + '_ip' }}"