diff options
author | Manuel Messner | 2018-02-12 16:11:55 +0100 |
---|---|---|
committer | Manuel Messner | 2018-02-12 16:11:55 +0100 |
commit | ec9e3027ed5f3505f2bc92452e79ed6a4909cb74 (patch) | |
tree | 4af61cdd97336f5938c034dbb12a5344275bcadb /Makefile | |
parent | Makefile: add timestamp to verbose output (diff) | |
download | packer-templates-ec9e3027ed5f3505f2bc92452e79ed6a4909cb74.tar.gz packer-templates-ec9e3027ed5f3505f2bc92452e79ed6a4909cb74.tar.xz packer-templates-ec9e3027ed5f3505f2bc92452e79ed6a4909cb74.zip |
Makefile: add spacing
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -5,20 +5,25 @@ PACKER = packer ANSIBLE_DIR = ansible-roles + # check which hypervisors are available ifndef BUILDER ifeq ($(shell which qemu-system-$(shell uname -m | sed 's/i686/i386/') 2>&1 > /dev/null && echo $$?), 0) AVAILABLE_BUILDERS += qemu endif + ifeq ($(shell which virtualbox 2>&1 > /dev/null && echo $$?), 0) AVAILABLE_BUILDERS += virtualbox-iso endif + ifeq ($(shell which vmplayer 2>&1 > /dev/null && echo $$?), 0) AVAILABLE_BUILDERS += vmware-iso endif + BUILDER := $(firstword $(AVAILABLE_BUILDERS)) endif + ## # Templates and flavors detection ## @@ -32,6 +37,7 @@ PROVTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $ BOOTTARGETS := $(foreach template, $(TEMPLATES), $(template)/base/boot) BOOTTARGETS += $(foreach prov, $(PROVTARGETS), $(prov)/boot) + PACKER_OPTS := -var-file=base.json ifdef DEBUG VERBOSE := 1 @@ -39,6 +45,7 @@ ifdef DEBUG PACKER_OPTS += -var='headless=false' endif + TIMESTAMP := $(shell date "+%Y-%m-%d_%H-%M-%S") @@ -80,6 +87,7 @@ $(BASETARGETS): -var='output_directory=$(@D)/base' \ $(@D).json + ## # Provisioning images ## @@ -99,6 +107,7 @@ $(foreach flav, $(FLAVORS), %/$(flav)): %/base -var='playbook=setup-$(@F).yml' \ $(BUILD_DIR)/$(ANSIBLE_DIR)/run-playbook-only.json + ## # Generating boot files ## @@ -117,10 +126,12 @@ $(BOOTTARGETS): $(BUILD_DIR)/$(ANSIBLE_DIR)/run-playbook-only.json @mv $(BUILD_DIR)/$(ANSIBLE_DIR)/boot_files $(BUILD_DIR)/build/boot + # The builds are directories named after the template name clean: -$(foreach build_dir,$(TEMPLATES),test -d $(build_dir) && rm -rf $(build_dir);) + help: @printf "Usage:\n\tmake <template>/<flavor>[/boot]\n" @echo |