install vagrant key to root, dont pin version
authorvarac <varacanero@zeromail.org>
Mon, 18 Jan 2016 08:22:00 +0000 (09:22 +0100)
committervarac <varacanero@zeromail.org>
Mon, 18 Jan 2016 08:22:00 +0000 (09:22 +0100)
jessie.json
scripts/vagrant.sh

index a7dc84c..d7ab526 100644 (file)
             "artifact_type": "vagrant.box",
             "metadata": {
                 "provider": "libvirt",
-                "version": "0.0.1"
+                "created_at": "{{timestamp}}"
             }
         }]
     ]
index 694486b..1cb2659 100644 (file)
@@ -6,10 +6,15 @@
 date > /etc/vagrant_box_build_time
 
 # Installing vagrant keys
-mkdir -pm 700 /home/vagrant/.ssh
-wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
-chmod 0600 /home/vagrant/.ssh/authorized_keys
-chown -R vagrant /home/vagrant/.ssh
+wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /tmp/vagrant.pub
+
+for user in vagrant root
+do
+  mkdir -pm 700 /home/${user}/.ssh
+  chmod 0600 /home/${user}/.ssh/authorized_keys
+  cp /tmp/vagrant.pub /home/${user}/.ssh/authorized_keys
+  chown -R ${user} /home/${user}/.ssh
+done
 
 # configure password-less sudo
 echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers