2013-08-15 17:52:52 +00:00
|
|
|
#!/bin/bash -xe
|
|
|
|
|
|
|
|
# Copyright (C) 2011-2013 OpenStack Foundation
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
|
|
# implied.
|
|
|
|
#
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
HOSTNAME=$1
|
2014-01-27 10:39:10 -08:00
|
|
|
SUDO=$2
|
2014-02-05 17:28:25 -08:00
|
|
|
BARE=$3
|
2014-02-16 00:49:58 +00:00
|
|
|
PYTHON3=${4:-false}
|
|
|
|
PYPY=${5:-false}
|
2014-01-27 10:39:10 -08:00
|
|
|
|
|
|
|
sudo hostname $HOSTNAME
|
2013-07-21 21:08:11 -07:00
|
|
|
wget https://git.openstack.org/cgit/openstack-infra/config/plain/install_puppet.sh
|
2013-08-15 17:52:52 +00:00
|
|
|
sudo bash -xe install_puppet.sh
|
2014-02-12 21:35:06 +00:00
|
|
|
sudo git clone git://review.openstack.org/p/openstack-infra/config.git \
|
2013-08-15 17:52:52 +00:00
|
|
|
/root/config
|
|
|
|
sudo /bin/bash /root/config/install_modules.sh
|
2013-08-20 19:58:38 -07:00
|
|
|
if [ -z "$NODEPOOL_SSH_KEY" ] ; then
|
2013-08-15 17:52:52 +00:00
|
|
|
sudo puppet apply --modulepath=/root/config/modules:/etc/puppet/modules \
|
2014-02-16 00:49:58 +00:00
|
|
|
-e "class {'openstack_project::single_use_slave': sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, }"
|
2013-08-15 17:52:52 +00:00
|
|
|
else
|
|
|
|
sudo puppet apply --modulepath=/root/config/modules:/etc/puppet/modules \
|
2014-02-16 00:49:58 +00:00
|
|
|
-e "class {'openstack_project::single_use_slave': install_users => false, sudo => $SUDO, bare => $BARE, python3 => $PYTHON3, include_pypy => $PYPY, ssh_key => '$NODEPOOL_SSH_KEY', }"
|
2013-08-15 17:52:52 +00:00
|
|
|
fi
|
2013-12-04 09:22:05 -08:00
|
|
|
|
|
|
|
sudo mkdir -p /opt/git
|
|
|
|
sudo -i python /opt/nodepool-scripts/cache_git_repos.py
|
2014-02-19 09:03:19 -08:00
|
|
|
|
|
|
|
sync
|
|
|
|
sleep 5
|