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

vagrant cannot find Ansible #6868

Closed
mwagg opened this issue Jan 13, 2016 · 5 comments
Closed

vagrant cannot find Ansible #6868

mwagg opened this issue Jan 13, 2016 · 5 comments

Comments

@mwagg
Copy link

mwagg commented Jan 13, 2016

Seeing this error this morning when trying to bring up a new box which uses the ansible_local provisioner.

I tried manually installing ansible via apt and provisioning again but get the same error.

This exact env was working fine yesterday.

Is this possibly caused by the V2 release of ansible?

The Ansible software could not be found! Please verify that Ansible is correctly installed on your guest system.  If you haven't installed Ansible yet, please install Ansible on your Vagrant basebox, or enable the automated setup with the `install` option of this provisioner. Please check https://docs.vagrantup.com/v2/provisioning/ansible_local.html for more information.
@JamesSmaldon
Copy link

I have the same problem. I think it's because the ansible-galaxy command (which is called with the ansible_local provisioner to detect ansible) now exits with a non-zero code when passed the --help option.

As a workaround, I'm going to try using the shell provisioner to install an older version of ansible and set ansible.install to false (not tested yet tho).

@JamesSmaldon
Copy link

If I comment out the following line in: \embedded\gems\gems\vagrant-1.8.1\plugins\provisioners\guest.rb:54

          @machine.communicate.execute(
            "ansible-galaxy --help && ansible-playbook --help",
            :error_class => Ansible::Errors::AnsibleNotFoundOnGuest,
            :error_key => :ansible_not_found_on_guest)

then it works

@mwagg
Copy link
Author

mwagg commented Jan 13, 2016

Yeah I see the same thing. ansible-galaxy --help exits with code 5 on ansible v2, but 0 if I manually install 1.9.4

@JamesSmaldon
Copy link

I think this is really an ansible bug so I've raised ansible/ansible#13833.

@gildegoma
Copy link
Collaborator

Closing as it duplicates #6793.

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants