Many of the large web service companies have written software many years ago to automate the creation of IP Fabrics, but these scripts have remained private and not for public use. Juniper has created the OpenClos project to provide free and open-source tools to automate the creation of IP Fabrics in the data center.
Feel free to check out the source code or download a copy of OpenClos on GitHub. You can find it under the Juniper organization on GitHub under the OpenClos repository:
https://github.com/Juniper/OpenClos
Or read more about what OpenClos is and what problems it can help you solve on the OpenClos page.