Change subvolume create to unmask errors

The subvolume creation task was running such that all errors were being
masked. This change uses the creates argument to give us an idempotent
task while also ensuring we're not masking real errors.

Change-Id: I3b87457e8871128c32b8829f440ea69e0623bfd8
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-06-27 14:14:59 -05:00 committed by Kevin Carter (cloudnull)
parent 26221a267d
commit 144bf1ccd9
1 changed files with 2 additions and 2 deletions

View File

@ -23,9 +23,9 @@
- name: Add image cache
command: "btrfs subvolume create /var/lib/machines/{{ nspawn_container_base_name }}"
args:
creates: "/var/lib/machines/{{ nspawn_container_base_name }}"
register: cache_refresh_add
changed_when: cache_refresh_add.rc == 0
failed_when: cache_refresh_add.rc not in [0, 1]
when:
- nspawn_image_cache_refresh | bool