2013-02-07 03:05:47 +00:00
|
|
|
#!/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
|
|
|
|
|
2013-02-21 05:50:33 +00:00
|
|
|
for d in pre-configure.d configure.d migration.d post-configure.d; do
|
|
|
|
install -m 0755 -o root -g root -d /opt/stack/os-config-refresh/$d
|
|
|
|
done
|
|
|
|
|
2013-03-07 22:17:41 +00:00
|
|
|
# Upstart
|
|
|
|
if [ -d /etc/init ] ; then
|
|
|
|
cat > /etc/init/os-refresh-config.conf <<eof
|
2013-02-07 03:05:47 +00:00
|
|
|
start on runlevel [2345]
|
|
|
|
task
|
|
|
|
exec os-refresh-config
|
|
|
|
eof
|
2013-03-07 22:17:41 +00:00
|
|
|
# Systemd
|
|
|
|
elif [ -d /etc/systemd/system ] ; then
|
|
|
|
cat > /etc/systemd/system/os-refresh-config.service <<eof
|
|
|
|
[Unit]
|
|
|
|
Description=Refresh Config on state change
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStart=os-refresh-config
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
eof
|
|
|
|
else
|
|
|
|
echo Only systems with systemd or upstart are supported.
|
|
|
|
exit 1
|
|
|
|
fi
|