blob: 1c96cce647d1ffa55d73561743b5935691db7c28 [file] [log] [blame]
#!/bin/ash
ID=$1
HOSTNAME=$2
LOG=/etc/maas/ansible/logs/$ID.log
INV=$(mktemp)
cat >$INV <<EO_INV
[head]
juju-head-node.cord.lab ansible_user={{ ansible_user_id }}
[compute]
$HOSTNAME ansible_user=ubuntu
EO_INV
echo "BEGIN INVENTORY FILE" >> $LOG
cat $INV >> $LOG
echo "END INVENTORY_FILE" >> $LOG
echo "cd /opt/cord/build/platform-install; ansible-playbook --private-key=/etc/maas/ansible/id_rsa --extra-vars 'cord_in_a_box={{ cord_in_a_box }}' -i $INV cord-compute-playbook.yml" >> $LOG
cd /opt/cord/build/platform-install
ansible-playbook --private-key=/etc/maas/ansible/id_rsa --extra-vars 'cord_in_a_box={{ cord_in_a_box }}' -i $INV cord-compute-playbook.yml >> $LOG
RESULT=$?
rm $INV
exit $RESULT