summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJonathan Bauer2018-02-07 18:09:06 +0100
committerJonathan Bauer2018-02-07 18:09:06 +0100
commit76a494bcfc74539304dc21f99267329e7c9765b7 (patch)
treee8e13f29a76d559131e10825e9e45bd8a5faadea /Makefile
parentMakefile: remove old/completed TODOs (diff)
downloadpacker-templates-76a494bcfc74539304dc21f99267329e7c9765b7.tar.gz
packer-templates-76a494bcfc74539304dc21f99267329e7c9765b7.tar.xz
packer-templates-76a494bcfc74539304dc21f99267329e7c9765b7.zip
Makefile: small formatting changes
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)))