From 6b89578369f78513c19614b9dda704300f6a0816 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 19 Apr 2018 14:37:15 +0100 Subject: [PATCH] SUSE: Determine the build number on the fly openSUSE changed the way the base container tarballs are being named so we need to parse the Dockerfile to find out which build is available for download. Change-Id: Ib64dcbc960df7d369d202ce8cf7bdc29b3ee0e0a Link: https://github.com/openSUSE/docker-containers-build/issues/29 --- tasks/lxc_install_zypper.yml | 10 ++++++++++ vars/suse-42.yml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tasks/lxc_install_zypper.yml b/tasks/lxc_install_zypper.yml index aa658e77..bc2d5388 100644 --- a/tasks/lxc_install_zypper.yml +++ b/tasks/lxc_install_zypper.yml @@ -61,3 +61,13 @@ enabled: "yes" tags: - lxc_hosts-config + +- name: Determine latest openSUSE container build information + uri: + url: "{{ _lxc_hosts_container_image_url_base }}/Dockerfile" + return_content: true + register: _lxc_opensuse_image_build_info + +- name: Set fact for openSUSE container build information + set_fact: + opensuse_image_build_info: "{{ _lxc_opensuse_image_build_info.content|regex_search('Version: (.*)', '\\1')|join(' ') }}" diff --git a/vars/suse-42.yml b/vars/suse-42.yml index ff173794..24d333a3 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -14,8 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +_lxc_hosts_container_image_url_base: "https://github.com/openSUSE/docker-containers-build/raw/openSUSE-Leap-{{ ansible_distribution_version }}/{{ ansible_architecture }}" -_lxc_hosts_container_image_url: "https://github.com/openSUSE/docker-containers-build/raw/openSUSE-Leap-42.3/{{ ansible_architecture }}/openSUSE-Leap-42.3.base.{{ ansible_architecture }}.tar.xz" +_lxc_hosts_container_image_url: "{{ _lxc_hosts_container_image_url_base }}/openSUSE-Leap-{{ ansible_distribution_version}}-{{ ansible_architecture }}-{{ opensuse_image_build_info }}.tar.xz" _lxc_cache_map: distro: opensuse