hetzneronline / installimage

Bash scripts to universally deploy various distributions
Other
517 stars 143 forks source link

an error should lead to a non-zero exit code if called with -a #40

Closed c33s closed 2 years ago

c33s commented 2 years ago

i use install image via terraform with the -a flag to provision my images with the following command

/root/.oldroot/nfs/install/installimage -a -n myname -b grub -r no -i /root/.oldroot/nfs/images/`ls /root/.oldroot/nfs/images | grep -E '^Debian.*bullseye.*minimal.tar.gz$' | sort | tail -n1` ... -t yes

as you, sadly, have new naming conventions for your images, the script had an error, as i called it via terraform, the script got stuck so hard that i had to kill the terraform process, even a ctrl-x or ctrl-c have not helped.

terraform was stuck at: image

i had to add a logoutput to my terraform which outputs the exactly command and run it manually on the system to finally see:

image

which i debugged to your new file naming scheme.

running installimage with -a (or maybe a new flag like --no-interaction or --batch) should never lead to a gui showing the error but to a non-zero exit code an an error message to std-err.

would be really helpful and safe time.

it would be really nice if you could add a symlink following the previous naming scheme. in general a more stable naming scheme would be awesome.

   0 lrwxrwxrwx  1 root root    50 Aug 25 08:28 Debian-913-stretch-64-minimal.tar.gz -> ../images.old/Debian-913-stretch-64-minimal.tar.gz
   0 lrwxrwxrwx  1 root root    36 Aug 24 13:16 Debian-oldstable-64-minimal.tar.gz -> Debian-1010-buster-64-minimal.tar.gz
   0 lrwxrwxrwx  1 root root    36 Jul 20 08:02 Debian-stable-64-minimal.tar.gz -> Debian-1010-buster-64-minimal.tar.gz
   0 lrwxrwxrwx  1 root root    38 Aug 24 13:18 Debian-stable-amd64-base.tar.gz -> Debian-1100-bullseye-amd64-base.tar.gz

debian buster should not be called debian stable any more.

something like the following would be really helpful

Debian-latest -> Debian-bullseye-1101 
Debian-buster-latest -> Debian-buster-1011
Debian-buster-1000
Debian-buster-1001
...
Debian-buster-1011
Debian-bullseye-latest -> Debian-bullseye-1101
Debian-bullseye-1101 
Debian-bullseye-1100