tripleo-image-elements/elements/os-apply-config/install.d/99-install-config-templates

20 lines
587 B
Bash
Executable File

#!/bin/bash
# This script will copy the templates to the appropriate location.
# Note that the implementation relies on the detail that all elements
# share one dir inside the chroot.
set -eux
set -o pipefail
TEMPLATE_ROOT=$(os-apply-config --print-templates)
TEMPLATE_SOURCE_PREFIX=$(dirname $0)/..
mkdir -p $TEMPLATE_ROOT
for BN in os-config-applier \
os-apply-config \
post-os-apply-config; do
TEMPLATE_SOURCE=${TEMPLATE_SOURCE_PREFIX}/${BN}
if [[ -d "${TEMPLATE_SOURCE}" ]]; then
rsync --exclude='.*.swp' -Cr $TEMPLATE_SOURCE/ $TEMPLATE_ROOT/
fi
done