Files
tripleo-operator-ansible/roles/tripleo_undercloud_backup/tasks/main.yml
Alex Schultz cc7f8988e7 Add molecule jobs for undercloud and minion roles
Change-Id: Id1256d014c74a576fd67e268a59b5e5d2d4e3d96
2020-02-03 18:26:56 +02:00

30 lines
1.1 KiB
YAML

---
- name: Setup undercloud backup facts
set_fact:
_backup_cmd: >-
{{ openstack_bin }} undercloud backup
{{ tripleo_undercloud_backup_add_path | tripleo.operator.shell_arg_list(parameter='--add-path') }}
{{ tripleo_undercloud_backup_exclude_path | tripleo.operator.shell_arg_list(parameter='--exclude-path') }}
{{ tripleo_undercloud_backup_log_output | ternary((">" ~ tripleo_undercloud_backup_log), '') }}
{{ tripleo_undercloud_backup_log_combine | ternary("2>&1", '') }}
- name: Preserve existing log file if exists
timestamp_file:
path: "{{ tripleo_undercloud_backup_log }}"
when: tripleo_undercloud_backup_log_output|bool
- name: Show the underclound backup command
debug:
var: _backup_cmd
when: tripleo_undercloud_backup_debug|bool
- name: undercloud backup
shell: "{{ _backup_cmd }}" # noqa 305
args:
chdir: "{{ tripleo_undercloud_backup_home_dir }}"
warn: false
async: "{{ tripleo_undercloud_backup_timeout }}"
poll: "{{ tripleo_undercloud_backup_poll }}"
register: tripleo_undercloud_backup_result
changed_when: true