-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description of boot commands #216
Description of boot commands #216
Comments
I'm running into this too. I wouldn't change the existing format because that can break a lot of templates but instead introduce a new one where the boot commands can be read from a file and the parser printing our comments. For example, the config could probably look as follows:
with the
There may be some conflicts if you need to type "#" or "//", but for those, you could probably escape them. The expectation in the output would be to print the comments like. I've started to externalize boot_commands for the following reasons:
|
I was thinking both format (the existing one and the new one) could be supported. But if it's easier with an attribute I'm fine with that. |
Adds a new configuration option called `boot_steps`. This is an array of tuples of boot commands, to type when the virtual machine is booted. The first element of the tuple is the actual boot command. The second element of the tuple is a description of what the boot command does. This is intended to be used for interactive installers that requires many commands to complete the installation. Both the command and the description will be printed when logging is enabled. When debug mode is enabled Packer will pause after typing each boot command. This will make it easier to follow along the installation process and make sure the Packer and the installer are in sync. Closes hashicorp/packer#11824 Closes hashicorp/packer#11286
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Reopening issue for further consideration in the Packer Plugin SDK. This is not work that we can prioritize at the moment but it is a valuable feature that we want to revisit and rethink in order to assist with debugging builders that rely on boot commands. |
Community Note
Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.
Description
Syntax for attaching a description to each boot command. When running Packer with
PACKER_LOG=1
it would print the description next to each printed boot command. A bouns would be to allow to set a description for a group of commands. See below where I currently use comments for this. A comment after a boot command is the description of the boot command where a comment by itself on a line represents the description of a group. A group is useful when multiple commands need to be enter on a single installation screen, seeAdd a user
andConfigure network
in the example at the bottom.Currently the
boot_command
is an array of strings. I suggest that the boot commands could be an array of tuples (arrays) of strings or any array of blocks, example:Current syntax:
New syntax, array of tuples:
New syntax, array of blocks:
Use Case(s)
My use case is that it would simplify handling installation of operating systems that only support an interactive installation. It would simplify two things: editing Packer configuration files and debug when something goes wrong.
Editing Boot Commands
For example, below are all the boot commands I have to install NetBSD, around 50. If I hadn't included comments it would be next to impossible to figure out which boot command to edit when changing the installation. Today comments can be used to improve the issue of editing boot commands but it would be nicer with direct support for this.
Debugging Boot Commands
When initially writing the boot commands for an interactive installation it's very easy to get it wrong, especially how long Packer needs to wait between commands. You want to wait as little as possible but enough to make sure the action has completed. When something goes wrong and Packer just goes on and types boot commands even though the boot step/screen is completely wrong it's difficult to know at which boot command something went wrong. Today one needs to carefully follow along the commands that Packer is typing, the Packer configuration file with comments and the installation screen, all at the same time, to make sure Packer and the installation are in sync. Often one needs to increase the wait time to make it easier to follow along. If Packer could print a description next to each printed boot command it would make it much easier to see at which step Packer and the installation got out of sync. It doesn't help when many of the boot commands are the same, but have a completely different meaning depending on where in the installation process they're typed.
The text was updated successfully, but these errors were encountered: