diff --git a/packer/README.md b/packer/README.md index 305101c..0e9da9b 100644 --- a/packer/README.md +++ b/packer/README.md @@ -1,11 +1,21 @@ -Creating VirtualBox/Vagrant box +Creating a Packer box --- +Create a host-only network interface for VirtualBox (unless ```ifconfig -a``` already lists ```vboxnet0```) +``` +VBoxManage hostonlyif create >/dev/null 2>&1 +``` + +Now assign an IP to this interface with a subnet that doesn't conflict with your home ones (avoid ```192.168.0.x```), for example ```192.168.23.x``` +``` +vboxmanage hostonlyif ipconfig vboxnet0 --ip 192.168.23.1 --netmask 255.255.255.0 +``` + Edit file ```alfresco-boxes/packer/precise-alf421.json``` to choose an IP that can be bridged to one of your host Network Interfaces: ``` { "type": "shell", "execute_command": "echo 'vagrant' | sudo -S sh '{{ .Path }}'", - "inline": ["/tmp/static-ip.sh 192.168.1.223 192.168.1.1 255.255.255.0"] + "inline": ["/tmp/static-ip.sh 192.168.23.223 192.168.23.1 255.255.255.0"] } ``` diff --git a/packer/precise-alf421.json b/packer/precise-alf421.json index 43feb9f..4c3cafb 100644 --- a/packer/precise-alf421.json +++ b/packer/precise-alf421.json @@ -56,6 +56,21 @@ } ], "provisioners": [ + { + "type": "file", + "source": "../common/scripts/common.sh", + "destination": "/home/vagrant/common.sh" + }, + { + "type": "file", + "source": "../common/scripts/static-ip.sh", + "destination": "/home/vagrant/static-ip.sh" + }, + { + "type": "shell", + "execute_command": "echo 'vagrant' | sudo -E -S sh '{{ .Path }}'", + "inline": ["chmod 755 /home/vagrant/static-ip.sh && /home/vagrant/static-ip.sh 192.168.23.23 192.168.23.1 255.255.255.0"] + }, { "cookbook_paths": [ "../common/vendor-cookbooks" @@ -96,16 +111,6 @@ "skip_install": false, "type": "chef-solo" }, - { - "type": "file", - "source": "../common/scripts/common.sh", - "destination": "/home/vagrant/common.sh" - }, - { - "type": "file", - "source": "../common/scripts/static-ip.sh", - "destination": "/home/vagrant/static-ip.sh" - }, { "type": "shell", "execute_command": "echo 'vagrant' | sudo -E -S sh '{{ .Path }}'", @@ -114,11 +119,6 @@ "../common/scripts/vagrant-ssh-key.sh", "../common/scripts/vbox-additions.sh" ] - }, - { - "type": "shell", - "execute_command": "echo 'vagrant' | sudo -E -S sh '{{ .Path }}'", - "inline": ["chmod 755 /home/vagrant/static-ip.sh && /home/vagrant/static-ip.sh 192.168.1.223 192.168.1.1 255.255.255.0"] } ] }