Enable custom apt.conf in apt-conf element

Allow DIB_APT_CONF to be set to the apt.conf file to be inserted
into the built images.

Change-Id: I5d148ae7286a93e81b3e984c94ba4f089d3a3280
This commit is contained in:
Jon-Paul Sullivan 2014-02-20 10:59:15 +00:00
parent 61d474f2cd
commit 852cec3789
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,18 @@
Override the default apt.conf
=============================
For APT based systems, if you require specific options for apt operations,
you can define `DIB_APT_CONF` with your favorite apt.conf to override it,
before running devtest.sh.
The new apt.conf will take effect at build time and run time.
If you want to use this element with tripleo-incubator scripts, set `NODE_DIST`
/ `SEED_DIB_EXTRA_ARGS` / `UNDERCLOUD_DIB_EXTRA_ARGS` /
`OVERCLOUD_CONTROL_DIB_EXTRA_ARGS` / `OVERCLOUD_COMPUTE_DIB_EXTRA_ARGS` to
make it take effect at the appropriate time.
For instance, before running devtest.sh:
export DIB_APT_CONF=/etc/apt/apt.conf
export NODE_DIST="ubuntu apt-conf"

View File

@ -0,0 +1,17 @@
#!/bin/bash
# Override the default /etc/apt/apt.conf with $DIB_APT_CONF
set -eu
# exit directly if DIB_APT_CONF is not defined properly
if [ -z "$DIB_APT_CONF" ] ; then
echo "DIB_APT_CONF is not set - no apt.conf will be copied in"
exit 0
elif [ ! -f "$DIB_APT_CONF" ] ; then
echo "$DIB_APT_CONF is not a valid apt.conf file."
echo "You should assign a proper apt.conf file in DIB_APT_CONF"
exit 1
fi
# copy the apt.conf to cloudimg
sudo cp -L -f $DIB_APT_CONF $TMP_MOUNT_PATH/etc/apt/apt.conf