Add os-disk-config element and image

Initial version of the os-disk-config element and an image target
to allow building a minimal image for testing and demo purposes.

None of this has been tested yet, but the image build completes
successfully so it should be a starting point anyway.
This commit is contained in:
Ben Nemec 2015-02-09 17:00:22 -06:00
parent 2476791b1c
commit 26508884ef
5 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,2 @@
os-apply-config
os-refresh-config

View File

@ -0,0 +1,7 @@
#!/bin/bash
export DIB_INSTALLTYPE_os_disk_config="${DIB_INSTALLTYPE_os_cloud_config:-"source"}"
if [ -z "${OS_DISK_CONFIG_VENV_DIR:-}" ]; then
export OS_DISK_CONFIG_VENV_DIR="${OPENSTACK_VENV_DIR:-"/opt/stack/venvs/os-disk-config"}"
fi

View File

@ -0,0 +1,33 @@
#!/bin/bash
set -eux
set -o pipefail
virtualenv --setuptools ${OS_DISK_CONFIG_VENV_DIR}
set +u
source ${OS_DISK_CONFIG_VENV_DIR}/bin/activate
set -u
# bug #1201253 : virtualenv-1.10.1 embeds setuptools-0.9.8, which
# doesn't manage correctly HTTPS sockets when downloading pbr from
# https://pypi.python.org/simple/ if using http_proxy and https_proxy
# envvars
${OS_DISK_CONFIG_VENV_DIR}/bin/pip install -U 'setuptools>=1.0'
# bug #1293812 : Avoid easy_install triggering on pbr.
${OS_DISK_CONFIG_VENV_DIR}/bin/pip install -U 'pbr>=0.6,<1.0'
if [ -e /opt/stack/os-disk-config/requirements.txt ]; then
reqs=/opt/stack/os-disk-config/requirements.txt
else
reqs=""
fi
if [ -n "$reqs" ] ; then
pip install -r $reqs
fi
pip install /opt/stack/os-disk-config
set +u
deactivate
set -u
ln -s ${OS_DISK_CONFIG_VENV_DIR}/bin/os-disk-config /usr/local/bin/

View File

@ -0,0 +1 @@
os-disk-config git /opt/stack/os-disk-config https://github.com/agroup/os-disk-config

View File

@ -251,6 +251,19 @@ function openstack-full {
fi
}
function os-disk-config {
# Super basic image including os-disk-config for demonstrating its functionality
if [ ! -f os-disk-config.qcow2 ]; then
unset DIB_COMMON_ELEMENTS
disk-image-create \
-a $NODE_ARCH \
-o os-disk-config \
$NODE_DIST \
os-disk-config baremetal \
2>&1 | tee dib-os-disk-config.log
fi
}
if [ "$image_build" = "all" ]; then
deploy-ramdisk
discovery-ramdisk