vagrant-aws
vagrant-aws copied to clipboard
vagrant package --vagrantfile --include not working when used with AWS
Hi,
The vagrant package command adds the new vagrantfile and the new include directory. But the embedded vagrantfile never executes because no "include" directive is in the new Vagrantfile.
For example, here is the structure of my *.box file after calling "vagrant package --vagrantfile --include
> tree .
├── Vagrantfile
├── box-disk1.vmdk
├── box.ovf
├── include
│ ├── _Vagrantfile
│ └── serverspec
│ ├── datadev_spec.rb
│ └── spec_helper.rb
└── metadata.json
If the provider is 'virtualbox', the top Vagrantfile will have this content:
Vagrant::Config.run do |config|
# This Vagrantfile is auto-generated by `vagrant package` to contain
# the MAC address of the box. Custom configuration should be placed in
# the actual `Vagrantfile` in this box.
config.vm.base_mac = "0800278C8B43"
end
# Load include vagrant file if it exists after the auto-generated
# so it can override any of the settings
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
load include_vagrantfile if File.exist?(include_vagrantfile)
However, if the provider is 'aws' the directory and files will be exactly the same as above, except that the Vagrantfile will contain:
Vagrant.configure("2") do |config|
config.vm.provider "aws" do |aws|
aws.region_config "us-east-1", ami: "ami-f00000"
end
end
The "include_vagrantfile" is missing.
version info:
Mac OS X (darwin14.1.0)
> vagrant version
Installed Version: 1.7.2
Latest Version: 1.7.2
> vagrant plugin list
vagrant-aws (0.6.0)
vagrant-awsinfo (0.0.8)
vagrant-centos7_fix (0.0.1)
vagrant-nuke (0.0.4)
vagrant-s3auth (1.0.3)
vagrant-serverspec (1.0.1)
vagrant-share (1.1.3, system)
Thanks, -T
+1. This is a pretty big bug and takes away an enormous amount of utility around packaging your own boxes. I know we're supposed to use Packer now (which doesn't appear to suffer this same problem), but still.