#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

# Example Vagrantfile for testing RPM/DEB installation on a
# convenient Vagrant box.
# Maps your public key to 'authorized_keys' on the vagrant.
# see note on 'source below'.

Vagrant.configure(2) do |config|
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024"
    vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
    vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
  end

  # change the 'source' below if necessary to match your public key file path
  config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/authorized_keys"
  config.vm.provision "shell", name:"set key permissions", privileged:false, inline: "chmod 400 ~/.ssh/authorized_keys"

  config.vm.define "apt-systemd" do |config|
    config.vm.box = "ubuntu/xenial64"
    config.vm.network "private_network", ip: "172.28.128.3"
    config.ssh.insert_key = true
    config.ssh.forward_agent = true
  end
  config.vm.define "apt-upstart" do |config|
    config.vm.box = "ubuntu/trusty64"
    config.vm.network "private_network", ip: "172.28.128.4"
  end
  config.vm.define "yum-systemd" do |config|
    config.vm.box = "bento/centos-7.3"
    config.vm.network "private_network", ip: "172.28.128.5"
  end
  config.vm.define "yum-upstart" do |config|
    config.vm.box = "nrel/CentOS-6.5-x86_64"
    config.vm.network "private_network", ip: "172.28.128.6"
  end
end
