Revert "Provide an override level for os-apply-config"

This reverts commit bf95d722f0.

I hate to be a wet blanket but this is a workaround for lower layers
of the design not being powerful enough - we'll have to repeat this
for other similar elements, such as nagios, and thats poor - plus
we'll have to support this once its in a release, and thats
undesirable.

Change-Id: I0c1aca7f64e4aa0f60c5c24000282cdaa2678c2b
This commit is contained in:
lifeless 2014-04-29 23:55:53 +00:00 committed by Robert Collins
parent bf95d722f0
commit 011d73132d
2 changed files with 12 additions and 30 deletions

View File

@ -1,18 +1,6 @@
os-apply-config
---------------
Install os-apply-config.
This element consists of two main parts, an install.d script to install
templates and an os-refresh-config script to invoke os-apply-config (thereby
applying the templates).
The contents of any os-config-applier or os-apply-config subdirectories in
templates will be installed into the default template directory automatically.
The install.d script looks for directories named:
* os-config-applier - for back-compatibilty, lower precedence
* os-apply-config - the default choice
* post-os-apply-config - higher precedence
Files from these directories will be copied into a templates directory in the
target image, respecting structure.
The os-refresh-config script runs at level 50, if you are writing
os-refresh-config scripts for your own element which rely on templates having
been applied, ensure you use a higher level.
An os-refresh-config hook is created to invoke os-apply-config automatically.

View File

@ -1,19 +1,13 @@
#!/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.
# Note that this relies on the detail that all elements share one dir
# inside the chroot. This will copy all the files that elements have
# added to element/os-config-applier or element/os-apply-config into the
# appropriate location.
set -eux
set -o pipefail
TEMPLATE_ROOT=$(os-apply-config --print-templates)
TEMPLATE_SOURCE_PREFIX=$(dirname $0)/..
TEMPLATE_SOURCE=$(dirname $0)/../os-config-applier
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
[ -d $TEMPLATE_SOURCE ] && rsync --exclude='.*.swp' -Cr $TEMPLATE_SOURCE/ $TEMPLATE_ROOT/
TEMPLATE_SOURCE=$(dirname $0)/../os-apply-config
[ -d $TEMPLATE_SOURCE ] && rsync --exclude='.*.swp' -Cr $TEMPLATE_SOURCE/ $TEMPLATE_ROOT/