-
Notifications
You must be signed in to change notification settings - Fork 4
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
Modernize the Packer template in this repository #835
Open
mcdonnnj
wants to merge
15
commits into
develop
Choose a base branch
from
improvement/modernize_packer_configuration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will provide settings for Packer such as a minimum version of Packer required and any external plugins that the templates require.
Currently we use Debian Buster and Debian Bookworm for our Packer templates so we define them both as data sources for use.
Provide basic information about the Packer templates and how to build an AMI.
Since the new Packer configuration is in HCL2 we can use `terraform-docs` to populate the Packer README with some information. Although the information populated is limited it at least documents the variables used by the configuration.
Update to reflect the conversion of the Packer configuration to HCL2.
mcdonnnj
added
breaking change
This issue or pull request involves changes to existing functionality
improvement
This issue or pull request will add or improve functionality, maintainability, or ease of use
hacktoberfest-accepted
Pull request that should count toward Hacktoberfest participation
packer
Pull requests that update Packer code
labels
Oct 18, 2024
dv4harr10
approved these changes
Oct 21, 2024
dav3r
approved these changes
Oct 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! 🚀
Comment on lines
+19
to
+26
Build an AMI with: | ||
|
||
```console | ||
cd packer | ||
ansible-galaxy install --role-file ansible/requirements.yml | ||
packer init . | ||
packer build -only amazon-ebs.<target AMI> . | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also should mention here how to build all of the AMIs at once like we do in the main repo README.
jsf9k
approved these changes
Oct 21, 2024
Co-authored-by: dav3r <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
This issue or pull request involves changes to existing functionality
hacktoberfest-accepted
Pull request that should count toward Hacktoberfest participation
improvement
This issue or pull request will add or improve functionality, maintainability, or ease of use
packer
Pull requests that update Packer code
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗣 Description
This pull request modernizes the Packer template in this repository by converting it from the old, legacy JSON format to the fresh, modern HCL format.
Note
The version of cisagov/pre-commit-packer in our
pre-commit
configuration is updated because we need a newer version to support the changes in this pull request.💭 Motivation and context
Packer has officially supported (and preferred) using HCL for its templates since version 1.7.0 (released 2021-02-17). It makes sense to update the template in this repository to better align with Packer as it is now and improve the maintainability of the template.
🧪 Testing
Automated tests pass. I have used the updated configuration to build and deploy the AMIs in my development environment.
✅ Pre-approval checklist
to reflect the changes in this PR.