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
This commit is contained in:
Markos Chandras 2018-04-19 14:37:15 +01:00
parent 9ad190a7c8
commit 6b89578369
2 changed files with 12 additions and 1 deletions

View File

@ -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(' ') }}"

View File

@ -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