Fix 2 for moving ips to be static
[genesis.git] / foreman / ci / bootstrap.sh
1 #!/usr/bin/env bash
2
3 #bootstrap script for installing/running Khaleesi in Foreman/QuickStack VM
4 #author: Tim Rozet (trozet@redhat.com)
5 #
6 #Uses Vagrant and VirtualBox
7 #VagrantFile uses bootsrap.sh which Installs Khaleesi
8 #Khaleesi will install and configure Foreman/QuickStack
9 #
10 #Pre-requisties:
11 #Target system should be Centos7
12 #Ensure the host's kernel is up to date (yum update)
13
14 ##VARS
15 reset=`tput sgr0`
16 blue=`tput setaf 4`
17 red=`tput setaf 1`
18 green=`tput setaf 2`
19
20 ##END VARS
21
22
23 # Install EPEL repo for access to many other yum repos
24 # Major version is pinned to force some consistency for Arno
25 yum install -y epel-release-7*
26
27 # Install other required packages
28 if ! yum -y install python-pip python-virtualenv gcc git sshpass ansible python-requests; then
29   printf '%s\n' 'bootstrap.sh: failed to install required packages' >&2
30   exit 1
31 fi
32
33 cd /opt
34
35 echo "Cloning khaleesi to /opt"
36
37 if [ ! -d khaleesi ]; then
38   if ! git clone -b opnfv https://github.com/trozet/khaleesi.git; then
39     printf '%s\n' 'bootstrap.sh: Unable to git clone khaleesi' >&2
40     exit 1
41   fi
42 fi
43
44 cd khaleesi
45
46 cp ansible.cfg.example ansible.cfg
47
48 echo "Completed Installing Khaleesi"
49
50 cd /opt/khaleesi/
51
52 ansible localhost -m setup -i local_hosts
53
54 ./run.sh --no-logs --use /vagrant/opnfv_ksgen_settings.yml playbooks/opnfv.yml