Setting debconf values in preseed early_command script

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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 late_command.



Moving the 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).







share|improve this question























    up vote
    0
    down vote

    favorite












    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 late_command.



    Moving the 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).







    share|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      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 late_command.



      Moving the 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).







      share|improve this question











      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 late_command.



      Moving the 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).









      share|improve this question










      share|improve this question




      share|improve this question









      asked Jun 7 at 9:13









      match

      1964




      1964

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448369%2fsetting-debconf-values-in-preseed-early-command-script%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448369%2fsetting-debconf-values-in-preseed-early-command-script%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay