Skip to content

Instantly share code, notes, and snippets.

@richm
Created September 16, 2014 22:40
Show Gist options
  • Save richm/b72fcddc6de3e5a510cb to your computer and use it in GitHub Desktop.
Save richm/b72fcddc6de3e5a510cb to your computer and use it in GitHub Desktop.
diff --git a/bin/foreman_server.sh b/bin/foreman_server.sh
index 95550e7..f814171 100755
--- a/bin/foreman_server.sh
+++ b/bin/foreman_server.sh
@@ -1,10 +1,12 @@
#!/bin/bash
-echo "#################### RED HAT OPENSTACK #####################"
-echo "Thank you for using the Red Hat OpenStack Foreman Installer!"
-echo "############################################################"
+if tty -s ; then
+ echo "#################### RED HAT OPENSTACK #####################"
+ echo "Thank you for using the Red Hat OpenStack Foreman Installer!"
+ echo "############################################################"
-read -p "Press [Enter] to continue"
+ read -p "Press [Enter] to continue"
+fi
# PUPPETMASTER is the fqdn that needs to be resolvable by clients.
# Change if needed
@@ -44,7 +46,7 @@ if [ "x$OPENSTACK_PUPPET_HOME" = "x" ]; then
fi
if [ "x$QUICKSTACK_HOME" = "x" ]; then
- QUICKSTACK_HOME=$(cd $(dirname ${BASH_SOURCE[0]})/.. && pwd)
+ QUICKSTACK_HOME=/usr/share/openstack-foreman-installer
fi
if [ "x$FOREMAN_INSTALLER_DIR" = "x" ]; then
@@ -60,11 +62,6 @@ if [ ! -d $FOREMAN_INSTALLER_DIR ]; then
exit 1
fi
-if [ ! -f foreman_server.sh ]; then
- echo "You must be in the same dir as foreman_server.sh when executing it"
- exit 1
-fi
-
if [ ! -f /etc/redhat-release ] || \
cat /etc/redhat-release | grep -v -q -P 'release 6.[456789]'; then
echo "This installer is only supported on RHEL 6.4 or greater."
@@ -110,9 +107,9 @@ set /files/etc/puppet/puppet.conf/main/pluginsync true
EOA
# fix db migrate script for scl
-cp ../config/dbmigrate $FOREMAN_DIR/extras/
+cp $QUICKSTACK_HOME/config/dbmigrate $FOREMAN_DIR/extras/
# fix broken passenger config file for scl
-cp ../config/broker-ruby $FOREMAN_DIR
+cp $QUICKSTACK_HOME/config/broker-ruby $FOREMAN_DIR
chmod 775 $FOREMAN_DIR/broker-ruby
pushd $FOREMAN_INSTALLER_DIR
@@ -173,8 +170,10 @@ puppet apply --verbose installer.pp --modulepath=modules
#
# TODO fix this! But may require change to the foreman-installer puppet code it
#
-sed -i "s#${FACTER_PROV_INTERFACE}#${PROVISIONING_INTERFACE}#" /etc/sysconfig/d
-service dhcpd restart
+if [ -n "$FACTER_PROV_INTERFACE" -a -n "$PROVISIONING_INTERFACE" ] ; then
+ sed -i "s#${FACTER_PROV_INTERFACE}#${PROVISIONING_INTERFACE}#" /etc/sysconfig
+ service dhcpd restart
+fi
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment