diff --git a/.gitignore b/.gitignore index 3e39dc4f..028d7cf7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ qemu/ virtualbox-iso/ vmware-iso/ - +packer_plugins/ +ansible/collections +ansible/roles # Created by https://www.gitignore.io/api/packer ### Packer ### @@ -12,8 +14,10 @@ packer_cache/ *.box # End of https://www.gitignore.io/api/packer -centos-7.3-x86_64 + .vault_pass +.vault_password *.retry .venv -centos-7.x-x86_64/ +.vscode +.idea diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d464c51f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributor information + +Images are built from each tag and published as +[GitHub releases](https://github.com/usegalaxy-eu/vgcn/releases). All releases (including old ones) are also available +[on this website](https://usegalaxy.eu/static/vgcn/). \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index e7a2a7c8..00000000 --- a/Makefile +++ /dev/null @@ -1,138 +0,0 @@ -# Simple Makefile to build base VM images using packer and ansible -# TODO -# * support ssh per user instead of root -# * support building with non-qemu builders and convert to qemu afterwards -# * testing target -# * auto-detect flavors -PACKER := $(shell which packer) -ifndef PACKER -$(error packer not found, please install it) -endif - -ANSIBLE_DIR=ansible-roles -# the "provisioning" flavor, expects a 'setup-.yml' playbook -# in the 'ansible-roles' submodule! This will likely change... -FLAVORS = vgcn-bwcloud vgcn-bwcloud-gpu vgcn-bwcloud-secure jenkins generic -SUPPORTED_BUILDERS = qemu -# check which hypervisors are available -ifeq ($(shell which qemu-system-$(shell uname -m | sed 's/i686/i386/') 2>&1 > /dev/null && echo $$?), 0) -AVAILABLE_BUILDERS += qemu -BUILDER := qemu -endif - -TEMPLATES := $(basename $(filter-out base.json,$(wildcard *.json))) - -BASETARGETS := $(foreach template, $(TEMPLATES), $(template)/base) -PROVTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $(template)/$(flavor))) -INTERNALTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $(template)/$(flavor)-internal)) -EXTERNALTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $(template)/$(flavor)-external)) - -PACKER_OPTS := -var-file=base.json -ifdef DEBUG - PACKER_OPTS += -debug - PACKER_OPTS += -var='headless=false' -endif - -.PHONY: all help clean -all: help - -## -# Creating base images -## -$(BASETARGETS): - $(info ** Building template '$(@D)' using '$(BUILDER)' **) - $(PACKER) build -only=$(BUILDER) \ - $(PACKER_OPTS) \ - -var='vm_name=$(@D)' \ - $(@D).json - @test -f output-$(@D)-$(BUILDER)/$(@D) || false - @-test -d $(@D)/base && rm -rf $(@D)/base - @-mkdir $(@D) - @mv output-$(@D)-$(BUILDER) $(@D)/base - @mv $(@D)/base/$(@D) $(@D)/base/image - @echo "** Success **" - -## -# Provisioning images -## -$(PROVTARGETS): deps -$(foreach flav, $(FLAVORS), %/$(flav)): %/base - $(info ** Provisioning '$(@D)' with '$(@F)' **) - $(PACKER) build -only=$(BUILDER) \ - $(PACKER_OPTS) \ - -var='vm_name=$(@F)' \ - -var='image_dir=$(@D)' \ - -var='image_name=base/image' \ - -var='playbook=setup-$(@F).yml' \ - $(ANSIBLE_DIR)/run-playbook-only.json - @test -f output-$(@D)/$(@F) || false - @-test -d $(@D)/$(@F) && rm -rf $(@D)/$(@F) - @-mkdir $(@D)/$(@F) - @mv output-$(@D)/$(@F) $(@D)/$(@F)/image - @rmdir output-$(@D) - @echo "** Success **" - - -# Internal image version -$(INTERNALTARGETS): -$(foreach flav, $(FLAVORS), %/$(flav)-internal): # bug: doesn't do deps right. - $(info ** Provisioning '$(@D)' with '$(@F)' **) - $(PACKER) build -only=$(BUILDER) \ - $(PACKER_OPTS) \ - -var='vm_name=$(@F)' \ - -var='image_dir=$(@D)' \ - -var='image_name=$(subst -internal,,$(@F))/image' \ - -var='playbook=internal.yml' \ - $(ANSIBLE_DIR)/run-playbook-only-internal.json - @test -f output-$(@D)/$(@F) || false - @-test -d $(@D)/$(@F) && rm -rf $(@D)/$(@F) - @-mkdir $(@D)/$(@F) - @mv output-$(@D)/$(@F) $(@D)/$(@F)/image - @rmdir output-$(@D) - @echo "** Success **" - -# external image version -$(EXTERNALTARGETS): -$(foreach flav, $(FLAVORS), %/$(flav)-external): # bug: doesn't do deps right. - $(info ** Provisioning '$(@D)' with '$(@F)' **) - $(PACKER) build -only=$(BUILDER) \ - $(PACKER_OPTS) \ - -var='vm_name=$(@F)' \ - -var='image_dir=$(@D)' \ - -var='image_name=$(subst -external,,$(@F))/image' \ - -var='playbook=external.yml' \ - $(ANSIBLE_DIR)/run-playbook-only.json - @test -f output-$(@D)/$(@F) || false - @-test -d $(@D)/$(@F) && rm -rf $(@D)/$(@F) - @-mkdir $(@D)/$(@F) - @mv output-$(@D)/$(@F) $(@D)/$(@F)/image - @rmdir output-$(@D) - @echo "** Success **" - -help: - @echo "General syntax: