From 9ed4aaf2b07bd3538a87c922865d1379da483208 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Wed, 6 Feb 2013 19:05:47 -0800 Subject: [PATCH] Add element to call os-refresh-config os-refresh-config simply runs things in a predictable order in directories that other elements can populate. This element installs it and sets it up to run at boot. We also modify os-config-applier element to be called by this rather than to have its own upstart job. This provides an example of how other elements can insert themselves into the refresh process. Change-Id: I52d72b7fd302ec317840af87fa77299387af99ad --- .../install.d/50-os-config-applier | 8 +++++--- elements/os-refresh-config/README.md | 7 +++++++ elements/os-refresh-config/element-deps | 1 + .../install.d/01-os-refresh-config | 15 +++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 elements/os-refresh-config/README.md create mode 100644 elements/os-refresh-config/element-deps create mode 100755 elements/os-refresh-config/install.d/01-os-refresh-config diff --git a/elements/os-config-applier/install.d/50-os-config-applier b/elements/os-config-applier/install.d/50-os-config-applier index d97fe814..15e63d0f 100755 --- a/elements/os-config-applier/install.d/50-os-config-applier +++ b/elements/os-config-applier/install.d/50-os-config-applier @@ -9,8 +9,10 @@ pip install -U git+https://github.com/tripleo/os-config-applier.git mkdir -p /opt/stack git clone $TEMPLATES /opt/stack/openstack-config-templates -cat > /etc/init/os-config-applier.conf <<- eof -start on runlevel [2345] -task +runscript=$(os-refresh-config --print-base)/configuration.d/10-os-config-applier +mkdir -p $(dirname $runscript) +cat > $runscript <<- eof +#!/bin/sh exec os-config-applier -t /opt/stack/openstack-config-templates/templates eof +chmod 0755 $runscript diff --git a/elements/os-refresh-config/README.md b/elements/os-refresh-config/README.md new file mode 100644 index 00000000..a5f97134 --- /dev/null +++ b/elements/os-refresh-config/README.md @@ -0,0 +1,7 @@ +Install os-refresh-config. + +os-refresh-config uses run-parts to run scripts in a pre-defined set +of directories. Its intended purpose is to quiesce (pre-configure.d), +configure (configure.d), migrate (migration.d), and then activate +(post-configure.d) a configuration on first boot or in response to Heat +Metadata changes. diff --git a/elements/os-refresh-config/element-deps b/elements/os-refresh-config/element-deps new file mode 100644 index 00000000..2a8c462f --- /dev/null +++ b/elements/os-refresh-config/element-deps @@ -0,0 +1 @@ +heat-jeos diff --git a/elements/os-refresh-config/install.d/01-os-refresh-config b/elements/os-refresh-config/install.d/01-os-refresh-config new file mode 100755 index 00000000..116b4783 --- /dev/null +++ b/elements/os-refresh-config/install.d/01-os-refresh-config @@ -0,0 +1,15 @@ +#!/bin/bash +# We need to install this early in install.d because other elements will +# need to use os-refresh-config --print-base to know where to put files + +set -eux + +install-packages git-core python-pip + +pip install git+https://github.com/tripleo/os-refresh-config.git + +cat > /etc/init/os-refresh-config.conf <<- eof +start on runlevel [2345] +task +exec os-refresh-config +eof