TripleO Ansible project repository. Contains playbooks for use with TripleO OpenStack deployments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.8 KiB

# 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
# 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
- bar_create_recover_image
- name: set tripleo_container_cli
tripleo_container_cli: "{{ tripleo_backup_and_restore_container_cli.stdout }}"
- tripleo_backup_and_restore_container_cli.stdout != 'nil'
- 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
- 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
- bar_create_recover_image