vagrant: Add Vagrantfile and some basic configuration
This commit is contained in:
committed by
James Shubin
parent
e8855f7621
commit
c2034bc0c0
38
Vagrantfile
vendored
Normal file
38
Vagrantfile
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
Vagrant.configure(2) do |config|
|
||||||
|
config.ssh.forward_agent = true
|
||||||
|
config.ssh.username = 'vagrant'
|
||||||
|
config.vm.network "private_network", ip: "192.168.219.2"
|
||||||
|
|
||||||
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
|
||||||
|
config.vm.define "mgmt-dev" do |instance|
|
||||||
|
instance.vm.box = "fedora/24-cloud-base"
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.provider "virtualbox" do |v|
|
||||||
|
v.memory = 1536
|
||||||
|
v.cpus = 2
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.provision "file", source: "vagrant/motd", destination: ".motd"
|
||||||
|
config.vm.provision "shell", inline: "cp ~vagrant/.motd /etc/motd"
|
||||||
|
|
||||||
|
config.vm.provision "file", source: "vagrant/mgmt.bashrc", destination: ".mgmt.bashrc"
|
||||||
|
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
|
||||||
|
|
||||||
|
# copied from make-deps.sh (with added git)
|
||||||
|
config.vm.provision "shell", inline: "dnf install -y libvirt-devel golang golang-googlecode-tools-stringer hg git"
|
||||||
|
|
||||||
|
# set up vagrant home
|
||||||
|
script = <<-SCRIPT
|
||||||
|
grep -q 'mgmt\.bashrc' ~/.bashrc || echo '. ~/.mgmt.bashrc' >>~/.bashrc
|
||||||
|
. ~/.mgmt.bashrc
|
||||||
|
go get -u github.com/purpleidea/mgmt
|
||||||
|
cd ~/gopath/src/github.com/purpleidea/mgmt
|
||||||
|
make deps
|
||||||
|
SCRIPT
|
||||||
|
config.vm.provision "shell" do |shell|
|
||||||
|
shell.privileged = false
|
||||||
|
shell.inline = script
|
||||||
|
end
|
||||||
|
end
|
||||||
4
vagrant/mgmt.bashrc
Normal file
4
vagrant/mgmt.bashrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# alias for simple access
|
||||||
|
alias cdmgmt='cd $GOPATH/src/github.com/purpleidea/mgmt'
|
||||||
|
|
||||||
|
export GOPATH=~/gopath
|
||||||
14
vagrant/motd
Normal file
14
vagrant/motd
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
Welcome to the mgmt hacking VM.
|
||||||
|
|
||||||
|
Please make sure that your authorized key for GitHub is added to the SSH agent
|
||||||
|
on the host machine (see `ssh-add -l`).
|
||||||
|
|
||||||
|
You can jump into the mgmt repo with the alias `cdmgmt`.
|
||||||
|
|
||||||
|
To get started, try:
|
||||||
|
|
||||||
|
$ cdmgmt
|
||||||
|
$ make clean build
|
||||||
|
$ ./mgmt run --tmp-prefix --yaml examples/exec1.yaml --converged-timeout 5
|
||||||
|
|
||||||
|
Enjoy!
|
||||||
Reference in New Issue
Block a user