This is very much what I had in mind as something we’d build into Foreman itself so it’s nice to see a reference. My idea was to have some easy way (provisioning macro?) to generate a command to send that output.
From https://www.debian.org/releases/stable/example-preseed.txt
# This first command is run as early as possible, just after
# preseeding is read.
#d-i preseed/early_command string anna-install some-udeb
# This command is run immediately before the partitioner starts. It may be
# useful to apply dynamic partitioner preseeding that depends on the state
# of the disks (which may not be visible when preseed/early_command runs).
#d-i partman/early_command \
# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
# This command is run just before the install finishes, but when there is
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
You could probably use those to run similar curl commands. I think Preseed and Kickstart are the primary installation methods, though Ubuntu’s installer is another one.