Skip to content

Conversation

@taru-garg-hashicorp
Copy link
Contributor

Fixing test failures in #13733

This was done because the --inventory-file option for Ansible is
anticipated to be removed as of the ansible-core package version '2.23'.
@taru-garg-hashicorp taru-garg-hashicorp marked this pull request as ready for review November 6, 2025 12:05
@taru-garg-hashicorp taru-garg-hashicorp requested a review from a team as a code owner November 6, 2025 12:05
chrisroberts
chrisroberts previously approved these changes Nov 6, 2025
chrisroberts
chrisroberts previously approved these changes Nov 7, 2025
Copy link
Member

@chrisroberts chrisroberts left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Member

@chrisroberts chrisroberts left a comment

Choose a reason for hiding this comment

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

These updates look great! Left a couple simplification suggestions and one note on a conditional that should be adjusted (or removed).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes test failures introduced in #13733 by updating tests and implementation to handle ansible-core version detection alongside ansible version detection, and switches to the --inventory flag for ansible-core >= 2.19.

Key changes:

  • Updates box_add test to use asterisk masking pattern for credentials in HTTP URLs
  • Adds ansible-core version checking to the provisioner alongside existing ansible version checks
  • Implements version-aware inventory argument selection (--inventory vs --inventory-file)

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/unit/vagrant/action/builtin/box_add_test.rb Updates credential masking pattern in HTTP URL test assertion
test/unit/plugins/provisioners/ansible/provisioner_test.rb Adds test cases for ansible-core version checking and inventory argument selection based on version
plugins/provisioners/ansible/provisioner/host.rb Makes gather_ansible_version accept package parameter for querying different ansible packages
plugins/provisioners/ansible/provisioner/guest.rb Makes gather_ansible_version accept package parameter for querying different ansible packages
plugins/provisioners/ansible/provisioner/base.rb Implements ansible-core version tracking and version-based inventory argument selection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@chrisroberts chrisroberts left a comment

Choose a reason for hiding this comment

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

Looks good!

@taru-garg-hashicorp taru-garg-hashicorp merged commit 18dc215 into hashicorp:main Nov 19, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants