--- # 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 ceph_cli ansible.builtin.include_tasks: ceph_cli.yml - name: Show and optionally dump Ceph logs block: - name: Get the ceph orchestrator status ansible.builtin.command: "{{ cifmw_cephadm_ceph_cli }} orch status --format json" register: ceph_orch_status become: true - name: Fail if ceph orchestrator is not available ansible.builtin.fail: msg: | 'ceph orch status' returned {{ ceph_orch_status.stdout | from_json }} when: - not (ceph_orch_status.stdout | from_json).available # create the log directory on ci-framework controller node - name: Create ceph-logs directory delegate_to: localhost when: cifmw_cephadm_log_dump | default(false) ansible.builtin.file: path: "{{ cifmw_cephadm_log_path }}" state: directory mode: "0755" - name: Dump Ceph logs ansible.builtin.include_tasks: logs.yml vars: cmd_type: "{{ item.type }}" cur_cmd: "{{ item.cmd }}" loop: "{{ cifmw_cephadm_log_commands }}" - name: Configure ceph object store to use external ceph object gateway when: - cifmw_cephadm_vip is defined - cifmw_cephadm_vip | default("") | length > 0 - cifmw_ceph_daemons_layout.rgw_enabled | default(true) | bool ansible.builtin.include_tasks: configure_object.yml vars: cifmw_cephadm_rgw_vip: "{{ cifmw_cephadm_vip }}" - name: Create RGW S3 openstack user when: - cifmw_ceph_daemons_layout.rgw_enabled | default(true) | bool block: - name: Refresh ceph_cli ansible.builtin.include_tasks: ceph_cli.yml vars: ceph_command: "radosgw-admin" - name: Check if Ceph user exists ignore_errors: true become: true ansible.builtin.command: cmd: >- {{ cifmw_cephadm_ceph_cli }} user info --uid openstack register: cifmw_ceph_s3_user - name: Ceph rgw - create access/secret key when: cifmw_ceph_s3_user.rc > 0 become: true ansible.builtin.command: cmd: >- {{ cifmw_cephadm_ceph_cli }} user create --uid="openstack" --display-name "openstack" - name: Dashboard service validation ansible.builtin.include_tasks: dashboard/validation.yml when: cifmw_ceph_daemons_layout.dashboard_enabled | default(false) | bool