|
| 1 | +# -*- mode: ruby -*- |
| 2 | +# vi: set ft=ruby : |
| 3 | + |
| 4 | +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! |
| 5 | +VAGRANTFILE_API_VERSION = '2' |
| 6 | + |
| 7 | +Vagrant.require_version '>= 1.5.0' |
| 8 | + |
| 9 | +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 10 | + # All Vagrant configuration is done here. The most common configuration |
| 11 | + # options are documented and commented below. For a complete reference, |
| 12 | + # please see the online documentation at vagrantup.com. |
| 13 | + |
| 14 | + config.vm.hostname = 'suhosin-berkshelf' |
| 15 | + |
| 16 | + # Set the version of chef to install using the vagrant-omnibus plugin |
| 17 | + # NOTE: You will need to install the vagrant-omnibus plugin: |
| 18 | + # |
| 19 | + # $ vagrant plugin install vagrant-omnibus |
| 20 | + # |
| 21 | + if Vagrant.has_plugin?("vagrant-omnibus") |
| 22 | + config.omnibus.chef_version = 'latest' |
| 23 | + end |
| 24 | + |
| 25 | + # Every Vagrant virtual environment requires a box to build off of. |
| 26 | + # If this value is a shorthand to a box in Vagrant Cloud then |
| 27 | + # config.vm.box_url doesn't need to be specified. |
| 28 | + config.vm.box = 'chef/ubuntu-14.04' |
| 29 | + |
| 30 | + |
| 31 | + # Assign this VM to a host-only network IP, allowing you to access it |
| 32 | + # via the IP. Host-only networks can talk to the host machine as well as |
| 33 | + # any other machines on the same network, but cannot be accessed (through this |
| 34 | + # network interface) by any external networks. |
| 35 | + config.vm.network :private_network, type: 'dhcp' |
| 36 | + |
| 37 | + # Create a forwarded port mapping which allows access to a specific port |
| 38 | + # within the machine from a port on the host machine. In the example below, |
| 39 | + # accessing "localhost:8080" will access port 80 on the guest machine. |
| 40 | + |
| 41 | + # Share an additional folder to the guest VM. The first argument is |
| 42 | + # the path on the host to the actual folder. The second argument is |
| 43 | + # the path on the guest to mount the folder. And the optional third |
| 44 | + # argument is a set of non-required options. |
| 45 | + # config.vm.synced_folder "../data", "/vagrant_data" |
| 46 | + |
| 47 | + # Provider-specific configuration so you can fine-tune various |
| 48 | + # backing providers for Vagrant. These expose provider-specific options. |
| 49 | + # Example for VirtualBox: |
| 50 | + # |
| 51 | + # config.vm.provider :virtualbox do |vb| |
| 52 | + # # Don't boot with headless mode |
| 53 | + # vb.gui = true |
| 54 | + # |
| 55 | + # # Use VBoxManage to customize the VM. For example to change memory: |
| 56 | + # vb.customize ["modifyvm", :id, "--memory", "1024"] |
| 57 | + # end |
| 58 | + # |
| 59 | + # View the documentation for the provider you're using for more |
| 60 | + # information on available options. |
| 61 | + |
| 62 | + # The path to the Berksfile to use with Vagrant Berkshelf |
| 63 | + # config.berkshelf.berksfile_path = "./Berksfile" |
| 64 | + |
| 65 | + # Enabling the Berkshelf plugin. To enable this globally, add this configuration |
| 66 | + # option to your ~/.vagrant.d/Vagrantfile file |
| 67 | + config.berkshelf.enabled = true |
| 68 | + |
| 69 | + # An array of symbols representing groups of cookbook described in the Vagrantfile |
| 70 | + # to exclusively install and copy to Vagrant's shelf. |
| 71 | + # config.berkshelf.only = [] |
| 72 | + |
| 73 | + # An array of symbols representing groups of cookbook described in the Vagrantfile |
| 74 | + # to skip installing and copying to Vagrant's shelf. |
| 75 | + # config.berkshelf.except = [] |
| 76 | + |
| 77 | + config.vm.provision :chef_solo do |chef| |
| 78 | + chef.json = { |
| 79 | + mysql: { |
| 80 | + server_root_password: 'rootpass', |
| 81 | + server_debian_password: 'debpass', |
| 82 | + server_repl_password: 'replpass' |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + chef.run_list = [ |
| 87 | + 'recipe[suhosin::default]' |
| 88 | + ] |
| 89 | + end |
| 90 | +end |
0 commit comments