move prereqs to a separate Makefile
diff --git a/xos/configurations/common/Makefile.cloudlab b/xos/configurations/common/Makefile.cloudlab
index ddf9daf..929bc14 100644
--- a/xos/configurations/common/Makefile.cloudlab
+++ b/xos/configurations/common/Makefile.cloudlab
@@ -1,4 +1,7 @@
-all: admin-openrc flat_name nodes_yaml public_key install_docker
+all: prereqs admin-openrc flat_name nodes_yaml public_key
+
+prereqs:
+ make -f Makefile.prereqs
admin-openrc:
sudo cat /root/setup/admin-openrc.sh > admin-openrc.sh
@@ -15,6 +18,3 @@
~/.ssh/id_rsa.pub:
cat /dev/zero | ssh-keygen -q -N ""
-install_docker:
- which docker > /dev/null || wget -qO- https://get.docker.com/ | sh
- sudo usermod -aG docker $(shell whoami)
diff --git a/xos/configurations/common/Makefile.prereqs b/xos/configurations/common/Makefile.prereqs
new file mode 100644
index 0000000..0325224
--- /dev/null
+++ b/xos/configurations/common/Makefile.prereqs
@@ -0,0 +1,34 @@
+UBUNTU:=$(shell which apt > /dev/null 2>&1; echo $$?)
+
+ifeq ($(UBUNTU),0)
+
+# ******************* apt-based distros ***************************
+prereqs: /usr/bin/http docker
+
+/usr/bin/http:
+ sudo apt-get -y install httpie
+
+docker:
+ which docker > /dev/null || wget -qO- https://get.docker.com/ | sh
+ sudo usermod -aG docker $(shell whoami)
+
+else
+
+# ****************** RPM-based distros ******************
+
+# (untested / work-in-progress)
+
+prereqs: /usr/bin/pip /usr/bin/http docker
+
+/usr/bin/pip:
+ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
+ sudo python ./get-pip.py
+
+docker:
+ which docker > /dev/null || wget -qO- https://get.docker.com/ | sh
+ sudo usermod -aG docker $(shell whoami)
+
+/usr/bin/http:
+ sudo pip install httpie
+
+endif