--- # Copyright 2019 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. # # Call to podman to list running containers then commit all state to # disk. Once services state has been flushed dump the database then allow # the backup to start. - name: Get Container cli command: hiera -c /etc/puppet/hiera.yaml container_cli register: tripleo_backup_and_restore_container_cli changed_when: tripleo_backup_and_restore_container_cli.stdout is undefined tags: - bar_create_recover_image - name: set tripleo_container_cli set_fact: tripleo_container_cli: "{{ tripleo_backup_and_restore_container_cli.stdout }}" when: - tripleo_backup_and_restore_container_cli.stdout != 'nil' tags: - bar_create_recover_image - name: Gather Container Service Name shell: | set -o pipefail /usr/bin/{{ tripleo_container_cli }} ps --format '{{ '{{' }}.Names {{ '}}' }} ' | /usr/bin/egrep -v 'galera|mysql|bundle' register: container_services changed_when: container_services.stdout is undefined failed_when: false tags: - bar_create_recover_image - name: Pause containers for database backup. command: "{{ tripleo_container_cli }} pause {{ item }}" with_items: "{{ container_services.stdout_lines }}" when: container_services is defined tags: - bar_create_recover_image