@@ -620,10 +620,11 @@ $(POWERVS_VALIDATE_TARGETS): deps-powervs
620620
621621.PHONY : $(NUTANIX_BUILD_TARGETS )
622622$(NUTANIX_BUILD_TARGETS ) : deps-nutanix set-ssh-password
623- $(eval NUTANIX_USERDATA:=$(shell cat $(abspath packer/nutanix/linux/cloud-init/$(subst -,/,$(if $(findstring ubuntu,$@ ) ,$(call GET_UBUNTU_DOTTED_SEMVER,$(subst build-nutanix-,,$@ ) ) ,$(subst build-nutanix-,,$@ ) ) ) /user-data) | base64 -w0) )
624- $(eval NUTANIX_VAR_FILE:=$(abspath packer/nutanix/$(subst build-nutanix-,,$@ ) .json) )
625- jq ' .user_data = "$(NUTANIX_USERDATA)"' $(NUTANIX_VAR_FILE ) > $(NUTANIX_VAR_FILE ) .templated && mv $(NUTANIX_VAR_FILE ) .templated $(NUTANIX_VAR_FILE )
623+ $(if $( findstring windows, $@ ) ,, $( eval NUTANIX_USERDATA:=$(shell cat $(abspath packer/nutanix/linux/cloud-init/$(subst -,/,$(if $(findstring ubuntu,$@ ) ,$(call GET_UBUNTU_DOTTED_SEMVER,$(subst build-nutanix-,,$@ ) ) ,$(subst build-nutanix-,,$@ ) ) ) /user-data) | base64 -w0) ) )
624+ $(if $( findstring windows, $@ ) ,, $( eval NUTANIX_VAR_FILE:=$(abspath packer/nutanix/$(subst build-nutanix-,,$@ ) .json) ) )
625+ $( if $( findstring windows, $@ ) ,, jq '.user_data = "$(NUTANIX_USERDATA ) "' $(NUTANIX_VAR_FILE ) > $(NUTANIX_VAR_FILE ) .templated && mv $(NUTANIX_VAR_FILE ) .templated $(NUTANIX_VAR_FILE ) )
626626 # This uses a packer file builder to input unattend variables into a JSON file to be consumed by the python script before running the nutanix provisioner
627+ $(if $(findstring windows,$@ ) ,$(PACKER ) build $(PACKER_WINDOWS_NODE_FLAGS ) -var-file="packer/nutanix/nutanix.json" -var-file="$(abspath packer/nutanix/$(subst build-nutanix-,,$@ ) .json) " -only=file $(ABSOLUTE_PACKER_VAR_FILES ) packer/nutanix/packer$(if $(findstring windows,$@ ) ,-windows,) .json,)
627628 $(if $(findstring windows,$@ ) ,hack/windows-unattend.py --unattend-file='./packer/nutanix/windows/$(subst build-nutanix-,,$@ ) /autounattend.xml',)
628629 $(PACKER ) build $(if $(findstring windows,$@ ) ,$(PACKER_WINDOWS_NODE_FLAGS ) ,$(PACKER_NODE_FLAGS ) ) -var-file=" packer/nutanix/nutanix.json" -var-file=" $( abspath packer/nutanix/$( subst build-nutanix-,,$@ ) .json) " $(ABSOLUTE_PACKER_VAR_FILES ) packer/nutanix/packer$(if $(findstring windows,$@ ) ,-windows,) .json
629630
0 commit comments