From 3260f590352865ba728fb87b3dfab8e84f0d06c0 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 12 Jun 2018 11:58:50 +0100 Subject: [PATCH] tasks: lxc_volume: Always create the machines.raw file The machines.raw file is only created if the 'machinectl set-limit' command returns non-zero exit code. However, this file is expected to be present later on so we need to make sure that we create without taking the 'machinectl' exit code into consideration. Fixes the following problem: fatal: [localhost]: FAILED! => {"changed": false, "msg": "Device /var/lib/machines.raw not found."} Depends-On: https://review.openstack.org/#/c/574382/ Change-Id: I8bfd8f2c698241d7b62d01f1674aff8e5c3d2eeb --- tasks/lxc_volume.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/lxc_volume.yml b/tasks/lxc_volume.yml index 6f4a2be6..fbc44237 100644 --- a/tasks/lxc_volume.yml +++ b/tasks/lxc_volume.yml @@ -26,9 +26,8 @@ # value properly during a major upgrade. - name: Set volume size shell: | - if ! machinectl set-limit {{ lxc_host_machine_volume_size | regex_replace("\D*$", "") }}G; then - truncate -s '>{{ lxc_host_machine_volume_size | regex_replace("\D*$", "") }}G' /var/lib/machines.raw - fi + machinectl set-limit {{ lxc_host_machine_volume_size | regex_replace("\D*$", "") }}G + truncate -s '>{{ lxc_host_machine_volume_size | regex_replace("\D*$", "") }}G' /var/lib/machines.raw changed_when: false register: machines_create args: