Add ability to override image config directory
Change-Id: I44fd0ec6cdc2a6e2d630a2b6fef479586e1fcb3e
This commit is contained in:
parent
9096715f7a
commit
c57d33c299
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ bootstrap_capo/capo-ephemeral
|
||||
image-builder/config/*.iso
|
||||
image-builder/config/*.qcow2
|
||||
image-builder/config/*.md5sum
|
||||
image-builder/assets/playbooks/roles/multistrap/vars/main.yaml
|
||||
|
@ -20,6 +20,7 @@
|
||||
http: ""
|
||||
https: ""
|
||||
noproxy: ""
|
||||
image_config_dir: config
|
||||
check:
|
||||
jobs:
|
||||
- airship-images-functional
|
||||
|
@ -40,6 +40,8 @@ help: ## This help.
|
||||
images: build generate_iso package_qcow
|
||||
|
||||
build:
|
||||
# Apply any user-defined overrides to multistrap playbook
|
||||
cp $(WORKDIR)/rootfs/multistrap-vars.yaml assets/playbooks/roles/multistrap/vars/main.yaml
|
||||
ifneq ($(PROXY), )
|
||||
sudo -E ./tools/docker_proxy.sh $(PROXY) $(NO_PROXY)
|
||||
export http_proxy=$(PROXY)
|
||||
|
@ -0,0 +1,3 @@
|
||||
Do not make updates here.
|
||||
|
||||
See image-builder/config/rootfs/multistrap-vars.yaml
|
@ -42,6 +42,26 @@ limits:
|
||||
type: 'hard'
|
||||
item: 'core'
|
||||
value: 0
|
||||
- name: nofile-root-soft
|
||||
domain: 'root'
|
||||
type: 'soft'
|
||||
item: 'nofile'
|
||||
value: '65536'
|
||||
- name: nofile-root-hard
|
||||
domain: 'root'
|
||||
type: 'hard'
|
||||
item: 'nofile'
|
||||
value: '1048576'
|
||||
- name: nofile-all-soft
|
||||
domain: '*'
|
||||
type: 'soft'
|
||||
item: 'nofile'
|
||||
value: '65536'
|
||||
- name: nofile-all-hard
|
||||
domain: '*'
|
||||
type: 'hard'
|
||||
item: 'nofile'
|
||||
value: '1048576'
|
||||
|
||||
sysctl:
|
||||
- name: net.bridge.bridge-nf-call-ip6tables
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Overrides to the playbook default variables may be defined in this file.
|
||||
# Overrides to the multistrap playbook defaults may be defined in this file.
|
||||
#
|
||||
# The following are examples that show you how to override variables.
|
||||
#
|
||||
# Example 1: The following usage will *overwrite* the list of repos & packages
|
||||
# defined under defaults/main.yaml with the list here:
|
||||
# defined under multistrap/defaults/main.yaml with the list here:
|
||||
#repos:
|
||||
# - register_repo_with_rootfs: true
|
||||
# name: Ubuntu
|
||||
@ -20,7 +20,7 @@
|
||||
# everything, including the package list(s) for each mirror.
|
||||
#
|
||||
# Example 2: The following usage will *append* to the list of default repos
|
||||
# defined under defaults/main.yaml with the list here:
|
||||
# defined under multistrap/defaults/main.yaml with the list here:
|
||||
#repos_append:
|
||||
# - register_repo_with_rootfs: true
|
||||
# name: DellUtilsRepo
|
||||
@ -38,7 +38,8 @@
|
||||
# the community Ubuntu mirrors.
|
||||
#
|
||||
# Example 3: The following usage will *append* to the list of default packages
|
||||
# installed from the default Ubuntu mirror defined in defaults/main.yaml:
|
||||
# installed from the default Ubuntu mirror defined in
|
||||
# multistrap/defaults/main.yaml:
|
||||
#ubuntu_packages_append:
|
||||
# - package1
|
||||
# - package2
|
@ -45,7 +45,10 @@ install_pkg(){
|
||||
dpkg -l $1 2> /dev/null | grep ^ii > /dev/null || sudo -E apt-get -y install $1
|
||||
}
|
||||
|
||||
sudo -E apt -y update
|
||||
if [ ! -f /var/lib/apt/periodic/update-success-stamp ] || \
|
||||
sudo find /var/lib/apt/periodic/update-success-stamp -mtime +1 | grep update-success-stamp; then
|
||||
sudo -E apt -y update
|
||||
fi
|
||||
|
||||
install_pkg qemu-kvm
|
||||
install_pkg virtinst
|
||||
@ -110,9 +113,9 @@ outputFileName: $img_name" > ${qcow_config}
|
||||
--env NO_PROXY=$noproxy \
|
||||
${image} < ${qcow_config}
|
||||
cloud_init_config_dir='assets/tests/qcow/cloud-init'
|
||||
sudo -E cloud-localds -v --network-config="${cloud_init_config_dir}/network-config" "${workdir}/airship-ubuntu_config.iso" "${cloud_init_config_dir}/user-data" "${cloud_init_config_dir}/meta-data"
|
||||
sudo -E cloud-localds -v --network-config="${cloud_init_config_dir}/network-config" "${workdir}/${img_name}_config.iso" "${cloud_init_config_dir}/user-data" "${cloud_init_config_dir}/meta-data"
|
||||
disk1="--disk path=${workdir}/${img_name}"
|
||||
disk2="--disk path=${workdir}/airship-ubuntu_config.iso,device=cdrom"
|
||||
disk2="--disk path=${workdir}/${img_name}_config.iso,device=cdrom"
|
||||
else
|
||||
echo Unknown build type: $build_type, exiting.
|
||||
exit 1
|
||||
|
@ -44,7 +44,10 @@ umount_chroot(){
|
||||
}
|
||||
|
||||
# Install pre-requisites
|
||||
sudo -E apt -y update
|
||||
if [ ! -f /var/lib/apt/periodic/update-success-stamp ] || \
|
||||
sudo find /var/lib/apt/periodic/update-success-stamp -mtime +1 | grep update-success-stamp; then
|
||||
sudo -E apt -y update
|
||||
fi
|
||||
|
||||
install_pkg efivar
|
||||
# required for building UEFI image
|
||||
@ -73,7 +76,9 @@ pip3 show ansible >& /dev/null || sudo -E pip3 install --upgrade ansible
|
||||
|
||||
if [[ $1 = clean ]]; then
|
||||
umount_chroot
|
||||
if [ -f $build_dir/etc/kernel/postinst.d/kdump-tools ]; then
|
||||
sudo chattr -i $build_dir/etc/kernel/postinst.d/kdump-tools
|
||||
fi
|
||||
if [[ -d $build_dir ]]; then
|
||||
sudo rm -rf $build_dir
|
||||
fi
|
||||
|
@ -38,4 +38,5 @@
|
||||
params:
|
||||
COMMIT: "{{ zuul.newrev | default('') }}"
|
||||
PUSH_IMAGE: "false"
|
||||
WORKDIR: "{{ image_config_dir | default('config') }}"
|
||||
become: True
|
||||
|
@ -43,4 +43,5 @@
|
||||
DOCKER_REGISTRY: "{{ docker_registry }}"
|
||||
GCP_SDK: "{{ gcp_sdk }}"
|
||||
AZ_SDK: "{{ az_sdk }}"
|
||||
WORKDIR: "{{ image_config_dir | default('config') }}"
|
||||
become: True
|
||||
|
Loading…
Reference in New Issue
Block a user