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

provisioner/ansible: Fix ansible version gathering in host provisioner #13375

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

patrickpoortman
Copy link

@patrickpoortman patrickpoortman commented Apr 2, 2024

When not forcing ansible.compatibility_mode, Vagrant tries to gather the Ansible version using the gather_ansible_version function.

This seems to be incorrectly quoted / escaped.

This would close issue #13234

The noted fix from the issue is being implemented in this PR.

Before:

 vagrant provision
==> hostname: Running provisioner: ansible...
Vagrant gathered an unknown Ansible version:


and falls back on the compatibility mode '1.8'.

after:

 vagrant provision
==> hostname: Running provisioner: ansible...
    hostname: Running ansible-playbook...

Tested with the following versions on MacOS;
ansible [core 2.15.8]
python version = 3.9.16
Vagrant 2.4.1 and Vagrant 2.4.0

Python 3.9.16 (main, Jun  6 2023, 11:35:35)
[Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.metadata; print('ansible ' + importlib.metadata.version('ansible'))
ansible 8.7.0
>>> import importlib.metadata; print('ansible ' + importlib.metadata.version('ansible-core'))
ansible 2.15.8

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 2, 2024

CLA assistant check
All committers have signed the CLA.

@patrickpoortman patrickpoortman changed the title [WIP] Fix ansible version gathering in host provisioner Fix ansible version gathering in host provisioner Apr 2, 2024
@patrickpoortman patrickpoortman changed the title Fix ansible version gathering in host provisioner provisioner/ansible: Fix ansible version gathering in host provisioner May 15, 2024
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.

None yet

2 participants