diff --git a/tasks/lxc_install_zypper.yml b/tasks/lxc_install_zypper.yml index fd7a5047..e8cb43ec 100644 --- a/tasks/lxc_install_zypper.yml +++ b/tasks/lxc_install_zypper.yml @@ -63,3 +63,12 @@ enabled: "yes" tags: - lxc_hosts-config + +- name: Determine latest openSUSE container build information (Leap 15) + # NOTE(hwoarang) The build ID changes all the time so we need to have a hack to determine the latest one + # NOTE(evrardjp) You can still build using your own image by setting lxc_hosts_container_image_url in user_variables. + # NOTE(noonedeadpunk) While suse has static metalink which allows to get to the most recent build, + # aria2c do not save files provided by metalinks under expected names, as --out do not work for them. + shell: | + curl -s {{ _lxc_hosts_container_image_url_base }} | grep -P -o '{{ ansible_architecture }}.*?lxc.*?Build.*?xz' | head -n 1 + register: _lxc_opensuse_image_build_info diff --git a/vars/suse.yml b/vars/suse.yml index 6e0912ae..4402820d 100644 --- a/vars/suse.yml +++ b/vars/suse.yml @@ -15,7 +15,9 @@ # limitations under the License. _lxc_hosts_container_image_url_base: "https://download.opensuse.org/repositories/Virtualization:/containers:/images:/openSUSE-Leap-{{ ansible_distribution_version }}/containers/" -_lxc_hosts_container_image_url: "{{ _lxc_hosts_container_image_url_base }}opensuse-leap-image.x86_64-lxc.tar.xz" +# If you want to specify your own image when using SUSE, please override +# in your extra variables lxc_hosts_container_image_url. +_lxc_hosts_container_image_url: "{{ _lxc_hosts_container_image_url_base }}opensuse-leap-image.{{ _lxc_opensuse_image_build_info.stdout }}" _lxc_cache_map: distro: opensuse