lxc_cache_preparation: Convert the LXC cache preparation to async task

openSUSE sometimes hangs when running this task. In order to debug this
failure we need to fire up this task and check for it's status on a
separate one. This way, we can avoid Jenkins timeouts and collect logs
properly when that tasks fails to complete within a reasonable amount of
time.

Change-Id: I3acc4436c8b70af097de188b9de2bb9f4e093a09
(cherry picked from commit 025a800afc)
This commit is contained in:
Markos Chandras 2017-10-13 12:12:01 +01:00 committed by Major Hayden
parent 52e54c89a5
commit f9a8e91478

View File

@ -95,6 +95,19 @@
- name: Prepare cached image setup commands
command: "chroot {{ lxc_image_cache_path }} /usr/local/bin/cache-prep-commands.sh"
changed_when: false
# It should only take a couple of minutes to prepare the cache. But if network is slow it might take longer.
# Lets be optimistic and set the limit to 10 minutes
async: 600
poll: 0
register: _lxc_cache_prepare_commands
- name: Ensure that the LXC cache has been prepared
async_status:
jid: "{{ _lxc_cache_prepare_commands.ansible_job_id }}"
register: _lxc_cache_prepare_commands_result
until: _lxc_cache_prepare_commands_result.finished
delay: 10
retries: 60
- name: Adjust sshd configuration in container
lineinfile: