1

I am working on moving from the old Debian-style installer to the newer Ubuntu server autoinstall system which uses subiquity. One thing we do with our current system is run a late_command script which registers the machine for our network. That involves a debconf-based dialog where the admin enters some credentials. Is there any similar way in subiquity to have a late-command script query the admin to answer some questions?

Thanks,

Stephen

  • 1
    If you get no answer here, please try at a forum where the Ubuntu developers participate: Ubuntu Discourse – sudodus Nov 17 '21 at 16:46
  • 1
    I suggest starting at https://ubuntu.com/server/docs/install/autoinstall-reference , then the various autoinstall bleeding-edge threads at https://discourse.ubuntu.com/c/server/. – user535733 Nov 17 '21 at 16:52
  • 1
    Late commands isn't setup today to handle that, to my knowledge. I like the idea of an admin customizable question in the installer though. Can we move this to a feature request in the bug tracker? https://bugs.launchpad.net/subiquity In particular I'd like some details on how your current solution works - the debconf based example would help. – Dan Bungert Nov 18 '21 at 14:22

1 Answers1

0

Yes it is possible. The trick is to switch to another virtual console using openvt. The same trick is usable for the user-data runcmd. However, this is not in the spirit of cloud-init. Perhaps in this particular case, you can use debconf-selections as shown in the doc

autoinstall:
  version: 1
  debconf-selections: |
    bind9      bind9/run-resolvconf    boolean false
  late-commands:
    - - curtin
      - in-target
      - --target=/target
      - --
      - openvt
      - -f
      - -c
      - "14"
      - -s
      - -w
      - --
      - env
      - TERM=linux
      - PATH=/usr/bin:/usr/sbin
      - LANG=C.utf8
      - LC_ALL=C.utf8
      - USER=root
      - SHELL=/bin/bash
      - HOME=/root
      - bash
      - -c
      - |
        echo 'Hello, this is an interactive bash script!'
        read -p 'Your name: ' name
        echo "bye-bye $name, it's been a pleasure."
        sleep 10
exore
  • 997
  • 6
  • 10