Skip to content

New module for hashicorp packer - #12492

Open
a-gabidullin wants to merge 8 commits into
ansible-collections:mainfrom
a-gabidullin:packer
Open

New module for hashicorp packer#12492
a-gabidullin wants to merge 8 commits into
ansible-collections:mainfrom
a-gabidullin:packer

Conversation

@a-gabidullin

Copy link
Copy Markdown
Contributor
SUMMARY

New module packer to manage HashiCorp Packer builds. This module supports:

  • Building images from Packer templates
  • Validating template syntax
  • Inspecting template structure
  • Formatting Packer templates
  • Idempotent builds with artifact existence checking
  • Check mode support
  • Machine-readable output parsing
ISSUE TYPE
  • New Module/Plugin Pull Request
COMPONENT NAME

packer

ADDITIONAL INFORMATION

This module provides Ansible users with native integration for HashiCorp Packer, allowing them to build, validate, and manage Packer templates directly from playbooks.

@ansibullbot ansibullbot added module module new_plugin New plugin plugins plugin (any type) tests tests unit tests/unit labels Jul 27, 2026
@ansibullbot

This comment was marked as resolved.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed ci_verified Push fixes to PR branch to re-run CI labels Jul 27, 2026
@ansibullbot

This comment was marked as resolved.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI and removed ci_verified Push fixes to PR branch to re-run CI labels Jul 27, 2026
@ansibullbot

This comment was marked as resolved.

@ansibullbot

This comment was marked as resolved.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI and removed ci_verified Push fixes to PR branch to re-run CI labels Jul 27, 2026
@ansibullbot

This comment was marked as resolved.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Jul 27, 2026
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-13 Automatically create a backport for the stable-13 branch labels Jul 28, 2026
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jul 28, 2026
@a-gabidullin

Copy link
Copy Markdown
Contributor Author

Hello again, friends @russoz @felixfontein

I'm trying once again to improve our open-source community.

Recently at work, I came across the Packer utility and decided to use a convenient module instead of cmd and shell.

@a-gabidullin

Copy link
Copy Markdown
Contributor Author

Hello again, I would be happy if you have the chance to take a look at and respond to my PR.
fyi @felixfontein @russoz

@russoz russoz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @a-gabidullin

Thanks for another contribution. There's quite a number of adjustments to make and I have not marked them all, many of them are repeated throughout the code.

It might be that you are using AI to help you, which is OK, but please make sure to abide by the Ansible Community Policy for AI-Assisted Contributions. Thanks!

Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py

@felixfontein felixfontein left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
@ansibullbot ansibullbot added stale_ci CI is older than 7 days, rerun before merging and removed stale_ci CI is older than 7 days, rerun before merging labels Aug 9, 2026
@a-gabidullin

Copy link
Copy Markdown
Contributor Author

Dear friends @russoz @felixfontein , I apologize for tagging you.
Please take a look at my corrections if possible.
I have minimized the functional and removed all the problematic parts.

@russoz russoz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @a-gabidullin

Thanks for your continued work on this. Please see some additional comments.

Comment thread tests/unit/plugins/modules/test_packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
@ansibullbot

This comment was marked as resolved.

@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Aug 15, 2026
@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Aug 15, 2026
@a-gabidullin

Copy link
Copy Markdown
Contributor Author

@russoz thx you for your help and for finding my issues in the code. All tests have been passed and fixed.

@a-gabidullin
a-gabidullin requested a review from russoz August 15, 2026 15:10
@russoz

russoz commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Every time you force-push the commit, the comments we made before become invalid and we have to circle back to all of them to validate the changes. Please don't.

@a-gabidullin

Copy link
Copy Markdown
Contributor Author

Every time you force-push the commit, the comments we made before become invalid and we have to circle back to all of them to validate the changes. Please don't.

Oh no, I'm so sorry, I didn't know. I intentionally cleaned up the commit history because in the previous module I had many commits for each of your comments, and at the end you asked me to squash them all into a single commit for merging branches.

@russoz

russoz commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Ideally, when we have many small commits, we should squash them before pushing. Or a simpler way to put it: when squashing, do not include the commits that were pushed before.

@russoz russoz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @a-gabidullin

Another batch of comments. We're getting there. Thanks for you continued work on this.

Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread tests/unit/plugins/modules/test_packer.py
Comment thread plugins/modules/packer.py Outdated
@a-gabidullin
a-gabidullin requested a review from russoz August 17, 2026 08:36

@russoz russoz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @a-gabidullin

Another round of comments.

Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
@a-gabidullin
a-gabidullin requested a review from russoz August 18, 2026 21:44
@a-gabidullin

Copy link
Copy Markdown
Contributor Author

@russoz Hi again, please take a look at my corrections.

@russoz russoz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @a-gabidullin

Thanks for the adjustments. Another round, many of them are minor nits now. We are getting there!

Comment thread tests/unit/plugins/modules/test_packer.py Outdated
Comment thread tests/unit/plugins/modules/test_packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py Outdated
Comment thread plugins/modules/packer.py
Comment thread plugins/modules/packer.py Outdated
Comment thread tests/unit/plugins/modules/test_packer.py
@a-gabidullin
a-gabidullin requested a review from russoz August 24, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-13 Automatically create a backport for the stable-13 branch check-before-release PR will be looked at again shortly before release and merged if possible. module module new_plugin New plugin plugins plugin (any type) tests tests unit tests/unit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants