edcf55ce2cef85e273f0bffbb783aed542972160
[it/test.git] / XTesting / aiml-fw / deploy-aiml-thost.sh
1 #! /bin/bash
2 set -x
3
4 echo "This is to deploy the AI-ML framework training host"
5
6 if [ $# -lt 2 ]
7 then 
8         echo "Usage: $0 target-ip private-key-file-path" 
9         exit 1
10 fi
11
12 # pick up the input parameters from command line
13 IP=$1
14 KEYFILE=$2
15
16 # copy over the deploy.sh to remote
17 scp -o StrictHostKeyChecking=no -i $KEYFILE -q deploy.sh root@${IP}:~
18
19 # copy remote IP to the hosts.yaml file
20 echo "${IP}" >> hosts.yaml
21
22 # kick start the installation on remote
23 ansible-playbook -b -v  -i hosts.yaml --become --private-key $KEYFILE cluster.yaml