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
This commit is contained in:
Markos Chandras 2018-06-12 11:58:50 +01:00
parent 25b074a464
commit 3260f59035

View File

@ -26,9 +26,8 @@
# value properly during a major upgrade. # value properly during a major upgrade.
- name: Set volume size - name: Set volume size
shell: | shell: |
if ! machinectl set-limit {{ lxc_host_machine_volume_size | regex_replace("\D*$", "") }}G; then 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 truncate -s '>{{ lxc_host_machine_volume_size | regex_replace("\D*$", "") }}G' /var/lib/machines.raw
fi
changed_when: false changed_when: false
register: machines_create register: machines_create
args: args: