Skip to content

Commit

Permalink
puppet & script updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan OMara committed May 29, 2013
1 parent 77445bf commit c21f137
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
10 changes: 4 additions & 6 deletions bin/foreman_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ EOF
cp ../config/dbmigrate $FOREMAN_DIR/extras/
# fix broken passenger config file for scl
cp ../config/broker-ruby $FOREMAN_DIR
chmod 777 $FOREMAN_DIR/broker-ruby
cp ../config/ruby193-passenger.conf /etc/httpd/conf.d/ruby193-passenger.conf
rm /etc/httpd/conf.d/passenger.conf
chmod 775 $FOREMAN_DIR/broker-ruby

pushd $FOREMAN_INSTALLER_DIR
cat > installer.pp << EOM
Expand Down Expand Up @@ -95,16 +93,17 @@ popd
echo '*' >> $SCL_RUBY_HOME/etc/puppet/autosign.conf

scl enable ruby193 "ruby foreman-setup.rb proxy"
scl enable ruby193 "ruby foreman-setup.rb hostgroups"

# Configure class defaults
# This is not ideal, but will work until the API v2 is ready

PASSWD_COUNT=$(cat ../puppet/trystack/manifests/params.pp | grep CHANGEME | wc -l)
PASSWD_COUNT=$(cat ../puppet/modules/trystack/manifests/params.pp | grep CHANGEME | wc -l)

for i in $(seq $PASSWD_COUNT)
do
export PASSWD=$(scl enable ruby193 "ruby foreman-setup.rb password")
sed -i "/CHANGEME/ {s/CHANGEME/$PASSWD/;:a;n;ba}" ../puppet/trystack/manifests/params.pp
sed -i "/CHANGEME/ {s/CHANGEME/$PASSWD/;:a;n;ba}" ../puppet/modules/trystack/manifests/params.pp
done

# install puppet modules
Expand All @@ -119,7 +118,6 @@ sudo -u foreman scl enable ruby193 "cd $FOREMAN_DIR; RAILS_ENV=production rake p

sed -i "s/foreman_hostname/$PUPPETMASTER/" foreman-params.json

scl enable ruby193 "ruby foreman-setup.rb hostgroups"
# write client-register-to-foreman script
# TODO don't hit yum unless packages are not installed
cat >/tmp/foreman_client.sh <<EOF
Expand Down
11 changes: 11 additions & 0 deletions installer_puppet/passenger/manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,15 @@
fail("${::hostname}: This module does not support operatingsystem ${::osfamily}")
}
}
file { "${apache::params::configdir}/ruby193-passenger.conf":
ensure => $ensure,
mode => '0644',
require => Package['httpd'],
notify => Exec['reload-apache'],
content => template('passenger/ruby193-passenger.conf.erb'),
}

file { "${apache::params::configdir}/passenger.conf":
ensure => absent,
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion installer_puppet/puppet/manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

exec {'puppet_server_config-generate_ca_cert':
creates => $::puppet::server::ssl_cert,
command => "${puppet::params::puppetca_path}/${puppet::params::puppetca_bin} --generate ${::fqdn}",
command => "/usr/bin/scl enable ruby193 '${puppet::params::puppetca_path}/${puppet::params::puppetca_bin} --generate ${::fqdn}'",
require => File["${puppet::server::dir}/puppet.conf"],
notify => Service[$puppet::server::httpd_service],
}
Expand Down

0 comments on commit c21f137

Please sign in to comment.