github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/builtin/app/custom/data/dev/Vagrantfile.tpl (about)

     1  Vagrant.configure("2") do |config|
     2    config.vm.box = "hashicorp/precise64"
     3  
     4    # Setup some stuff
     5    config.vm.provision "shell", inline: $script
     6  
     7    # Foundation configuration (if any)
     8    {% for dir in foundation_dirs.dev %}
     9    dir = "/otto/foundation-{{ forloop.Counter }}"
    10    config.vm.synced_folder "{{ dir }}", dir
    11    config.vm.provision "shell", inline: "cd #{dir} && bash #{dir}/main.sh"
    12    {% endfor %}
    13  
    14    # Read in the fragment that we use as a dep
    15    {{ fragment_path|read }}
    16  
    17    ["vmware_fusion", "vmware_workstation"].each do |name|
    18      config.vm.provider(name) do |p|
    19        p.enable_vmrun_ip_lookup = false
    20      end
    21    end
    22  
    23    config.vm.provider :parallels do |p, o|
    24      o.vm.box = "parallels/ubuntu-12.04"
    25    end
    26  end
    27  
    28  $script = <<SCRIPT
    29  set -e
    30  
    31  # otto-exec: execute command with output logged but not displayed
    32  oe() { $@ 2>&1 | logger -t otto > /dev/null; }
    33  
    34  # otto-log: output a prefixed message
    35  ol() { echo "[otto] $@"; }
    36  
    37  # Configuring SSH for faster login
    38  if ! grep "UseDNS no" /etc/ssh/sshd_config >/dev/null; then
    39    echo "UseDNS no" | sudo tee -a /etc/ssh/sshd_config >/dev/null
    40    oe sudo service ssh restart
    41  fi
    42  
    43  export DEBIAN_FRONTEND=noninteractive
    44  
    45  ol "Installing HTTPS driver for Apt..."
    46  oe sudo apt-get update
    47  oe sudo apt-get install -y apt-transport-https
    48  SCRIPT