I'm working on a preseeded environment where one of the steps is to have an admin put in their credentials in order to authenticate the system after build.
I'm currently doing this all in a
late_command script, using debconf to prompt for the admin credentials:
db_input critical admin_user/username db_input critical admin_password/password
And then using them:
db_get admin_user/username admin_user=$RET db_get admin_password/password admin_password=$RET authenticate -u $admin_user -p $admin_password ...
This all works fine - however the issue is that the user has to wait until the host has finished the main install before being prompted.
To speed up the process, I'd like to prompt for the credentials in an
early_command script, and then read and use the values in
db_input part to
early_command prompts the user as expected, but when thelate_command` script runs later they aren't there any more.
I'm guessing something happens to clear/reset the debconf values after early_command, but I'm not sure if there's a way to avoid this? Any suggestions? (I can fall back to writing the values out to file and reading that back later, but I'd prefer to avoid writing credentials to disk if possible).