Skip to content
Snippets Groups Projects
Select Git revision
  • b2bb39fdaf201bcfe6d55f682a82284b83583274
  • develop default protected
  • dont-use-etc-hosts
  • sec
  • simplify-grafana
  • simple-docs-build
  • local-test-grid
  • no-morph-on-nodes
  • stuff
  • arion
10 results

Vagrantfile

Blame
  • Forked from PrivateStorage / PrivateStorageio
    793 commits behind the upstream repository.
    Jean-Paul Calderone's avatar
    Jean-Paul Calderone authored
    The VirtualBox documentation says this is the network to use for host-only
    networking.
    b2bb39fd
    History
    Vagrantfile 2.86 KiB
    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    
    # This Vagrantfile worked for Florian Sesser using Vagrant 2.2.16dev and
    # the VirtualBox Hypervisor. Earlier Vagrant and LibVirt did not work.
    
    Vagrant.configure("2") do |config|
      # For a complete reference, please see the online documentation at
      # https://docs.vagrantup.com.
    
      config.vm.define "payments.localdev" do |config|
        config.vm.hostname = "payments"
        config.vm.box = "esselius/nixos"
        config.vm.box_version = "20.09"
        config.vm.box_check_update = false
    
        # To use the self-updating deployment system you need more memory.  Giving
        # all of the VMs enough memory for this is rather taxing, though, and the
        # self-updating deployment system is not particularly useful for local
        # dev.  But should you want to:
        #
        # config.vm.provider "virtualbox" do |v|
        #   v.memory = 4096
        # end
    
        # Assign a static IP address inside the VirtualBox host-only (Vagrant
        # calls it "private") network.  The address must be in the range
        # VirtualBox allows.
        # https://www.virtualbox.org/manual/ch06.html#network_hostonly says some
        # things about this.
        config.vm.network "private_network", ip: "192.168.56.21"
        # Add self signed SSL key for zkap-issuer:
        config.vm.provision "file", source: "private-keys/payments-localdev-ssl", destination: "/tmp/payments-localdev-ssl"
        config.vm.provision "shell", inline: "sudo mkdir -p /var/lib/letsencrypt/live/payments.localdev/"
        config.vm.provision "shell", inline: "sudo mv /tmp/payments-localdev-ssl/* /var/lib/letsencrypt/live/payments.localdev/"
      end
    
      config.vm.define "storage1.localdev" do |config|
        config.vm.hostname = "storage1"
        config.vm.box = "esselius/nixos"
        config.vm.box_version = "20.09"
        config.vm.box_check_update = false
        config.vm.network "private_network", ip: "192.168.56.22"
      end
    
      config.vm.define "storage2.localdev" do |config|
        config.vm.hostname = "storage2"
        config.vm.box = "esselius/nixos"
        config.vm.box_version = "20.09"
        config.vm.box_check_update = false
        config.vm.network "private_network", ip: "192.168.56.23"
      end
    
      config.vm.define "monitoring.localdev" do |config|
        config.vm.hostname = "monitoring"
        config.vm.box = "esselius/nixos"
        config.vm.box_version = "20.09"
        config.vm.box_check_update = false
        config.vm.network "private_network", ip: "192.168.56.24"
      end
    
      # To make the VMs assign the static IPs to the network interfaces we need a rebuild:
      config.vm.provision "shell", inline: "echo '{nix.trustedUsers = [ \"@wheel\" \"root\" \"vagrant\" ];}' > /etc/nixos/custom-configuration.nix"
      config.vm.provision "shell", inline: "nixos-rebuild switch"
    
      config.trigger.after :up do |trigger|
        trigger.info = "Hostname and IP address this host actually uses:"
        trigger.run_remote = {inline: "echo `hostname` `ifconfig | egrep -o '192.168.56.[0-9]* '`"}
      end
    
    end