Merge "Update Centos-8 LXC image to 8.3"

This commit is contained in:
Zuul 2021-02-24 11:13:09 +00:00 committed by Gerrit Code Review
commit aaa8f73807
2 changed files with 32 additions and 1 deletions

View File

@ -77,4 +77,24 @@
src: "/tmp/{{ cache_basename }}"
dest: "/var/lib/machines/{{ lxc_container_base_name }}"
remote_src: yes
extra_opts: "{{ _lxc_hosts_unarchive_extra_opts | default(omit) }}"
when: create_new_dir is changed
# NOTE(jrosser) Centos 8.3 images ships as a nested tar file, these tasks unpack and remove
# the inner tar file
- name: Unpack nested tar file
unarchive:
src: "/var/lib/machines/{{ lxc_container_base_name }}/{{ _lxc_hosts_nested_tar_file }}"
dest: "/var/lib/machines/{{ lxc_container_base_name }}"
remote_src: yes
when:
- create_new_dir is changed
- _lxc_hosts_nested_tar_file is defined
- name: Remove nested tar file
file:
path: "/var/lib/machines/{{ lxc_container_base_name }}/{{ _lxc_hosts_nested_tar_file }}"
state: absent
when:
- create_new_dir is changed
- _lxc_hosts_nested_tar_file is defined

View File

@ -13,7 +13,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_lxc_hosts_container_image_url: "https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-Container-8.1.1911-20200113.3-layer.x86_64.tar.xz"
_lxc_hosts_container_image_url: "https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-Container-8.3.2011-20201204.2.x86_64.tar.xz"
# the Centos 8.3 image contains a tar file inside the downloaded tar
_lxc_hosts_nested_tar_file: "layer.tar"
# layer.tar is in a subdirectory named with a numerical hash, we must descend
# into that directory without knowing it's name, and extract just the inner
# tar file
_lxc_hosts_unarchive_extra_opts:
- --strip-components=1
- --no-anchored
- "{{ _lxc_hosts_nested_tar_file }}"
_lxc_cache_map:
distro: centos