Skip to content
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

Standardization of the order of the fields for the builders in all the templates #221

Open
arizvisa opened this issue Jan 14, 2020 · 6 comments
Assignees
Labels
enhancement This will introduce or improve an already existing capability schema The schema of a template(s) is wrong or outdated for the current release of packer

Comments

@arizvisa
Copy link
Contributor

The order of the fields in the builders for some of the templates are somewhat haphazard. This is just the natural order of things as the schema changes over time.

This isn't really too big of a deal, but if more than 1 person submits a PR that tampers with all of the templates (which could be common), PRs will look a lot larger than they should to git/patch and so the submitter will be forced to re-base a lot more often.

This also affects users that apply their own patches to arbitrary commits in the repo because in some cases patch in fuzzy-mode has nothing to consistently anchor upon.

@arizvisa arizvisa added enhancement This will introduce or improve an already existing capability schema The schema of a template(s) is wrong or outdated for the current release of packer labels Jan 14, 2020
@arizvisa arizvisa self-assigned this Jan 14, 2020
@arizvisa
Copy link
Contributor Author

PR #220 currently re-organizes the ssh_username and ssh_password fields so they're anchored near the end between ssh_timeout and vm_name similar to the winrm_* parameters in the standard templates.

I don't plan on standardizing/documenting this other than maybe ensuring that the builders begin with their type and keeping cpus/cores/memory/etc. anchored near the vm_name since those shouldn't really change due to being controlled by user-variables.

@arizvisa
Copy link
Contributor Author

arizvisa commented Jan 18, 2020

Commit d81f5f8 does a little bit of re-ordering in order to test refactoring the scripts to perform downloads during provisioning instead of the building phase. This is partially related to issue #213 which has an issue while downloading wget.exe from the internet.

@arizvisa
Copy link
Contributor Author

arizvisa commented Jan 18, 2020

Commit 8474772 re-orders the floppy_files field in all the builders by prefixing them with their respective Autounattend.xml script, and sorting the rest by name. This greatly simplifies comparison to distinguish what is different between all the templates.

Ftr, this was done with the following jq query:

.builders[] |= (.floppy_files = [.floppy_files[] | select(test("Autounattend.xml"))] + ([(.floppy_files[] | select(test("Autounattend.xml") | not ))] | sort))

@arizvisa
Copy link
Contributor Author

As a result of sorting the floppy_files, a number of issues (#222, #224, #225) were unraveled. These correspond to the PRs (#223, #226, #227).

@arizvisa
Copy link
Contributor Author

The "iso_checksum_type" which was formerly hardcoded to "sha1" is now a user-variable as per PR #236. This also positions the "iso_checksum_type" right below the "iso_url" in all the builders.

@arizvisa
Copy link
Contributor Author

The shutdown_command user-variable was made consistent by PR #256.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This will introduce or improve an already existing capability schema The schema of a template(s) is wrong or outdated for the current release of packer
Projects
None yet
Development

No branches or pull requests

1 participant