Closed GR360RY closed 7 months ago
Hi, I think this solution is much cleaner than the existing one. We would certainly consider this move if you are willing to provide PRs.
If you do, please create a PR for each distro, let's avoid one massive PR as this is hard to review.
@alexsander-souza and @jurekh , the PR for CentOS 7 is ready. Please review and consider. I will continue with the reset of the distributions when this one is reviewed/commented on and merged.
Issue Description
As stated in the
centos7/README.md
file, the image can be build just with packer and without using make:This will result in a failed build as anaconda cannot fetch the kickstart file:
When starting a build process with
make
, thehttp/centos7.ks
is generated by make, hence the build finishes successfully. Below is the code snippet from the Makefile:This happens with the rest of the RHEL based distros as far as I checked.
Proposal
Instead of using make to substitute strings in a
http/centos7.ks.in
and generate a newhttp/centos7.ks
, use templatefile hcl function together with http_contentSee more details in this blog post: Using Template Files with HashiCorp Packer
Pros
Please see example changes for centos7 in the fork: https://github.com/canonical/packer-maas/compare/main...GR360RY:packer-maas:packer_refactor_ks_generation?expand=1
I will be happy to provide a PR for all distributions if this is something you are willing to consider.