3 #bootstrap script for installing/running Khaleesi in Foreman/QuickStack VM
4 #author: Tim Rozet (trozet@redhat.com)
6 #Uses Vagrant and VirtualBox
7 #VagrantFile uses bootsrap.sh which Installs Khaleesi
8 #Khaleesi will install and configure Foreman/QuickStack
11 #Target system should be Centos7
12 #Ensure the host's kernel is up to date (yum update)
24 if ! yum repolist | grep "epel/"; then
25 if ! rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm; then
26 printf '%s\n' 'bootstrap.sh: Unable to configure EPEL repo' >&2
30 printf '%s\n' 'bootstrap.sh: Skipping EPEL repo as it is already configured.'
33 ##install python,gcc,git
34 if ! yum -y install python-pip python-virtualenv gcc git; then
35 printf '%s\n' 'bootstrap.sh: Unable to install python,gcc,git packages' >&2
40 if ! yum -y install sshpass; then
41 printf '%s\n' 'bootstrap.sh: Unable to install sshpass' >&2
47 echo "Cloning khaleesi to /opt"
49 if [ ! -d khaleesi ]; then
50 if ! git clone -b opnfv https://github.com/trozet/khaleesi.git; then
51 printf '%s\n' 'bootstrap.sh: Unable to git clone khaleesi' >&2
56 if ! pip install ansible; then
57 printf '%s\n' 'bootstrap.sh: Unable to install ansible' >&2
61 if ! pip install requests; then
62 printf '%s\n' 'bootstrap.sh: Unable to install requests python package' >&2
69 cp ansible.cfg.example ansible.cfg
71 echo "Completed Installing Khaleesi"
75 ansible localhost -m setup -i local_hosts
77 ./run.sh --no-logs --use /vagrant/opnfv_ksgen_settings.yml playbooks/opnfv.yml