Merge "Use local container meta-data"

This commit is contained in:
Zuul 2018-03-19 16:13:17 +00:00 committed by Gerrit Code Review
commit 44502e1919
7 changed files with 23 additions and 28 deletions

View File

@ -80,11 +80,6 @@
path: "/tmp/rootfs.tar.xz"
state: "absent"
- name: Remove metadata archive
file:
path: "/tmp/meta.tar.xz"
state: "absent"
- name: Restart dnsmasq
service:
name: "lxc-dnsmasq"

View File

@ -37,29 +37,19 @@
tags:
- skip_ansible_lint
- name: Fetch LXC image-metadata
shell: >
aria2c
--max-connection-per-server=4
--continue
--allow-overwrite=true
--dir=/tmp
--out=meta.tar.xz
--check-certificate={{ (lxc_hosts_validate_certs | bool) | lower }}
{% for server in lxc_image_cache_server_mirrors %}{{ server }}/{{ lxc_images[0].split(';')[-1] }}/meta.tar.xz {% endfor %}
args:
warn: no
tags:
- skip_ansible_lint
- always
- name: Place container metadata
unarchive:
src: "/tmp/meta.tar.xz"
dest: "{{ cache_path_fact }}"
remote_src: True
notify:
- Remove metadata archive
- name: Drop container meta-data
template:
src: "meta-data/{{ item }}"
dest: "{{ cache_path_fact }}/{{ item }}"
owner: "root"
group: "root"
mode: "0644"
with_items:
- config
- config.5
- create-message
- expiry
- templates
- name: Set cache expiry
shell: "date -d @{{ (cache_time | int) + 31536000 }}"

View File

@ -0,0 +1,2 @@
lxc.include = LXC_TEMPLATE_CONFIG/{{ lxc_cache_map.distro }}.common.conf
lxc.arch = x86_64

View File

@ -0,0 +1,2 @@
lxc.include = LXC_TEMPLATE_CONFIG/common.conf
lxc.arch = x86_64

View File

@ -0,0 +1,4 @@
Created a {{ lxc_cache_map.distro }} container (release={{ lxc_cache_map.release }}, arch={{ lxc_cache_map.arch }}, variant={{ lxc_cache_default_variant }})
Use lxc-attach or chroot directly into the rootfs to set a root password
or create user accounts.

View File

View File

@ -0,0 +1,2 @@
/etc/hostname
/etc/hosts