Merge "Enable custom apt.conf in apt-conf element"
This commit is contained in:
commit
142dfad122
18
elements/apt-conf/README.md
Normal file
18
elements/apt-conf/README.md
Normal 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"
|
17
elements/apt-conf/extra-data.d/99-override-default-apt-conf
Executable file
17
elements/apt-conf/extra-data.d/99-override-default-apt-conf
Executable 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
|
Loading…
Reference in New Issue
Block a user