diff --git a/boot/setup.sh b/boot/setup.sh index 2f199ce..a2071a0 100755 --- a/boot/setup.sh +++ b/boot/setup.sh @@ -155,6 +155,7 @@ echo "Starting sapi SMF service." # (Note that sdc_common_setup behavior differs when SAPI is in proto mode for # initial headnode setup.) # +# TODO: make RANish ADMIN_IP=$(mdata-get sdc:nics | json -a -c 'this.nic_tag === "admin"' | json ip) mdata-put sapi-url http://$ADMIN_IP diff --git a/lib/config.js b/lib/config.js index 8bb702c..8b634ab 100755 --- a/lib/config.js +++ b/lib/config.js @@ -53,6 +53,7 @@ var util = require('util'); var assert = require('assert-plus'); var bunyan = require('bunyan'); +var netconfig = require('triton-netconfig'); var vasync = require('vasync'); var NEEDED_SERVICES = [ @@ -205,9 +206,7 @@ function loadConfig(opts, callback) { } var nics = JSON.parse(stdout.trim()); - ctx.adminIp = nics.filter(function (nic) { - return (nic.nic_tag === 'admin'); - })[0].ip; + ctx.adminIp = netconfig.adminIpFromNicsArray(nics); if (!ctx.adminIp) { next(new Error('Missing required ' +