tripleo-ansible/tripleo_ansible/playbooks/cli-undercloud-db-backup.yaml
Jose Luis Franco Arza 06a102a620 Avoid hardcoding /home/stack in cli-undercloud-db-backup.yaml.
Replace the hardcoded reference to /home/stack by the HOME
environment variable.

Change-Id: I94283e928080a417a5ea505c789e6485a3334129
2021-07-07 14:43:18 +02:00

29 lines
1.2 KiB
YAML

---
# Copyright 2020 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.
- name: TripleO Undercloud DB backup.
hosts: Undercloud
remote_user: "{{ tripleo_target_user | default(lookup('env', 'USER')) }}"
become: true
tasks:
- name: Create DB Backup for the undercloud
vars:
tripleo_backup_and_restore_service_manager: false
tripleo_backup_and_restore_mysql_backup_file: "{{ lookup('env', 'HOME') }}/openstack-backup-mysql-{{ lookup('pipe', 'date +%F_%H_%M_%S') }}.sql"
tripleo_backup_and_restore_mysql_grants_file: "{{ lookup('env', 'HOME') }}/openstack-backup-mysql-grants-{{ lookup('pipe', 'date +%F_%H_%M_%S') }}.sql"
include_role:
name: backup_and_restore
tasks_from: db_backup.yml