├── vmware └── .gitignore ├── virtualbox └── .gitignore ├── cookbooks └── test │ ├── recipes │ └── default.rb │ └── metadata.rb ├── .gitignore ├── Vagrantfile ├── provision ├── base.sh ├── vagrant.sh ├── opsworks │ ├── client.yml │ └── pre_config.yml ├── cleanup.sh ├── opsworks.sh └── vmtools.sh ├── LICENSE.txt ├── preseed └── preseed.cfg ├── README.md ├── Rakefile ├── ubuntu14.04-opsworks.json └── ubuntu12.04-opsworks.json /vmware/.gitignore: -------------------------------------------------------------------------------- 1 | *.box -------------------------------------------------------------------------------- /virtualbox/.gitignore: -------------------------------------------------------------------------------- 1 | *.box -------------------------------------------------------------------------------- /cookbooks/test/recipes/default.rb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | packer_cache 2 | output-* 3 | .vagrant 4 | 5 | .DS_Store 6 | .idea -------------------------------------------------------------------------------- /cookbooks/test/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'test' 2 | version '1.0.0' -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 5 | VAGRANTFILE_API_VERSION = "2" 6 | 7 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 8 | config.vm.box = "ubuntu1404-opsworks" 9 | 10 | config.vm.provision :chef_solo do |chef| 11 | chef.cookbooks_path = "cookbooks/" 12 | chef.add_recipe "test" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /provision/base.sh: -------------------------------------------------------------------------------- 1 | # change the default frontend of debconf 2 | export DEBIAN_FRONTEND=noninteractive 3 | 4 | # enable multiverse repositories 5 | apt-get install -y software-properties-common 6 | add-apt-repository multiverse 7 | 8 | # update the package repository 9 | apt-get update 10 | 11 | # install system updates 12 | apt-get upgrade -y 13 | 14 | # force ubuntu to boot without gui interation 15 | echo "GRUB_RECORDFAIL_TIMEOUT=10" >> /etc/default/grub 16 | update-grub -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2013 Wouter Westenbrink 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /provision/vagrant.sh: -------------------------------------------------------------------------------- 1 | date > /etc/vagrant_box_build_time 2 | 3 | # Set up sudo. Be careful to set permission BEFORE copying file to sudoers.d 4 | ( cat <<'EOP' 5 | %vagrant ALL=NOPASSWD:ALL 6 | EOP 7 | ) > /tmp/vagrant 8 | chmod 0440 /tmp/vagrant 9 | mv /tmp/vagrant /etc/sudoers.d/ 10 | 11 | # Install vagrant keys 12 | mkdir /home/vagrant/.ssh 13 | chmod 700 /home/vagrant/.ssh 14 | cd /home/vagrant/.ssh 15 | wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys 16 | chmod 600 /home/vagrant/.ssh/authorized_keys 17 | chown -R vagrant /home/vagrant/.ssh 18 | 19 | # remove those annoying stdin: is not a tty messages when running vagrant 20 | sed -i "s/mesg n/tty -s \&\& mesg n/g" /root/.profile -------------------------------------------------------------------------------- /provision/opsworks/client.yml: -------------------------------------------------------------------------------- 1 | # opsworks chef client config file 2 | # /var/lib/aws/opsworks/client.yml 3 | --- 4 | 5 | :local_mode: true 6 | :log_level: :info 7 | :ohai_plugin_path: /opt/aws/opsworks/current/plugins 8 | :cookbook_path: ["/opt/aws/opsworks/current/merged-cookbooks"] 9 | :default_cookbooks_path: /opt/aws/opsworks/current/cookbooks 10 | :site_cookbooks_path: /opt/aws/opsworks/current/site-cookbooks 11 | :merged_cookbooks_path: /opt/aws/opsworks/current/merged-cookbooks 12 | :berkshelf_cookbooks_path: /opt/aws/opsworks/current/berkshelf-cookbooks 13 | :berkshelf_cache_path: /var/lib/aws/opsworks/berkshelf_cache 14 | :file_cache_path: /var/lib/aws/opsworks/cache 15 | :search_nodes_path: /var/lib/aws/opsworks/data/nodes 16 | :data_bag_path: /var/lib/aws/opsworks/data/data_bags 17 | -------------------------------------------------------------------------------- /provision/cleanup.sh: -------------------------------------------------------------------------------- 1 | # clean downloaded packages 2 | apt-get -y autoremove 3 | apt-get clean 4 | 5 | # Make sure Udev doesn't block our network 6 | # http://6.ptmc.org/?p=164 7 | echo "cleaning up udev rules" 8 | rm /etc/udev/rules.d/70-persistent-net.rules 9 | mkdir /etc/udev/rules.d/70-persistent-net.rules 10 | rm -rf /dev/.udev/ 11 | rm /lib/udev/rules.d/75-persistent-net-generator.rules 12 | 13 | echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" 14 | echo "pre-up sleep 2" >> /etc/network/interfaces 15 | 16 | # Clean up tmp 17 | rm -rf /tmp/* 18 | 19 | # Remove leftover leases 20 | if [ -d "/var/lib/dhcp" ]; then 21 | echo "cleaning up dhcp leases" 22 | rm /var/lib/dhcp/* 23 | fi 24 | 25 | # Zero out the free space to save space in the final image 26 | dd if=/dev/zero of=/EMPTY bs=1M 27 | rm -f /EMPTY 28 | # Block until the empty file has been removed, otherwise, Packer 29 | # will try to kill the box while the disk is still full and that's bad 30 | sync -------------------------------------------------------------------------------- /provision/opsworks.sh: -------------------------------------------------------------------------------- 1 | # install dependencies 2 | apt-get install -y curl libxml2-dev libxslt-dev libyaml-dev 3 | 4 | # create opsworks directories and seed them with expected config files 5 | mkdir -p /etc/aws/opsworks/ /opt/aws/opsworks/ /var/log/aws/opsworks/ /var/lib/aws/opsworks/ /var/lib/cloud/ 6 | cp opsworks/* /var/lib/aws/opsworks/ 7 | 8 | # download and install opsworks-agent and all support files 9 | cd $(mktemp -d) 10 | wget -O opsworks-agent.tgz https://opsworks-instance-agent.s3.amazonaws.com/3425-20150727112318/opsworks-agent-installer.tgz 11 | tar -xvzpof opsworks-agent.tgz 12 | cd opsworks-agent-installer/opsworks-agent/bin/ 13 | ./installer_wrapper.sh -R opsworks-instance-assets.s3.amazonaws.com 14 | 15 | # ensure we can access the opsworks chef gem 16 | echo "export PATH=\$PATH:/opt/aws/opsworks/current/bin" > /etc/profile.d/opsworks_path.sh 17 | 18 | # don't automatically run opsworks-agent 19 | rm -f /etc/monit.d/opsworks-agent.monitrc /etc/monit/conf.d/opsworks-agent.monitrc 20 | -------------------------------------------------------------------------------- /provision/vmtools.sh: -------------------------------------------------------------------------------- 1 | if [ -f /home/vagrant/.vbox_version ]; then 2 | echo "Installing VirtualBox guest additions" 3 | 4 | apt-get install -y linux-headers-$(uname -r) build-essential perl dkms 5 | 6 | mount -o loop /home/vagrant/VBoxGuestAdditions.iso /mnt 7 | sh /mnt/VBoxLinuxAdditions.run 8 | umount /mnt 9 | rm /home/vagrant/VBoxGuestAdditions.iso 10 | fi 11 | 12 | if [ -f /home/vagrant/vmware_tools.iso ]; then 13 | echo "Installing VMWare Tools" 14 | 15 | #Set Linux-specific paths and ISO filename 16 | home_dir="/home/vagrant" 17 | iso_name="vmware_tools.iso" 18 | mount_point="/tmp/vmware-tools" 19 | 20 | #Run install, unmount ISO and remove it 21 | mkdir ${mount_point} 22 | cd ${home_dir} 23 | /bin/mount -o loop ${iso_name} ${mount_point} 24 | tar zxf ${mount_point}/*.tar.gz && cd vmware-tools-distrib && ./vmware-install.pl --default 25 | /bin/umount ${mount_point} 26 | /bin/rm -rf ${home_dir}/${iso_name} ${home_dir}/vmware-tools-distrib 27 | rmdir ${mount_point} 28 | fi -------------------------------------------------------------------------------- /preseed/preseed.cfg: -------------------------------------------------------------------------------- 1 | choose-mirror-bin mirror/http/proxy string 2 | d-i base-installer/kernel/override-image string linux-server 3 | d-i clock-setup/utc boolean true 4 | d-i clock-setup/utc-auto boolean true 5 | d-i finish-install/reboot_in_progress note 6 | d-i grub-installer/only_debian boolean true 7 | d-i grub-installer/with_other_os boolean true 8 | d-i partman-auto-lvm/guided_size string max 9 | d-i partman-auto/choose_recipe select atomic 10 | d-i partman-auto/method string lvm 11 | d-i partman-lvm/confirm boolean true 12 | d-i partman-lvm/confirm boolean true 13 | d-i partman-lvm/confirm_nooverwrite boolean true 14 | d-i partman-lvm/device_remove_lvm boolean true 15 | d-i partman/choose_partition select finish 16 | d-i partman/confirm boolean true 17 | d-i partman/confirm_nooverwrite boolean true 18 | d-i partman/confirm_write_new_label boolean true 19 | d-i passwd/user-fullname string vagrant 20 | d-i passwd/user-uid string 900 21 | d-i passwd/user-password password vagrant 22 | d-i passwd/user-password-again password vagrant 23 | d-i passwd/username string vagrant 24 | d-i pkgsel/include string openssh-server build-essential dkms 25 | d-i pkgsel/install-language-support boolean false 26 | d-i pkgsel/update-policy select unattended-upgrades 27 | d-i pkgsel/upgrade select full-upgrade 28 | d-i time/zone string UTC 29 | d-i user-setup/allow-password-weak boolean true 30 | d-i user-setup/encrypt-home boolean false 31 | tasksel tasksel/first multiselect standard, ubuntu-server -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vagrant-opsworks 2 | 3 | The main goal of this project is building vagrant boxes for developing & testing cookbooks you plan to use in Amazon Opsworks. 4 | 5 | Use this project to build a Ubuntu 14.04 LTS (or Ubuntu 12.04.5 LTS) box provisioned with opsworks ruby2.0.0-p481 and chef 11.10.4 from agent release 3425. 6 | 7 | You may have noticed the new opsworks agent using chef-client with chef-zero now, be aware this box only provides chef-solo. 8 | 9 | The previous release of this project (for opsworks chef version 11.4.4) is preserved in the chef-11.4 branch. 10 | 11 | # Dependencies 12 | 13 | * [Packer](http://www.packer.io/) 14 | * [VirtualBox](https://www.virtualbox.org/) or [VMware fusion](http://www.vmware.com/products/fusion/) 15 | * [Vagrant](http://www.vagrantup.com/) 16 | * [rake](http://rake.rubyforge.org/) 17 | 18 | # Usage 19 | 20 | # build the vagrant virtual box 21 | rake virtualbox-build 22 | 23 | # install the vagrant virtual box 24 | rake virtualbox-install 25 | 26 | # build the vagrant vmware box 27 | rake vmware-build 28 | 29 | # install the vagrant vmware box 30 | rake vmware-install 31 | 32 | # check out your new box with provided Vagrant file 33 | vagrant up [--provider=vmware_fusion] 34 | 35 | # clean up builded boxes 36 | rake clean 37 | 38 | # build or install an Ubuntu 12.04.5 box by prepending "precise:" 39 | rake precise:virtualbox-build 40 | rake precise:virtualbox-install 41 | 42 | # Notes 43 | 44 | * Uses the latest release of [Ubuntu 14.04 LTS](http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso) or [Ubuntu 12.04 LTS](http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso) 45 | 46 | # References 47 | * [AWS OpsWorks](http://aws.amazon.com/opsworks/) 48 | * https://github.com/misheska/basebox-packer 49 | * https://github.com/opscode/bento 50 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | namespace 'precise' do 2 | task 'virtualbox-build' => 'precise:clean' do 3 | system 'packer build -only=virtualbox-iso ubuntu12.04-opsworks.json' 4 | end 5 | 6 | task 'virtualbox-install' do 7 | system 'vagrant box remove ubuntu1204-opsworks --provider virtualbox' 8 | system 'vagrant box add ubuntu1204-opsworks virtualbox/ubuntu1204-opsworks.box' 9 | end 10 | 11 | task 'vmware-build' => 'precise:clean' do 12 | system 'packer build -only=vmware-iso ubuntu12.04-opsworks.json' 13 | end 14 | 15 | task 'vmware-install' do 16 | system 'vagrant box remove ubuntu1204-opsworks --provider vmware_desktop' 17 | system 'vagrant box add ubuntu1204-opsworks vmware/ubuntu1204-opsworks.box' 18 | end 19 | 20 | task 'clean' do 21 | system 'rm -f virtualbox/ubuntu1204-opsworks.box vmware/ubuntu1204-opsworks.box' 22 | end 23 | end 24 | 25 | namespace 'trusty' do 26 | task 'virtualbox-build' => 'trusty:clean' do 27 | system 'packer build -only=virtualbox-iso ubuntu14.04-opsworks.json' 28 | end 29 | 30 | task 'virtualbox-install' do 31 | system 'vagrant box remove ubuntu1404-opsworks --provider virtualbox' 32 | system 'vagrant box add ubuntu1404-opsworks virtualbox/ubuntu1404-opsworks.box' 33 | end 34 | 35 | task 'vmware-build' => 'trusty:clean' do 36 | system 'packer build -only=vmware-iso ubuntu14.04-opsworks.json' 37 | end 38 | 39 | task 'vmware-install' do 40 | system 'vagrant box remove ubuntu1404-opsworks --provider vmware_desktop' 41 | system 'vagrant box add ubuntu1404-opsworks vmware/ubuntu1404-opsworks.box' 42 | end 43 | 44 | task 'clean' do 45 | system 'rm -f virtualbox/ubuntu1404-opsworks.box vmware/ubuntu1404-opsworks.box' 46 | end 47 | end 48 | 49 | task 'virtualbox-build' => 'trusty:virtualbox-build' 50 | task 'virtualbox-install' => 'trusty:virtualbox-install' 51 | task 'vmware-build' => 'trusty:vmware-build' 52 | task 'vmware-install' => 'trusty:vmware-install' 53 | task 'clean' => ['precise:clean', 'trusty:clean'] 54 | -------------------------------------------------------------------------------- /provision/opsworks/pre_config.yml: -------------------------------------------------------------------------------- 1 | # opsworks-agent pre-config file 2 | # /var/lib/aws/opsworks/pre_config.yml 3 | --- 4 | 5 | :hostname: opsworks-vagrant 6 | :identity: ffffffff-ffff-ffff-ffff-ffffffffffff 7 | :agent_installer_base_url: opsworks-instance-agent.s3.amazonaws.com 8 | :agent_installer_tgz: opsworks-agent-installer.tgz 9 | :verbose: false 10 | :instance_service_region: us-east-1 11 | :instance_service_endpoint: localhost 12 | :instance_service_port: '65535' 13 | :instance_public_key: | 14 | -----BEGIN PUBLIC KEY----- 15 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA30W1qY/kuT3H0QJAWaOs 16 | 0tLI8E64OKKCsK6908NL8ReroxsYHZHjzl5+ZNw7YE4QENBZ4eWR4gbC2z/YT/5b 17 | U6LrZZUCuIdSL+9cMyBUUOTEV1W1Z5EtZkB8PgoDm2+SSDnL9F6Tww+oiD27kA4n 18 | xa68i6Y0+tGARAkC11tX7z7Yg0cfkLYXcY3weueXagbIdF+esxuVFXj+Jz/oyBwP 19 | qU1lVWQ1b3ZYv2XPnmMuJPfdENI/0YHkXm1JMhdseEUPS3TuZalqpDIbG/9m1ZMB 20 | GiH5UUshMm2GldDjjEnVV024K+WFi7ww76+pJcdZ8NcyLXVzLEH/CiwhnQigFzw3 21 | xQIDAQAB 22 | -----END PUBLIC KEY----- 23 | :instance_private_key: | 24 | -----BEGIN RSA PRIVATE KEY----- 25 | MIIEpAIBAAKCAQEA30W1qY/kuT3H0QJAWaOs0tLI8E64OKKCsK6908NL8ReroxsY 26 | HZHjzl5+ZNw7YE4QENBZ4eWR4gbC2z/YT/5bU6LrZZUCuIdSL+9cMyBUUOTEV1W1 27 | Z5EtZkB8PgoDm2+SSDnL9F6Tww+oiD27kA4nxa68i6Y0+tGARAkC11tX7z7Yg0cf 28 | kLYXcY3weueXagbIdF+esxuVFXj+Jz/oyBwPqU1lVWQ1b3ZYv2XPnmMuJPfdENI/ 29 | 0YHkXm1JMhdseEUPS3TuZalqpDIbG/9m1ZMBGiH5UUshMm2GldDjjEnVV024K+WF 30 | i7ww76+pJcdZ8NcyLXVzLEH/CiwhnQigFzw3xQIDAQABAoIBAQDF6Ji6kJ4BxU2V 31 | axV3X6oVxlnvCRgqu4J08q+5QefS8VRm4+FgdK0lhIUtCjpnh0qeXNEPd9r0K2IV 32 | zmYDokd5v3RBOvCKeQjVDKsBdqrGecHAWGzQPNOtS4PVyjKgWSmlc/XhyuPXh82v 33 | 1minrKR8igL/Fnjny0STChnGo2Uy3y3X089VIWlkKskSTLe73jTN7EeI47+LHJul 34 | ULiV8Oh7YbEHf4w6Fz+1LNxcCJg8rNYeJKrGbCBq/ImygiJp14+oTU2nCDQSBJqF 35 | bdUPhtpQDlDsAsfgBavYb3fHc0ZBVbCwM84VSdktKz9QbINI2Ugh+lI201woORlZ 36 | MCqClgwRAoGBAPs1vapbsNbb+zRIxKRKfOLcay3O9efPyUqOPIMmn3pbpxk0GEBg 37 | KQXO5PZmDP25oLA3bLvowVMMgShY1WRAr7ReloIRHaARVo+If8c7G83nePycYZ3f 38 | C/ztfzsKpBO2SVzUkQIzh6rogK/rKUa/FCwZ/Gnf93v/j5RyUmLWXoZrAoGBAOOH 39 | l/yCaxdY5khc1uEbCQDzT9lqWKcgFjoVuWO7o4vallNIDnCDd7olGbR2oIWbJAtB 40 | mKpXLIWVjcRPXGp9Kr07mvkL+/mO2m6tG/vFJDh5Jge/qoOK4d1KEb2y+PwK+XRK 41 | /SkAEcT6qpLMdz5W/Oy/wBc8b/BeBJkSoF1/weaPAoGAZ3eGDBHB720htTI3k/d+ 42 | Iq5okrCIhhcGMGgPMnGJBAuV8oKLbpBstRC3K2ly9lorfgkGBwth/QPMesLD+YvP 43 | ErpWwXGtQw2BGpM9FeEZnaA2K815Q13oASAM5FOIqvnMk6iVpVN2EIW84zg3gwUW 44 | mOeHGFCADZmAGMNRfZYPzssCgYAnCWB+JjIRc2MvDx6eyHCnBReyCZjkM5EcrhV8 45 | kvjgScR4zWgMzcGA4lSiraekxJVOiRaUQxiUYrBL+gG1E3x9svhHulKk4ml/i5u9 46 | enlYZxCrS6sJno5Z1RduIIKvW4Ko/SSqICTsUsVpIkNjIrGKPOvMEMZzyu2nBZcV 47 | 85Fk6QKBgQDLfvbS010HhYuEoW9NtSgeSxaJaCTU82EURBoL3F1umPcc1+EmtvnE 48 | WbjdSwiVT7tb8F/yM6wIGjHEaNdIPdIakHEPU4MfJFDe/+aPwk2M1MCCpbERgyJR 49 | m4SlK1pWQsPZ6Em0C+bw+dnkThEXXb3kfWSxnuh0d7JjfX+Fd/8F6Q== 50 | -----END RSA PRIVATE KEY----- 51 | :charlie_public_key: | 52 | -----BEGIN PUBLIC KEY----- 53 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAni7eKdm34oaCvGiw96Fk 54 | lyLX+aPfInYzilkk+AY3pXF6nijpQ2cm3ZeM2EoqZFTv3a/meosNBAs3Q3Sy1e4G 55 | 7Ibn/xwMof+iSBvimx3PGKFzNP0BhY9yS6AMEMxtmqksHb0glwmFeJcomdhxZV1F 56 | ziWTtL6ZEyvCg0I7rxGm1ceQmD25eK90VcZVh4LJtNfnwcZRM4eC+KK9Qllxw5hW 57 | vB4Z52JMMZbEG9MYCLydWSY9rnVkAyQ0ngJUaJ3q7JsbkBV/J5BcrGgcbioR1k+h 58 | INRoHwBQU9WnT/x8W+N6vwJb4o6v2hBR1H2GSDLwyZ7wC8EVH+XafWYpU1g/nSEe 59 | aQIDAQAB 60 | -----END PUBLIC KEY----- 61 | :wait_between_runs: '60' 62 | -------------------------------------------------------------------------------- /ubuntu14.04-opsworks.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "vm_name": "ubuntu1404-opsworks", 5 | "type": "virtualbox-iso", 6 | "guest_os_type": "Ubuntu_64", 7 | "http_directory": "preseed", 8 | "iso_urls": [ 9 | "http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso", 10 | "http://nl.releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso" 11 | ], 12 | "iso_checksum": "9e5fecc94b3925bededed0fdca1bd417", 13 | "iso_checksum_type": "md5", 14 | "ssh_username": "vagrant", 15 | "ssh_password": "vagrant", 16 | "ssh_wait_timeout": "10000s", 17 | "boot_wait": "5s", 18 | "boot_command": [ 19 | "", 20 | "/install/vmlinuz noapic ", 21 | "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", 22 | "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", 23 | "hostname={{ .Name }} ", 24 | "fb=false debconf/frontend=noninteractive ", 25 | "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", 26 | "keyboard-configuration/variant=USA console-setup/ask_detect=false ", 27 | "initrd=/install/initrd.gz -- " 28 | ], 29 | "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", 30 | "hard_drive_interface": "sata", 31 | "disk_size": 10140, 32 | "vboxmanage": [ 33 | ["modifyvm", "{{.Name}}", "--memory", "512"], 34 | ["modifyvm", "{{.Name}}", "--cpus", "1"] 35 | ], 36 | "headless": true 37 | }, 38 | { 39 | "vm_name": "ubuntu1404-opsworks", 40 | "type": "vmware-iso", 41 | "guest_os_type": "ubuntu-64", 42 | "boot_wait": "10s", 43 | "boot_command": [ 44 | "", 45 | "/install/vmlinuz ", 46 | "preseed/url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg ", 47 | "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", 48 | "hostname={{.Name}} ", 49 | "fb=false debconf/frontend=noninteractive ", 50 | "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", 51 | "keyboard-configuration/variant=USA console-setup/ask_detect=false ", 52 | "initrd=/install/initrd.gz -- " 53 | ], 54 | "disk_size": 10140, 55 | "http_directory": "preseed", 56 | "iso_urls": [ 57 | "http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso", 58 | "http://nl.releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso" 59 | ], 60 | "iso_checksum": "9e5fecc94b3925bededed0fdca1bd417", 61 | "iso_checksum_type": "md5", 62 | "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", 63 | "ssh_password": "vagrant", 64 | "ssh_port": 22, 65 | "ssh_username": "vagrant", 66 | "ssh_wait_timeout": "10000s", 67 | "tools_upload_flavor": "linux", 68 | "tools_upload_path": "/home/vagrant/vmware_tools.iso", 69 | "vmx_data": { 70 | "cpuid.coresPerSocket": "1", 71 | "memsize": "512", 72 | "numvcpus": "1" 73 | }, 74 | "headless": true 75 | } 76 | ], 77 | "provisioners": [ 78 | { 79 | "type": "file", 80 | "source": "provision", 81 | "destination": "/tmp" 82 | }, 83 | { 84 | "type": "shell", 85 | "inline": [ 86 | "cd /tmp && chmod -R +x provision/" 87 | ] 88 | }, 89 | { 90 | "type": "shell", 91 | "inline": [ 92 | "cd /tmp/provision", 93 | "./base.sh", 94 | "./opsworks.sh", 95 | "./vmtools.sh", 96 | "./vagrant.sh", 97 | "./cleanup.sh" 98 | ], 99 | "execute_command": "echo 'vagrant'|{{.Vars}} sudo -E -S bash '{{.Path}}'" 100 | } 101 | ], 102 | "post-processors": [{ 103 | "type": "vagrant", 104 | "output": "{{.Provider}}/ubuntu1404-opsworks.box" 105 | }] 106 | } 107 | -------------------------------------------------------------------------------- /ubuntu12.04-opsworks.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "vm_name": "ubuntu1204-opsworks", 5 | "type": "virtualbox-iso", 6 | "guest_os_type": "Ubuntu_64", 7 | "http_directory": "preseed", 8 | "iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso", 9 | "iso_checksum": "af224223de99e2a730b67d7785b657f549be0d63221188e105445f75fb8305c9", 10 | "iso_checksum_type": "sha256", 11 | "ssh_username": "vagrant", 12 | "ssh_password": "vagrant", 13 | "ssh_wait_timeout": "10000s", 14 | "boot_command": [ 15 | "", 16 | "/install/vmlinuz noapic ", 17 | "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", 18 | "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", 19 | "hostname={{ .Name }} ", 20 | "fb=false debconf/frontend=noninteractive ", 21 | "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", 22 | "keyboard-configuration/variant=USA console-setup/ask_detect=false ", 23 | "initrd=/install/initrd.gz -- " 24 | ], 25 | "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", 26 | "disk_size": 10140, 27 | "vboxmanage": [ 28 | ["modifyvm", "{{.Name}}", "--memory", "512"], 29 | ["modifyvm", "{{.Name}}", "--cpus", "1"] 30 | ], 31 | "headless": true 32 | }, 33 | { 34 | "vm_name": "ubuntu1204-opsworks", 35 | "type": "vmware-iso", 36 | "boot_command": [ 37 | "", 38 | "", 39 | "", 40 | "/install/vmlinuz", 41 | " auto", 42 | " console-setup/ask_detect=false", 43 | " console-setup/layoutcode=us", 44 | " console-setup/modelcode=pc105", 45 | " debconf/frontend=noninteractive", 46 | " debian-installer=en_US", 47 | " fb=false", 48 | " initrd=/install/initrd.gz", 49 | " kbd-chooser/method=us", 50 | " keyboard-configuration/layout=USA", 51 | " keyboard-configuration/variant=USA", 52 | " locale=en_US", 53 | " netcfg/get_domain=vm", 54 | " netcfg/get_hostname=vagrant", 55 | " noapic", 56 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", 57 | " -- ", 58 | "" 59 | ], 60 | "boot_wait": "10s", 61 | "disk_size": 10140, 62 | "guest_os_type": "ubuntu-64", 63 | "http_directory": "preseed", 64 | "iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso", 65 | "iso_checksum": "af224223de99e2a730b67d7785b657f549be0d63221188e105445f75fb8305c9", 66 | "iso_checksum_type": "sha256", 67 | "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", 68 | "ssh_password": "vagrant", 69 | "ssh_port": 22, 70 | "ssh_username": "vagrant", 71 | "ssh_wait_timeout": "10000s", 72 | "tools_upload_flavor": "linux", 73 | "tools_upload_path": "/home/vagrant/vmware_tools.iso", 74 | "vmx_data": { 75 | "cpuid.coresPerSocket": "1", 76 | "memsize": "512", 77 | "numvcpus": "1" 78 | }, 79 | "headless": true 80 | } 81 | ], 82 | "provisioners": [ 83 | { 84 | "type": "file", 85 | "source": "provision", 86 | "destination": "/tmp" 87 | }, 88 | { 89 | "type": "shell", 90 | "inline": [ 91 | "cd /tmp && chmod -R +x provision/" 92 | ] 93 | }, 94 | { 95 | "type": "shell", 96 | "inline": [ 97 | "cd /tmp/provision", 98 | "./base.sh", 99 | "./opsworks.sh", 100 | "./vmtools.sh", 101 | "./vagrant.sh", 102 | "./cleanup.sh" 103 | ], 104 | "execute_command": "echo 'vagrant'|{{.Vars}} sudo -E -S bash '{{.Path}}'" 105 | } 106 | ], 107 | "post-processors": [{ 108 | "type": "vagrant", 109 | "output": "{{.Provider}}/ubuntu1204-opsworks.box" 110 | }] 111 | } 112 | --------------------------------------------------------------------------------