# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. Vagrant.configure("2") do |config| # From hashicorp default template: # https://github.com/hashicorp/packer/blob/master/builder/vagrant/step_create_vagrantfile.go#L23-L37 config.vm.define "source" do |source| source.vm.box = "{{.SourceBox}}" config.ssh.insert_key = {{.InsertKey}} end config.vm.define "output" do |output| output.vm.box = "{{.BoxName}}" output.vm.box_url = "file://package.box" config.ssh.insert_key = {{.InsertKey}} end {{ if ne .SyncedFolder "" -}} config.vm.synced_folder "{{.SyncedFolder}}", "/vagrant" {{- else -}} config.vm.synced_folder ".", "/vagrant", disabled: true {{- end}} {{ if eq .BoxName "microtvm-base-vmware_desktop" -}} config.vm.provision "shell", inline: "touch ~/skip_zeroing_disk", privileged: false {{- end}} # NOTE: base_box_setup.sh resides in the parent directory (../) because this template is expanded into a # sub-directory of base-box (output-packer-*). config.vm.provision "shell", path: "../base_box_setup.sh", privileged: false end