| LOG=/etc/maas/ansible/logs/$ID.log |
| echo "***** BEGIN *****" >> $LOG |
| echo "PROVISION $ID $HOSTNAME $IP $MAC $ROLE" >> $LOG |
| if [ "$INTERFACE_CONFIG" -eq 1 ]; then |
| FAB_IP="$(curl -s http://allocator:4242/allocations/$MAC | sed -e 's/[{}"]//g' | cut -d, -f2 | cut -d: -f2)/24" |
| EXTRA_VARS="--extra-vars=fabric_ip=$FAB_IP" |
| SKIP_TAGS="--skip-tags=interface_config" |
| echo "ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook --private-key=/etc/maas/ansible/id_rsa -i $HOSTNAME, /etc/maas/ansible/compute-node.yml $SKIP_TAGS $EXTRA_VARS" >> $LOG |
| ANSIBLE_ROLES_PATH=/etc/maas/ansible/roles ansible-playbook --private-key=/etc/maas/ansible/id_rsa -i $HOSTNAME, /etc/maas/ansible/compute-node.yml $SKIP_TAGS $EXTRA_VARS >> $LOG || exit $? |