5 # This Vagrant file create a son-emu VM.
8 # All Vagrant configuration is done below. The "2" in Vagrant.configure
9 # configures the configuration version (we support older styles for
10 # backwards compatibility). Please don't change it unless you know what
12 Vagrant.configure(2) do |config|
13 # The most common configuration options are documented and commented below.
14 # For a complete reference, please see the online documentation at
15 # https://docs.vagrantup.com.
17 # Every Vagrant development environment requires a box. You can search for
18 # boxes at https://atlas.hashicorp.com/search.
20 # there is a bug in the /etc/hosts of 16.04: https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1561250
21 #config.vm.box = "ubuntu/xenial64"
23 # so we use 14.04 for now
24 config.vm.box = "ubuntu/trusty64"
27 # Disable automatic box update checking. If you disable this, then
28 # boxes will only be checked for updates when the user runs
29 # `vagrant box outdated`. This is not recommended.
30 # config.vm.box_check_update = false
32 # Create a forwarded port mapping which allows access to a specific port
33 # within the machine from a port on the host machine. In the example below,
34 # accessing "localhost:8080" will access port 80 on the guest machine.
35 config.vm.network "forwarded_port", guest: 5000, host: 5000
37 # Create a private network, which allows host-only access to the machine
38 # using a specific IP.
39 # config.vm.network "private_network", ip: "192.168.33.10"
41 # Create a public network, which generally matched to bridged network.
42 # Bridged networks make the machine appear as another physical device on
44 # config.vm.network "public_network"
46 # Share an additional folder to the guest VM. The first argument is
47 # the path on the host to the actual folder. The second argument is
48 # the path on the guest to mount the folder. And the optional third
49 # argument is a set of non-required options.
50 config.vm.synced_folder ".", "/vagrant", disabled: true
51 config.vm.synced_folder ".", "/home/vagrant/son-emu"
54 # Provider-specific configuration so you can fine-tune various
55 # backing providers for Vagrant. These expose provider-specific options.
56 # Example for VirtualBox:
58 config.vm.provider "virtualbox" do |vb|
60 # # Display the VirtualBox GUI when booting the machine
63 # # Customize the amount of memory on the VM:
67 # View the documentation for the provider you are using for more
68 # information on available options.
70 # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
71 # such as FTP and Heroku are also available. See the documentation at
72 # https://docs.vagrantup.com/v2/push/atlas.html for more information.
73 # config.push.define "atlas" do |push|
74 # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
77 # Enable provisioning with a shell script. Additional provisioners such as
78 # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
79 # documentation for more information about their specific syntax and use.
80 config.vm.provision "shell", inline: <<-SHELL
82 sudo apt-get install -y git ansible aptitude
83 sudo echo "localhost ansible_connection=local" >> /etc/ansible/hosts
84 # install containernet
85 git clone https://github.com/mpeuster/containernet.git
86 echo "Installing containernet (will take some time ~30 minutes) ..."
87 cd /home/vagrant/containernet/ansible
88 sudo ansible-playbook install.yml
91 echo "Installing son-emu (will take some time) ..."
92 cd /home/vagrant/son-emu/ansible
93 sudo ansible-playbook install.yml
95 # execute son-emu tests at the end to validate installation
96 echo "Running son-emu unit tests to validate installation"
97 cd /home/vagrant/son-emu
98 sudo python setup.py develop
102 sudo cp utils/vagrant/motd /etc/motd
105 # TODO the native ansible provisioner does not work so we directly call the shell commands
106 # install containernet using its ansible script
107 #config.vm.provision "ansible_local" do |ansible|
108 # ansible.provisioning_path = "/home/vagrant/containernet/ansible"
109 # ansible.playbook = "install.yml"
110 # ansible.sudo = true
111 # ansible.verbose = "v"
112 # ansible.limit = "all"