move over configurations from xos repo

Change-Id: I66583bdaea582986d8f16a29066a79c6687b97fb
diff --git a/common/Makefile.cloudlab b/common/Makefile.cloudlab
new file mode 100644
index 0000000..7ab8a54
--- /dev/null
+++ b/common/Makefile.cloudlab
@@ -0,0 +1,41 @@
+MYFLATLANIF:=$(shell netstat -i |grep "flat"|awk '{print $$1}' )
+ifndef MYFLATLANIF
+$(error MYFLATLANIF is empty)
+endif
+MYFLATLANIP:=$(shell ifconfig $(MYFLATLANIF) | grep "inet addr" | awk -F: '{print $$2}' | awk '{print $$1}' )
+SETUPDIR:=../setup
+
+all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url other_keys
+
+prereqs:
+	make -f Makefile.prereqs
+	mkdir -p $(SETUPDIR)
+
+admin-openrc:
+	sudo cat /root/setup/admin-openrc.sh > $(SETUPDIR)/admin-openrc.sh
+	sudo cat /root/setup/settings > $(SETUPDIR)/controller_settings
+	echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> $(SETUPDIR)/controller_settings
+
+flat_name:
+	bash -c "source $(SETUPDIR)/admin-openrc.sh ; neutron net-list" |grep flat|awk '{printf "%s",$$4}' > $(SETUPDIR)/flat_net_name
+	[ -s $(SETUPDIR)/flat_net_name ] # throw error if flat_net_name is empty
+
+nodes_yaml:
+	export SETUPDIR=$(SETUPDIR); bash ./make-nodes-yaml.sh 
+
+ceilometer_url:
+	echo http://`hostname -i`/xosmetering/ > $(SETUPDIR)/ceilometer_url
+
+public_key: ~/.ssh/id_rsa.pub
+	cp ~/.ssh/id_rsa.pub $(SETUPDIR)
+
+private_key: ~/.ssh/id_rsa
+	cp ~/.ssh/id_rsa $(SETUPDIR)
+
+~/.ssh/id_rsa.pub:
+	cat /dev/zero | ssh-keygen -q -N ""
+
+other_keys: public_key private_key
+	sudo cat /root/setup/id_rsa > $(SETUPDIR)/node_key
+	sudo cat /root/setup/id_rsa.pub > $(SETUPDIR)/node_key.pub
+	sudo cp $(SETUPDIR)/id_rsa.pub $(SETUPDIR)/padmin_public_key