summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 4e5f7d3..f4638dd 100644
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,8 @@
# TODO
# * support ssh as user instead of root
# * testing target
-PACKER=packer
-ANSIBLE_DIR=ansible-roles
-# the "provisioning" flavor, expects a 'setup-<flavor>.yml' playbook
-# in the 'ansible-roles' submodule! This will likely change...
-FLAVORS := $(patsubst $(ANSIBLE_DIR)/setup-%.yml,%, $(wildcard $(ANSIBLE_DIR)/setup-*.yml))
+PACKER = packer
+ANSIBLE_DIR = ansible-roles
SUPPORTED_BUILDERS = qemu virtualbox-iso vmware-iso
# check which hypervisors are available
ifeq ($(shell which qemu-system-$(shell uname -m | sed 's/i686/i386/') 2>&1 > /dev/null && echo $$?), 0)
@@ -35,7 +32,13 @@ ifneq ($(words $(MISSING_BUILDERS)), 0)
$(info )
endif
+##
+# Templates and flavors detection
+##
+# The packer templates, detected as *.json (excluding base.json)
TEMPLATES := $(basename $(filter-out base.json,$(wildcard *.json)))
+# The provisioning flavors, detected as ansible-roles/setup-<flavor>.yml
+FLAVORS := $(patsubst $(ANSIBLE_DIR)/setup-%.yml,%, $(wildcard $(ANSIBLE_DIR)/setup-*.yml))
BASETARGETS := $(foreach template, $(TEMPLATES), $(template)/base)
PROVTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $(template)/$(flavor)))