Skip to content

Instantly share code, notes, and snippets.

@jjn1056
Last active June 27, 2018 20:30
Show Gist options
  • Save jjn1056/90840b35a6210832060d138233c761bb to your computer and use it in GitHub Desktop.
Save jjn1056/90840b35a6210832060d138233c761bb to your computer and use it in GitHub Desktop.
mm-mac-3273:regops jnapiorkowski$ vagrant up
Bringing machine 'virtualbox' up with 'virtualbox' provider...
==> virtualbox: Box 'reg/application_node' could not be found. Attempting to find and install...
virtualbox: Box Provider: virtualbox
virtualbox: Box Version: >= 0
==> virtualbox: Box file was not detected as metadata. Adding it directly...
==> virtualbox: Adding box 'reg/application_node' (v0) for provider: virtualbox
virtualbox: Unpacking necessary files from: file:///Users/jnapiorkowski/Desktop/regops/packer/reg_vagrant_virtualboxubuntu_18.04.json
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and that enough disk space
is available and then try again.
The output from attempting to unpackage (if any):
bsdtar: Error opening archive: Unrecognized archive format
=========== vagrantfile below
Vagrant.configure(2) do |config|
config.vm.box = "reg/application_node"
config.vm.box_check_update = true
config.vm.box_url = "file://" + ENV['PWD'] + "/packer/reg_vagrant_virtualboxubuntu_18.04.json"
config.ssh.forward_agent = true
config.ssh.username = 'vagrant'
config.ssh.password = 'vagrant'
config.vm.synced_folder '.', '/vagrant', disabled: true
if Vagrant.has_plugin?("vagrant-sshfs")
if File.exists? File.expand_path('~/src')
config.vm.synced_folder "~/src", "/var/www/src",
disabled: false,
type: "sshfs",
reverse: true
end
end
config.vm.define "virtualbox", autostart: true do |vb_vm|
vb_vm.vm.provider :virtualbox do |v, override|
override.vm.network "forwarded_port", guest: 80, host: 8080
#override.vm.network "forwarded_port", guest: 443, host: 8443
override.vm.network "forwarded_port", guest: 3000, host: 3000
override.vm.network "forwarded_port", guest: 5432, host: 5433
override.vm.network "private_network", ip: "192.168.33.10"
end
end
config.vm.provision "file", source: "sql/reg_may28_2018.sql.gz", destination: "reg_may28_2018.sql.gz"
config.vm.provision "shell", privileged: false, inline: <<-SHELL
pv reg_may28_2018.sql.gz | gunzip | mysql
rm -rf reg_may28_2018.sql
git config --global user.name "#{ENV['GIT_USERNAME']}"
git config --global user.email "#{ENV['GIT_EMAIL']}"
cd /var/www/src && git pull --rebase origin cloudkali && cd -
sudo su --login -c 'cd /var/www/src && cpanm --notest --verbose --installdeps .'
SHELL
end
================= The JSON catalog
{
"description": "Machine Image to run Reg",
"name": ""reg/application_node",
"versions": [
{
"providers": [
{
"name": "virtualbox",
"url": "file:///./reg_vagrant_virtualboxubuntu_18.04.box"
}
],
"version": "0.0.1"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment