ansible-role-openstack-oper.../tasks/backup_pacemaker.yml
Juan Badia Payno b9c9cad6e0 Switch script to shell
Running the task from the undercloud I had no errors, however when I tried to
run the task from my laptop to do a backup of the undercloud the following error
showed up:
TASK [ansible-role-openstack-operations : Get the database root password]
Fatal: [undercloud-0]:
         FAILED! => {"changed": false,
                     "msg": "Could not find or access /bin/hiera"}
  to retry, use: --limit @/home/jbadiapa/tools/infrared/backup-and\
                 -restore-ffwd/undercloud-backup-openstack-operations.retry

This patch fix that error

Change-Id: Ibecbc53203376489110819c431c9f8ba884aa409
2019-03-05 17:58:57 +01:00

42 lines
1.2 KiB
YAML

# Tasks for backing up Pacemaker configuration
- name: Remove any existing Pacemaker backup directory
file:
path: "{{ backup_tmp_dir }}/pcs"
state: absent
- name: Create a new Pacemaker backup directory
file:
path: "{{ backup_tmp_dir }}/pcs"
state: directory
- name: Create Pacemaker backup script
template:
src: backup_pacemaker.sh.j2
dest: "{{ backup_tmp_dir }}/pcs/backup_pacemaker.sh"
mode: u+rwx
- name: Run the Pacemaker backup script
command: "{{ backup_tmp_dir }}/pcs/backup_pacemaker.sh"
- name: Archive the Pacemaker configuration
shell: |
/bin/tar --ignore-failed-read --xattrs \
-zcf {{ backup_tmp_dir }}/pcs/openstack-backup-pacemaker.tar \
{{ backup_tmp_dir }}/pcs/cib.xml \
{{ backup_tmp_dir }}/pcs/pacemaker_backup.tar.bz2
- name: Copy the archive to the backup server
synchronize:
mode: pull
src: "{{ backup_tmp_dir }}/pcs/openstack-backup-pacemaker.tar"
dest: "{{ backup_directory }}"
set_remote_user: false
ssh_args: "{{ backup_host_ssh_args }}"
delegate_to: "{{ backup_host }}"
- name: Remove the database backup directory
file:
path: "{{ backup_tmp_dir }}/pcs"
state: absent