summaryrefslogtreecommitdiffstats
path: root/build-gluster-org/scripts/distributed-node-create.sh
blob: b364d58778bd53537c26a083e1592c2a9e875d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

MAX_ATTEMPTS = 3
set -e

# create and activate virtual env
virtualenv env
source env/bin/activate

# create SSH key pair of 4096 bits to use it for instances at Rackspace
ssh-keygen -f ${WORKSPACE}/key -t rsa -b 4096

# Install pyrax dependency
pip install pyrax
/opt/qa/distributed-tests/rackspace-server-manager.py create -n ${MACHINES_COUNT}

for retry in `seq 1 $MAX_ATTEMPTS`
do
  ansible-playbook -i hosts -e 'host_key_checking=False' --private-key=key /opt/qa/distributed-tests/distributed-server.yml
  ret=$?
  if [ $ret -eq 0 ]; then
    break
  fi
  echo 'Attempting to run again...'
done