Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vagrantfile base for Packer null build
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [
{
"type": "null",
"host": "machine.vagrant.dev",
"ssh_username": "vagrant",
"ssh_private_key_file": ".vagrant/machines/lew/virtualbox/private_key"
},
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-9a562df2",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "lew-{{timestamp}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["curl -sSL https://get.docker.com/ubuntu/ | sudo sh"]
},
{
"type": "shell",
"inline": [
"sudo docker run -p 80:8080 -d --restart=always somedockerrepo/somedockerproj"
]
}
]
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Requires the vagrant-landrush plugin
if Vagrant.has_plugin?('landrush')
config.landrush.enabled = true
config.landrush.tld = 'dev'
config.landrush.guest_redirect_dns = true
end
config.vm.define 'machine' do |base|
base.vm.provider 'virtualbox' do |v|
v.memory = 2048
v.cpus = 2
end
base.vm.box = 'ubuntu/trusty64'
base.vm.hostname = 'machine.vagrant.dev'
base.vm.network 'private_network', type: 'dhcp'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment