openstack-ansible-lxc_hosts/templates/aria2c-download-helper.sh.j2
Nicolas Bock ba8a339377
Use the 'real' name for the LXC image
The Open Build Service repository for the Leap 15.0 LXC image returns
a metalink which causes aria2c to download 2 files. The first is an
empty file (the metalink) and the second is the actual LXC image. The
name of the second file changes frequently.

This change uses the `--on-download-complete` callback of aria2c to
call a helper script which links the expected filename to the actual
filename.

Change-Id: I9a2bc7ded20f772af82956a81a9864c7ee17039c
Signed-off-by: Nicolas Bock <nicolas.bock@suse.com>
2019-04-25 07:12:30 -06:00

11 lines
171 B
Django/Jinja

#!/bin/bash
set -x -e
real_name="$3"
link_name="/tmp/{{ cache_basename }}"
if [[ ${real_name} != ${link_name} ]]; then
ln --symbolic "${real_name}" "${link_name}"
fi