THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. Vagrant.configure(2) do |config|
  2. config.ssh.forward_agent = true
  3. config.ssh.username = 'vagrant'
  4. config.vm.network "private_network", ip: "192.168.219.2"
  5. config.vm.synced_folder ".", "/vagrant", disabled: true
  6. config.vm.define "mgmt-dev" do |instance|
  7. instance.vm.box = "bento/fedora-31"
  8. end
  9. config.vm.provider "virtualbox" do |v|
  10. v.memory = 1536
  11. v.cpus = 2
  12. end
  13. config.vm.provider "libvirt" do |v|
  14. v.memory = 2048
  15. end
  16. config.vm.provision "file", source: "vagrant/motd", destination: ".motd"
  17. config.vm.provision "shell", inline: "cp ~vagrant/.motd /etc/motd"
  18. config.vm.provision "file", source: "vagrant/mgmt.bashrc", destination: ".mgmt.bashrc"
  19. config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
  20. config.vm.provision "shell", inline: "dnf install -y golang git make"
  21. # set up packagekit
  22. config.vm.provision "shell" do |shell|
  23. shell.inline = <<-SCRIPT
  24. dnf install -y PackageKit
  25. systemctl enable packagekit
  26. systemctl start packagekit
  27. SCRIPT
  28. end
  29. # set up vagrant home
  30. script = <<-SCRIPT
  31. grep -q 'mgmt\.bashrc' ~/.bashrc || echo '. ~/.mgmt.bashrc' >>~/.bashrc
  32. . ~/.mgmt.bashrc
  33. mkdir -p ~/gopath/src/github.com/purpleidea
  34. cd ~/gopath/src/github.com/purpleidea
  35. git clone https://github.com/purpleidea/mgmt --recursive
  36. cd mgmt
  37. make deps
  38. SCRIPT
  39. config.vm.provision "shell" do |shell|
  40. shell.privileged = false
  41. shell.inline = script
  42. end
  43. end