Failed to fetch backup if backup_directory not ends with /
Summary
If elasticsearch_backup_directory
not ends with /
then backup
action fails.
Steps to reproduce
Run backup action with elasticsearch_backup_directory
set to /tmp/elasticsearch-backup
.
Expected behavior
Backup finish properly.
Actual behavior
Backup fails.
Relevant logs and/or screenshots
fatal: [localhost]: FAILED! => {"failed": true, "msg": "failed to transfer file to /var/lib/citask/schedules/openstack-backup/elasticsearch: [Errno 21] Is a directory: '/var/lib/citask/schedules/openstack-backup/elasticsearch'"}
Possible fixes
Add slash after variable {{ elasticsearch_backup_directory }}
:
- name: "fetch file to localhost"
fetch:
src: "{{ _elasticsearch_backup_file_output }}"
dest: "{{ elasticsearch_backup_directory }}"
flat: yes