Files
tripleo-ci/scripts/deploy-server.sh
yatin 93768b46ee OpenDev Migration Patch 2
These changes were missed by Sysadmin's proposed
Migration Patch, this patch takes care of these
missings.

Also updated kolla review pull task to use
review.opendev.org instead of opendev.org as
remote url because opendev.org currently don't
have review refs/changes synched due to gitea bug.

Related-Bug: #1825732
Change-Id: I30646b0c5b95f391e9ab4bd767b468280ccb3842
2019-04-22 11:04:00 +05:30

30 lines
1.1 KiB
Bash

#!/bin/bash
# bootstrap a tripleo-ci infrastructure server, this selects which puppet manifest
# to run based on the hostname e.g. to create a mirror server then one can simply
# nova boot --image <id> --flavor <id> --user-data scripts/deploy-server.sh --nic net-id=<id> --nic net-id=<id>,v4-fixed-ip=192.168.1.101 mirror-server
yum install -y epel-release
yum install -y puppet git
echo puppetlabs-apache adrien-filemapper | xargs -n 1 puppet module install
git clone https://github.com/puppetlabs/puppetlabs-vcsrepo.git /etc/puppet/modules/vcsrepo
if [ -e /sys/class/net/eth1 ] ; then
echo -e 'DEVICE=eth1\nBOOTPROTO=dhcp\nONBOOT=yes\nPERSISTENT_DHCLIENT=yes\nPEERDNS=no' > /etc/sysconfig/network-scripts/ifcfg-eth1
ifdown eth1
ifup eth1
fi
CIREPO=/opt/stack/tripleo-ci
mkdir -p $CIREPO
git clone https://opendev.org/openstack/tripleo-ci $CIREPO
if [ -f $CIREPO/scripts/$(hostname)/$(hostname).sh ] ; then
bash $CIREPO/scripts/$(hostname)/$(hostname).sh
fi
if [ -f $CIREPO/scripts/$(hostname)/$(hostname).pp ] ; then
puppet apply $CIREPO/scripts/$(hostname)/$(hostname).pp
fi