Autocreate CephAnsibleFetchDirectoryBackup

Originally the playbook failed to make user aware that they need
to create the CephAnsibleFetchDirectoryBackup. However, if they
specified the path, then they should know about the directory.
Autocreate it so that the user only needs to specify a path.

Change-Id: I06eca1cf8987c9366492973cbe861e1a6b47f744
(cherry picked from commit 7f6f64b8be)
This commit is contained in:
John Fulton 2018-11-15 17:26:27 -05:00 committed by Marios Andreou
parent 2903d932bc
commit 98d9b8d82e
1 changed files with 5 additions and 3 deletions

View File

@ -479,9 +479,11 @@ outputs:
stat: path="{{local_ceph_ansible_fetch_directory_backup}}"
register: local_backup_directory
ignore_errors: True
- name: ensure requested local back up directory exists
fail:
msg: "Process runing Ansible is unable to stat LocalCephAnsibleFetchDirectoryBackup: {{local_ceph_ansible_fetch_directory_backup}}"
- name: autocreate new directory for ceph-ansible fetch directory backup
file:
path: "{{local_ceph_ansible_fetch_directory_backup}}"
state: directory
mode: 0700
when: local_backup_directory.stat.exists == False
- name: look for tarball of ceph-ansible fetch directory in local backup
stat: path="{{local_ceph_ansible_fetch_directory_backup}}/{{ceph_ansible_tarball_name}}"