Merge "Disable cephadm when ceph is deployed"

This commit is contained in:
Zuul 2021-08-30 11:59:00 +00:00 committed by Gerrit Code Review
commit c002777f57
4 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,27 @@
---
# Copyright 2021 Red Hat, Inc.
#
# 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.
# TODO: check the orchestrator is up
- name: Pause cephadm
hosts: ceph_mon[0]
tasks:
- name: Pause cephadm
import_role:
name: tripleo_cephadm
tasks_from: toggle_cephadm
vars:
backend: ''
action: disable

View File

@ -62,3 +62,5 @@ tripleo_cephadm_debug: false
tripleo_cephadm_min_compat_client: mimic
tripleo_cephadm_deployed_ceph: false
tripleo_cephadm_deployed_ceph_tht_path: "/home/stack/deployed_ceph.yaml"
tripleo_cephadm_backend: ''
tripleo_cephadm_action: disable

View File

@ -0,0 +1,29 @@
---
# 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
include_tasks: ceph_cli.yaml
- name: Reset the Ceph backend
command: "{{ tripleo_cephadm_ceph_cli }} orch set backend {{ tripleo_cephadm_backend|default('') }}"
register: ceph_orch_backend
become: true
- name: Start / Stop cephadm
command: |
{{ tripleo_cephadm_ceph_cli }} mgr module {{ tripleo_cephadm_action|default('disable') }} cephadm
changed_when: false
become: true

View File

@ -0,0 +1,33 @@
---
# 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: Setup the disable_cephadm playbook command
set_fact:
cephadm_disable_cephadm_command:
- ANSIBLE_LOG_PATH="{{ playbook_dir }}/cephadm/disable_cephadm.log"
- ANSIBLE_HOST_KEY_CHECKING=false
- ansible-playbook
- '-i'
- '{{ inventory_file }}'
- '{% if ansible_python_interpreter is defined %}-e ansible_python_interpreter={{ ansible_python_interpreter }}{% endif %}'
- '/usr/share/ansible/tripleo-playbooks/disable_cephadm.yml'
- '-e @{{ playbook_dir }}/cephadm/cephadm-extra-vars-heat.yml'
- '-e @{{ playbook_dir }}/global_vars.yaml'
- name: Run disable_cephadm
shell: "{{ (cephadm_disable_cephadm_command)|join(' ') }}"
tags:
- disable_cephadm