Commit 4cbe3fdc authored by Reimar Stier's avatar Reimar Stier

Conditionally show virtualbox GUI, add ssh key docs

parent 42d50dbc
......@@ -9,9 +9,12 @@ cd /vagrant
ansible-playbook playbook.yml --connection=local -i devbox, -e ansible_become=true
# SSH configuration
https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html
config.ssh.insert_key=True
Provision own ssh key to the vagrant box. Compare [documentation|https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html]
`config.ssh.insert_key=True`
Vagrant adds its own private/public key pair to the box. Private key will be stored on the executing box in $(pwd)/.vagrant folder.
```
vagrant provision devbox --provision-with shell
```
# Graphics card issues
Issues with nvidia graphics card (NVIDIA Corporation GK106GLM [Quadro K2100M]).
......
......@@ -40,6 +40,8 @@ Vagrant.configure("2") do |config|
vb.cpus = 4
vb.name = BOX_NAME
vb.gui = ENV["SHOW_GUI"] ||= "false"
# https://www.virtualbox.org/manual/ch08.html
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"]
......@@ -67,9 +69,14 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell" do |s|
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
s.inline = <<-SHELL
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
mkdir -p /root/.ssh
echo #{ssh_pub_key} >> /root/.ssh/authorized_keys
if grep -sq "#{ssh_pub_key}" /home/vagrant/.ssh/authorized_keys; then
echo "SSH keys already provisioned."
exit 0;
else
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
mkdir -p /root/.ssh
echo #{ssh_pub_key} >> /root/.ssh/authorized_keys
fi
SHELL
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment