From 8b623b739d498dbfd0a193428763d55bdf8a6e80 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Mon, 28 Dec 2020 11:19:11 +0000 Subject: [PATCH] Add wipe_disk.sh * This will allow to run a quick script to wipe the headers of the disk, so that we don't have to login after a re-comission of the machine to manually reboot it --- TODO.md | 4 ++-- user-data.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 3874b05..331f29f 100644 --- a/TODO.md +++ b/TODO.md @@ -2,9 +2,9 @@ 1. add the hypervisor as a flag rather then the configuration file when adding hypervisors. -1. Add script to cloud-init, that will allow to wipe disk. This will allow to +1. ~~Add script to cloud-init, that will allow to wipe disk. This will allow to reboot the hypervisor, such that we don't have to log back in after the - machine has been re-commissioned. + machine has been re-commissioned.~~ 1. ~~Update hypervisor config such that it works with focal~~ 1. Add the ability to add multiple storage pools (1 x SSD, 1 x HDD) 1. Update `boostrap-maas.sh` diff --git a/user-data.yaml b/user-data.yaml index 6dd339d..97c4276 100644 --- a/user-data.yaml +++ b/user-data.yaml @@ -70,6 +70,13 @@ write_files: usermod -a -G libvirt,libvirt-qemu virsh permissions: '0755' owner: root:root +- path: /root/wipe_disk.sh + content: | + #!/bin/bash + + dd if=/dev/zero of=/dev/sda bs=1M count=1000 + permissions: '0755' + owner: root:root # Runs any command that we need to run post install runcmd: