From a11e511b7daf9d26fea21a5d7ef68c6a4768867c Mon Sep 17 00:00:00 2001 From: nemo Date: Sun, 5 May 2019 19:31:50 +0200 Subject: [PATCH] Uncomment code (forgot) and add informations in README.md --- README.md | 9 +++++---- deploy_vm.sh | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9347375..9dfc56d 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,16 @@ Script to deploy a VM based on debian template (in our case). The script add IPAM entry for an IPv4 address and an IPv6 range, and deploy/configure a VM based on the VM conf file (see vm-template.conf). # How to use - * Define your IPAM credentials and adjust parameters in deploy_vm.conf file + * Define your IPAM credentials in file "cred" and adjust parameters in "deploy_vm.conf" file * Copy the VM conf file template : cp vm-template.conf vm-user123.conf * Adjust all parameters in new file vm-user123.conf - * WARNING : if the SSH public key isn't correct, nobody would be able to log on the VM after deploy. + * WARNING : if the SSH public key isn't correct, nobody would be able to log in the VM after deploy. * Run the script : ./deploy_vm.sh # If problems - * If the script fail and add already do updates in IPAM or on the VM, you can manually finish the deploy OR delete IPAM entries (1 IPv4 and 1 IPv6 range), delete the VM, rectify to avoir the problem and retry deploy. + * If the script fail and already do updates in IPAM or on the VM, you can manually finish the deploy OR delete IPAM entries (1 IPv4 and 1 IPv6 range), delete the VM, rectify to avoid the problem and retry deploy # To do + * Variabilize some parameters like adminsys e-mail address, disk's name, ... * Verify if VM conf file parameters are numbers before test the interval (actually in the same line) - * Verify deploy_vm.conf parameters. + * Verify deploy_vm.conf parameters diff --git a/deploy_vm.sh b/deploy_vm.sh index 00ccba0..88803e0 100755 --- a/deploy_vm.sh +++ b/deploy_vm.sh @@ -421,6 +421,7 @@ if [ "${VM_DISK_EXTEND}" -ne 0 ]; then echo "INFO : Create new primary partition to extend VG... (Create new partition)" + # Dirty but it's just work ssh ${SSH_OPT} ${SSH_HOST} "echo -e \"n\np\n\n\n\nt\n\n8e\nw\n\" | fdisk /dev/vda" &> /dev/null # Don't check errors because return code in error (system has to reboot) @@ -534,7 +535,7 @@ le FQDN. Cordialement, -- -Les adminsys de GRIFON" #| /usr/sbin/sendmail -f adminsys@grifon.fr -t +Les adminsys de GRIFON" | /usr/sbin/sendmail -f adminsys@grifon.fr -t echo "INFO : script finished, mail sent to the user and adminsys@grifon.fr"