#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
iface=<%= node['dcos-grid']['bootstrap']['ip-detect']['interface'] %>  # or eth0,...
echo $(ip addr show $iface | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)