Score:1

Interact with user from subiquity late-command?

in flag

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

sudodus avatar
jp flag
If you get no answer here, please try at a forum where the Ubuntu developers participate: [Ubuntu Discourse](https://discourse.ubuntu.com/)
user535733 avatar
cn flag
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/.
Dan Bungert avatar
cn flag
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.
Score:0
cn flag

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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.