Make the cache prep timeout configurable

In some environments it may be desirable to adjust the
cache timeout. This makes that possible.

Change-Id: I733887f16d844f07457c80c3c6936f668e12ce86
This commit is contained in:
Jesse Pretorius 2017-11-18 19:32:53 +00:00
parent 0d28eeab56
commit 670b47bbfb
3 changed files with 15 additions and 2 deletions

View File

@ -131,6 +131,12 @@ lxc_cache_prep_post_commands: '## post command skipped ##'
# List of packages to be installed into the base container cache
lxc_cache_distro_packages: "{{ _lxc_cache_distro_packages }}"
# The maximum amount of time (in seconds) to wait until failing the cache
# preparation process. This is necessary to mitigate the issue that can
# arise where the cache prep hangs and never fails.
# The value is specified in seconds, with the default being 10 minutes.
lxc_cache_prep_timeout: 600
# Set the servers to download LXC images from
# NOTE(mhayden): The main images.linuxcontainers.org site will redirect
# requests to (us|uk).images.linuxcontainers.org upon the first request. We

View File

@ -0,0 +1,7 @@
---
features:
- |
The maximum amount of time to wait until forcibly failing the
LXC cache preparation process is now configurable using the
``lxc_cache_prep_timeout`` variable. The value is specified
in seconds, with the default being 10 minutes.

View File

@ -110,7 +110,7 @@
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
async: "{{ lxc_cache_prep_timeout }}"
poll: 0
register: _lxc_cache_prepare_commands
@ -133,7 +133,7 @@
register: _lxc_cache_prepare_commands_result
until: _lxc_cache_prepare_commands_result.finished
delay: 10
retries: 60
retries: "{{ lxc_cache_prep_timeout // 10 }}"
- name: Remove requiretty for sudo on centos
template: