Remove lxc_cache_map variable
This has not had any practical use for several releases and mostly carries copies of ansible facts. Remove the variable and use the facts directly. Change-Id: I1d2be9d07b38eaf2b737819c451a0d2339f723d0
This commit is contained in:
parent
a22ec2150f
commit
d57f9a8f47
|
@ -78,19 +78,12 @@ lxc_container_backing_store: dir
|
||||||
# 'lvm'.
|
# 'lvm'.
|
||||||
# lxc_container_backing_method: copy-on-write
|
# lxc_container_backing_method: copy-on-write
|
||||||
|
|
||||||
# The cache map is used as a basic instruction set when prep'ing the base
|
|
||||||
# container image. If the cache map is overridden, the following fields are
|
|
||||||
# required:
|
|
||||||
# lxc_cache_map:
|
|
||||||
# distro: name of the distro
|
|
||||||
# arch: "CPU architecture"
|
|
||||||
# release: version of the release
|
|
||||||
# copy_from_host: [] # List of files to copy into the container
|
|
||||||
lxc_cache_map: "{{ _lxc_cache_map }}"
|
|
||||||
|
|
||||||
# When using a base container to snapshot from for the overlayfs or LVM
|
# When using a base container to snapshot from for the overlayfs or LVM
|
||||||
# copy-on-write backing stored, the base container can be set.
|
# copy-on-write backing stored, the base container can be set.
|
||||||
lxc_container_base_name: "{{ lxc_cache_map.distro }}-{{ lxc_cache_map.release }}-{{ lxc_cache_map.arch }}"
|
lxc_container_base_name: >-
|
||||||
|
{{ ansible_facts['distribution'] | lower ~ '-' ~
|
||||||
|
ansible_facts['distribution_major_version'] ~ '-' ~
|
||||||
|
lxc_architecture_mapping.get(ansible_facts['architecture']) }}
|
||||||
|
|
||||||
# Set the default zfs root name
|
# Set the default zfs root name
|
||||||
lxc_container_zfs_root_name: "pool/lxc"
|
lxc_container_zfs_root_name: "pool/lxc"
|
||||||
|
@ -219,9 +212,9 @@ lxc_image_cache_refresh: false
|
||||||
lxc_cache_default_variant: default
|
lxc_cache_default_variant: default
|
||||||
lxc_cache_download_template_extra_options: ""
|
lxc_cache_download_template_extra_options: ""
|
||||||
lxc_cache_download_template_options: >-
|
lxc_cache_download_template_options: >-
|
||||||
--dist {{ lxc_cache_map.distro }}
|
--dist {{ ansible_facts['distribution'] | lower }}
|
||||||
--release {{ lxc_cache_map.release }}
|
--release {{ ansible_facts['distribution_major_version'] }}
|
||||||
--arch {{ lxc_cache_map.arch }}
|
--arch {{ lxc_architecture_mapping.get(ansible_facts['architecture']) }}
|
||||||
--force-cache
|
--force-cache
|
||||||
--server localhost
|
--server localhost
|
||||||
--variant {{ lxc_cache_default_variant }}
|
--variant {{ lxc_cache_default_variant }}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The variable lxc_cache_map is removed as the lxc_hosts ansible role
|
||||||
|
has only been able to create containers matching the host architecture
|
||||||
|
and OS for several releases, and lxc_cache_map simply carried copies
|
||||||
|
of data from ansible_facts.
|
|
@ -16,7 +16,11 @@
|
||||||
- name: Set LXC cache fact(s)
|
- name: Set LXC cache fact(s)
|
||||||
set_fact:
|
set_fact:
|
||||||
cache_path_fact: >-
|
cache_path_fact: >-
|
||||||
{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/{{ lxc_cache_default_variant }}
|
{{ lxc_container_cache_path ~ '/' ~
|
||||||
|
ansible_facts['distribution'] | lower ~ '/' ~
|
||||||
|
ansible_facts['distribution_major_version'] ~ '/' ~
|
||||||
|
lxc_architecture_mapping.get(ansible_facts['architecture']) ~ '/' ~
|
||||||
|
lxc_cache_default_variant }}
|
||||||
cache_time: "{{ now().timestamp() }}"
|
cache_time: "{{ now().timestamp() }}"
|
||||||
|
|
||||||
- name: Retrieve the expiry object
|
- name: Retrieve the expiry object
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
register: _rsync_container_cache
|
register: _rsync_container_cache
|
||||||
args:
|
args:
|
||||||
executable: "/bin/bash"
|
executable: "/bin/bash"
|
||||||
with_items: "{{ (lxc_cache_map.copy_from_host | union(lxc_container_cache_files_from_host)) | list }}"
|
with_items: "{{ (_lxc_copy_from_host | union(lxc_container_cache_files_from_host)) | list }}"
|
||||||
|
|
||||||
- name: Ensure directories exist for lxc_container_cache_files
|
- name: Ensure directories exist for lxc_container_cache_files
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
lxc.include = LXC_TEMPLATE_CONFIG/{{ lxc_cache_map.distro }}.common.conf
|
lxc.include = LXC_TEMPLATE_CONFIG/{{ ansible_facts['distribution'] | lower }}.common.conf
|
||||||
lxc.arch = x86_64
|
lxc.arch = x86_64
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Created a {{ lxc_cache_map.distro }} container (release={{ lxc_cache_map.release }}, arch={{ lxc_cache_map.arch }}, variant={{ lxc_cache_default_variant }})
|
Created a {{ ansible_facts['distribution'] | lower }} container (release={{ ansible_facts['distribution_major_version'] }}, arch={{ lxc_architecture_mapping.get(ansible_facts['architecture']) }}, variant={{ lxc_cache_default_variant }})
|
||||||
|
|
||||||
Use lxc-attach or chroot directly into the rootfs to set a root password
|
Use lxc-attach or chroot directly into the rootfs to set a root password
|
||||||
or create user accounts.
|
or create user accounts.
|
||||||
|
|
|
@ -20,21 +20,17 @@ _lxc_hosts_container_build_command: >-
|
||||||
/var/lib/machines/{{ lxc_container_base_name }}
|
/var/lib/machines/{{ lxc_container_base_name }}
|
||||||
{{ lxc_apt_mirror }}
|
{{ lxc_apt_mirror }}
|
||||||
|
|
||||||
_lxc_cache_map:
|
_lxc_copy_from_host:
|
||||||
distro: "{{ ansible_facts['distribution'] | lower }}"
|
- /etc/apt/sources.list
|
||||||
arch: "{{ lxc_architecture_mapping.get(ansible_facts['architecture']) }}"
|
- /etc/apt/sources.list.d/
|
||||||
release: "{{ ansible_facts['distribution_major_version'] }}"
|
- /etc/apt/apt.conf.d/
|
||||||
copy_from_host:
|
- /etc/apt/trusted.gpg.d/
|
||||||
- /etc/apt/sources.list
|
- /etc/apt/trusted.gpg
|
||||||
- /etc/apt/sources.list.d/
|
- /etc/apt/preferences.d/
|
||||||
- /etc/apt/apt.conf.d/
|
- /etc/apt/mirrors/
|
||||||
- /etc/apt/trusted.gpg.d/
|
- /etc/environment
|
||||||
- /etc/apt/trusted.gpg
|
- /etc/localtime
|
||||||
- /etc/apt/preferences.d/
|
- /etc/protocols
|
||||||
- /etc/apt/mirrors/
|
|
||||||
- /etc/environment
|
|
||||||
- /etc/localtime
|
|
||||||
- /etc/protocols
|
|
||||||
|
|
||||||
_lxc_cache_prep_template: "prep-scripts/debian_prep.sh.j2"
|
_lxc_cache_prep_template: "prep-scripts/debian_prep.sh.j2"
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,15 @@ _lxc_hosts_container_build_command: >-
|
||||||
/var/lib/machines/{{ lxc_container_base_name }}
|
/var/lib/machines/{{ lxc_container_base_name }}
|
||||||
{{ lxc_apt_mirror }}
|
{{ lxc_apt_mirror }}
|
||||||
|
|
||||||
_lxc_cache_map:
|
_lxc_copy_from_host:
|
||||||
distro: "{{ ansible_facts['distribution'] | lower }}"
|
- /etc/apt/sources.list
|
||||||
arch: "{{ lxc_architecture_mapping.get(ansible_facts['architecture']) }}"
|
- /etc/apt/apt.conf.d/
|
||||||
release: "{{ ansible_facts['distribution_major_version'] }}"
|
- /etc/apt/trusted.gpg.d/
|
||||||
copy_from_host:
|
- /etc/apt/trusted.gpg
|
||||||
- /etc/apt/sources.list
|
- /etc/apt/preferences.d/
|
||||||
- /etc/apt/apt.conf.d/
|
- /etc/environment
|
||||||
- /etc/apt/trusted.gpg.d/
|
- /etc/localtime
|
||||||
- /etc/apt/trusted.gpg
|
- /etc/protocols
|
||||||
- /etc/apt/preferences.d/
|
|
||||||
- /etc/environment
|
|
||||||
- /etc/localtime
|
|
||||||
- /etc/protocols
|
|
||||||
|
|
||||||
_lxc_cache_prep_template: "prep-scripts/debian_prep.sh.j2"
|
_lxc_cache_prep_template: "prep-scripts/debian_prep.sh.j2"
|
||||||
|
|
||||||
|
|
|
@ -24,19 +24,15 @@ _lxc_hosts_container_build_command: >-
|
||||||
--setopt=install_weak_deps=False --nodocs rootfiles coreutils dnf {{ _lxc_cache_core_repos }}
|
--setopt=install_weak_deps=False --nodocs rootfiles coreutils dnf {{ _lxc_cache_core_repos }}
|
||||||
--releasever={{ ansible_facts['distribution_major_version'] }}
|
--releasever={{ ansible_facts['distribution_major_version'] }}
|
||||||
|
|
||||||
_lxc_cache_map:
|
_lxc_copy_from_host:
|
||||||
distro: "{{ ansible_facts['distribution'] | lower }}"
|
- /etc/default/locale
|
||||||
arch: "{{ lxc_architecture_mapping.get(ansible_facts['architecture']) }}"
|
- /etc/environment
|
||||||
release: "{{ ansible_facts['distribution_major_version'] }}"
|
- /etc/localtime
|
||||||
copy_from_host:
|
- /etc/locale.conf
|
||||||
- /etc/default/locale
|
- /etc/protocols
|
||||||
- /etc/environment
|
- /etc/pki/rpm-gpg/
|
||||||
- /etc/localtime
|
- /etc/yum/pluginconf.d/fastestmirror.conf
|
||||||
- /etc/locale.conf
|
- /etc/yum.repos.d/
|
||||||
- /etc/protocols
|
|
||||||
- /etc/pki/rpm-gpg/
|
|
||||||
- /etc/yum/pluginconf.d/fastestmirror.conf
|
|
||||||
- /etc/yum.repos.d/
|
|
||||||
|
|
||||||
_lxc_cache_prep_template: "prep-scripts/redhat_prep.sh.j2"
|
_lxc_cache_prep_template: "prep-scripts/redhat_prep.sh.j2"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue