2013-03-05 18:38:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
install-packages git-core python-pip
|
2013-04-01 21:58:51 +00:00
|
|
|
pip install -U git+https://github.com/stackforge/os-config-applier.git
|
2013-03-05 18:38:07 +00:00
|
|
|
|
|
|
|
TEMPLATE_ROOT=$(os-config-applier --print-templates)
|
|
|
|
mkdir -p $TEMPLATE_ROOT
|
|
|
|
|
2013-03-07 22:17:41 +00:00
|
|
|
# Upstart
|
|
|
|
if [ -d /etc/init ] ; then
|
|
|
|
cat > /etc/init/os-config-applier.conf <<eof
|
2013-03-05 18:38:07 +00:00
|
|
|
start on runlevel [2345]
|
|
|
|
task
|
|
|
|
exec os-config-applier
|
|
|
|
eof
|
2013-03-07 22:17:41 +00:00
|
|
|
# Systemd
|
|
|
|
elif [ -d /etc/systemd/system ] ; then
|
|
|
|
cat > /etc/systemd/system/os-config-applier.service <<eof
|
|
|
|
[Unit]
|
|
|
|
Description=Apply configs from Heat metadata
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStart=os-config-applier
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
eof
|
|
|
|
else
|
|
|
|
echo "Only systems with systemd or upstart are supported."
|
|
|
|
exit 1
|
|
|
|
fi
|