on 01-Apr-2016 12:05
# -*- mode: ruby -*- # vi: set ft=ruby : VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "big-ip01.internal" do | v | v.vm.box = "/path/to/box/BIGIP-22.214.171.124.0.401.LTM_1SLOT-ide.box" config.vm.synced_folder ".", "/vagrant", disabled: true v.vm.network :forwarded_port, guest: 443, host: 10443 v.vm.provider :virtualbox do |p| p.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] p.customize ["modifyvm", :id, "--memory", 2048] p.customize ["modifyvm", :id, "--cpus", 2] p.customize ["modifyvm", :id, "--name", "big-ip01.internal"] p.customize ["modifyvm", :id, "--nic1", "nat"] p.customize ["modifyvm", :id, "--nictype1", "virtio"] p.customize ["modifyvm", :id, "--nic2", "hostonly"] p.customize ["modifyvm", :id, "--nictype2", "virtio"] p.customize ["modifyvm", :id, "--hostonlyadapter2", "vboxnet2"] end v.vm.provision "shell", inline:
box" line, we tell Vagrant where to find out box we created.
config.vm.synced_folder" line, is important because BIG-IP did not have the Virtual box Guest Additions installed on it. You can't install them because the kernel headers do not exist on your VE. So there is not ability to mount a shared folder using Vagrant's build in commands. Since vagrant tries to do this by default, we simply turn that feature off for this box.
forwarded_portline we Vagrant to accept connections to the host on port 10443 and forward them to port 443 on the BIG-IP. This allows us to reach the web UI. Why port 10443? Well, I make the assumption here that most folks will not be running vagrant as root. As such, you are not going to be able to bind to ports less than 1024. So I just follow a simple convention and add 10,000 to any port I want to add. This gets you out of the range of most common services and you're allowed to bind to these ports as a normal user.
==> big-ip01.internal: Setting hostname... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! hostname Stdout from the command: Stderr from the command: logname: no login name Use the TMOS shell utility to make changes to the system configuration. For more information, see "tmsh help sys global-settings."
virtio". This is important because BIG-IP doesn't
vboxnet2) that is provided by Virtualbox.
Vagrant provides convenience tools for this such as private_network, why not use those?
tmm. If you did use the
private_networkcommand, the problem is that
mcpd, and all the other things are ready to go.
v.vm.provision "shell", inline:
Hi Tim, I have been fooling around with your two articles on packer and vagrant. I want to use them for some ansible testing. Vagrant is specifying port 10443, how do you tell the ansible BigIP modules to use this port. I am not sure how to do this. Your help as always is greatly appreciated. -Tom
Thanks for replying so quickly, sorry I missed that option. Just tested it. Worked like a charm. FYI, to get sudo working in packer, I had to:
ln -s libaudit.so.1.0.0 libaudit.so.0
ln -s libldap-2.4.so.2.10.3 libldap-2.3.so.0
Also, in order to get the vboxnet interface working I had to:
VBoxManage hostonlyif create
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
Thanks again for your help! -Tom