Best way to Automate add host

@Dirk Yes i do already have a Script that does this, except it generates the .mk files, instead of using the API to create hosts. But this Script is big and complicated, so i need to find out, if it is easier to change the Script to use the API, but thats not the prettiest solution, or to create a Piggiback Datasource, that does the same. But the Piggyback Datasource still needs a script to get the list of servers.