Pin software dep versions in Foreman bootstrap
[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 # Major version is pinned to force some consistency for Arno
29 if ! yum -y install python-pip-1* python-virtualenv-1* gcc-4* git-1* sshpass-1* ansible-1* python-requests-1*; then
30   printf '%s\n' 'bootstrap.sh: failed to install required packages' >&2
31   exit 1
32 fi
33
34 cd /opt
35
36 echo "Cloning khaleesi to /opt"
37
38 if [ ! -d khaleesi ]; then
39   if ! git clone -b opnfv https://github.com/trozet/khaleesi.git; then
40     printf '%s\n' 'bootstrap.sh: Unable to git clone khaleesi' >&2
41     exit 1
42   fi
43 fi
44
45 cd khaleesi
46
47 cp ansible.cfg.example ansible.cfg
48
49 echo "Completed Installing Khaleesi"
50
51 cd /opt/khaleesi/
52
53 ansible localhost -m setup -i local_hosts
54
55 ./run.sh --no-logs --use /vagrant/opnfv_ksgen_settings.yml playbooks/opnfv.yml