Skip to content

Commit

Permalink
Merge pull request redhat-openstack#13 from cwolferh/cleanup_workdir
Browse files Browse the repository at this point in the history
$workdir -> $FOREMAN_INSTALLER_DIR and cleanup
  • Loading branch information
jsomara committed May 14, 2013
2 parents 4ef8147 + 2494004 commit 2e97cd9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions foreman_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ if [ "x$PUPPETMASTER" = "x" ]; then
export PUPPETMASTER=$(hostname)
fi

if [ "x$FOREMAN_INSTALLER_DIR" = "x" ]; then
FOREMAN_INSTALLER_DIR=$HOME/foreman-installer
fi

if [ ! -d $FOREMAN_INSTALLER_DIR ]; then
echo "$FOREMAN_INSTALLER_DIR does not exist. exiting"
exit 1
fi

# TODO exit if not in same dir as forem_server.sh, foreman-params.json

# TODO exit if not >= RHEL 6.4 (check /etc/redhat-release)
Expand Down Expand Up @@ -68,21 +77,17 @@ augtool -s set /files/etc/puppet/puppet.conf/agent/server $PUPPETMASTER
# Puppet Plugins
augtool -s set /files/etc/puppet/puppet.conf/main/pluginsync true

workdir=/root
pushd $workdir

# install formean
pushd foreman-installer/
pushd $FOREMAN_INSTALLER_DIR
scl enable ruby193 "puppet apply --verbose -e 'include puppet, puppet::server, passenger, foreman_proxy, foreman' --modulepath=./"
popd

########### FIX PASSENGER #################
########### FIX PASSENGER #################
cp broker-ruby /usr/share/foreman
chmod 777 /usr/share/foreman/broker-ruby
cp ruby193-passenger.conf /etc/httpd/conf.d/ruby193-passenger.conf

############ SETUP MYSQL ###################
yum -y install foreman-mysql* mysql-server
yum -y install foreman-mysql* mysql-server
chkconfig mysqld on
service mysqld start

Expand Down Expand Up @@ -125,7 +130,7 @@ yum clean all
# install dependent packages
yum install -y https://yum.theforeman.org/releases/latest/el6/x86_64/rubygems-1.8.10-1.el6.noarch.rpm
yum install -y augeas ruby193-puppet
yum install -y augeas ruby193-puppet
# Set PuppetServer
augtool -s set /files/etc/puppet/puppet.conf/agent/server $PUPPETMASTER
Expand Down

0 comments on commit 2e97cd9

Please sign in to comment.