Merge "Use local container meta-data"
This commit is contained in:
commit
44502e1919
@ -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"
|
||||
|
@ -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 }}"
|
||||
|
2
templates/meta-data/config
Normal file
2
templates/meta-data/config
Normal file
@ -0,0 +1,2 @@
|
||||
lxc.include = LXC_TEMPLATE_CONFIG/{{ lxc_cache_map.distro }}.common.conf
|
||||
lxc.arch = x86_64
|
2
templates/meta-data/config.5
Normal file
2
templates/meta-data/config.5
Normal file
@ -0,0 +1,2 @@
|
||||
lxc.include = LXC_TEMPLATE_CONFIG/common.conf
|
||||
lxc.arch = x86_64
|
4
templates/meta-data/create-message
Normal file
4
templates/meta-data/create-message
Normal 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.
|
0
templates/meta-data/expiry
Normal file
0
templates/meta-data/expiry
Normal file
2
templates/meta-data/templates
Normal file
2
templates/meta-data/templates
Normal file
@ -0,0 +1,2 @@
|
||||
/etc/hostname
|
||||
/etc/hosts
|
Loading…
x
Reference in New Issue
Block a user