Commissioning Script Built-in Variables

is there a way to figure out the rack controller from a commissioning script? i want to create a script for more than one instance of maas and i want it to be dynamic so i only need 1 script

Anyone know a way to do this?