diff --git a/image-templates/aws-hvm.json b/image-templates/aws-hvm.json index 1e40cc8..f29fd28 100644 --- a/image-templates/aws-hvm.json +++ b/image-templates/aws-hvm.json @@ -48,7 +48,8 @@ "scripts/aws/cloud-init-enable.sh", "scripts/aws/sriov.sh", "scripts/common/nic.sh", - "scripts/common/cleanup.sh" + "scripts/common/cleanup.sh", + "scripts/common/clear_root_authkeys.sh" ] }, { @@ -70,4 +71,4 @@ "post-processors": [ ] -} \ No newline at end of file +} diff --git a/image-templates/aws-paravirt.json b/image-templates/aws-paravirt.json index 5f973f2..21f5dc8 100644 --- a/image-templates/aws-paravirt.json +++ b/image-templates/aws-paravirt.json @@ -47,7 +47,8 @@ "scripts/aws/aws-modules.sh", "scripts/aws/cloud-init-enable.sh", "scripts/common/nic.sh", - "scripts/common/cleanup.sh" + "scripts/common/cleanup.sh", + "scripts/common/clear_root_authkeys.sh" ] }, { @@ -69,4 +70,4 @@ "post-processors": [ ] -} \ No newline at end of file +} diff --git a/image-templates/vagrant.json b/image-templates/vagrant.json index f47feaa..323f41d 100644 --- a/image-templates/vagrant.json +++ b/image-templates/vagrant.json @@ -44,7 +44,8 @@ "scripts/vagrant/vbox-guest-additions.sh", "scripts/vagrant/vagrant-user.sh", "scripts/common/nic.sh", - "scripts/common/cleanup.sh" + "scripts/common/cleanup.sh", + "scripts/common/clear_root_authkeys.sh" ] }, { @@ -69,4 +70,4 @@ "output" : "images/{{user `image_type`}}/{{user `vm_name`}}-{{ user `timestamp`}}.box" } ] -} \ No newline at end of file +} diff --git a/image-templates/virtualbox.json b/image-templates/virtualbox.json index a0bf812..6e3c89c 100644 --- a/image-templates/virtualbox.json +++ b/image-templates/virtualbox.json @@ -69,7 +69,8 @@ "scripts/virtualbox/packages.sh", "scripts/virtualbox/serial.sh", "scripts/virtualbox/sshd.sh", - "scripts/common/nic.sh" + "scripts/common/nic.sh", + "scripts/common/cleanup.sh" ] }, { @@ -82,4 +83,4 @@ "script" : "tests/serverspec.sh" } ] -} \ No newline at end of file +} diff --git a/scripts/common/cleanup.sh b/scripts/common/cleanup.sh index 0bd26af..d06cbb1 100644 --- a/scripts/common/cleanup.sh +++ b/scripts/common/cleanup.sh @@ -9,6 +9,3 @@ yum clean all if [ -f /tmp/VBoxGuestAdditions.iso ]; then rm /tmp/VBoxGuestAdditions.iso fi - -# Delete builder key. -echo > /root/.ssh/authorized_keys \ No newline at end of file diff --git a/scripts/common/clear_root_authkeys.sh b/scripts/common/clear_root_authkeys.sh new file mode 100644 index 0000000..ef58a9f --- /dev/null +++ b/scripts/common/clear_root_authkeys.sh @@ -0,0 +1,6 @@ +#!/bin/sh -x +# +# This script should be included by every build except virtualbox + +# Delete builder key. +echo > /root/.ssh/authorized_keys