# Ansible version error on vagrant up

**URL:** https://discourse.roots.io/t/ansible-version-error-on-vagrant-up/22236
**Category:** trellis
**Tags:** ansible, trellis
**Created:** 2022-02-02T09:51:38Z
**Posts:** 12

## Post 1 by @klemenz — 2022-02-02T09:51:39Z

Hi,

I have run into an error on latest trellis release (1.13).

When i vagrant up a project i get an error on ansible install. It requires ansible 2.10.7 but it installs 2.10.17.

Error:

```
==> default: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines...
==> default: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
==> default: Running provisioner: ansible_local...
    default: Installing Ansible...
    default: Installing pip... (for Ansible installation)
The requested Ansible version (2.10.7) was not found on the guest.
Please check the Ansible installation on your Vagrant guest system (currently: 2.10.17),
or adapt the provisioner `version` option in your Vagrantfile.
See https://docs.vagrantup.com/v2/provisioning/ansible_common.html#version
for more information.
```

My vagrant version is 2.2.6  
Running virtualbox version 5.2.44 on windows 10.

I don’t know from where it gets this asible version and how can i force the correct version. If i change the version in vagrant file than it’s ok. But i’m not sure if this is a good practice to always change the vagrant file.

Any idea?

Thank you

---

## Post 2 by @ben — 2022-02-02T13:47:58Z

Howdy! Just checking — are you using trellis-cli?

---

## Post 3 by @klemenz — 2022-02-02T14:16:30Z

No. I’m using vagrant command to start and provision virtual box and then i use ansible commands inside virtual enviroment to deploy site.

---

## Post 4 by @ben — 2022-02-02T14:29:45Z

I’d suggest installing trellis-cli, then running `trellis init` in your project directory (from WSL) and then run `trellis up` (also from WSL)

---

## Post 5 by @swalkinshaw — 2022-02-02T15:48:11Z

As @ben said, trellis-cli should provide better dependency management.

But you can also try changing the version defined here: [trellis/vagrant.default.yml at 56582d408054f556e8d634a6308730ec17f75068 · roots/trellis · GitHub](https://github.com/roots/trellis/blob/56582d408054f556e8d634a6308730ec17f75068/vagrant.default.yml#L7)

---

## Post 6 by @abartdigital — 2023-04-01T07:48:01Z

I’m getting this now on different Projects, different Versions of Trellis, using trellis-cli.

I’m using Apple Silicon, Parallels and tried either with Vagrant 2.2.18 and the newest version. Bumping the ansible version to “2.10.17” as the error message tells, getting a new error that the version doesn’t exist …

EDIT: Setting vagrant\_ansible\_version to “latest” in vagrant.default.yml just skips the error, but doesn’t help. I had this problem more often in the past, provisioning older projects from bitbucket via trellis-cli.

---

## Post 7 by @conductdesign — 2023-04-21T15:12:27Z

I’ve also been struggling with this lately. I’ve read that there should be a [fix coming in Vagrant 2.3.5](https://github.com/hashicorp/vagrant/pull/13054), whenever it is released.

Have you had any success with updating and reprovisioning older projects? And what did you mean by “skips the error, but doesn’t help”?

I am trying to migrate older projects to Ubuntu 22 and using `vagrant_ansible_version: latest` seems to do the trick. I mean, I have to destroy the old VirtualBoxes and start fresh anyway.

---

## Post 8 by @ben — 2023-04-21T15:39:18Z

Highly recommend giving [Lima a shot](https://roots.io/introducing-lima-to-trellis-for-faster-local-development/) if possible so that you don’t have to use Vagrant or VirtualBox

---

## Post 9 by @swalkinshaw — 2023-04-22T00:39:45Z

Any issue with Vagrant and the ansible version is likely because you don’t have Ansible installed on your host machine. When Trellis’ `Vagrantfile` does not find an Ansible installation, it uses `ansible_local` (confusingly named) mode which **installs and runs Ansible on the Vagrant VM** and that’s what is broken due to that Vagrant bug.

The recommend way to install Ansible and any other necessary Trellis dependencies is with trellis-cli by running the `trellis init` command in your project.

---

## Post 10 by @swalkinshaw — 2023-04-24T13:09:50Z

6 posts were merged into an existing topic: [Ansible\_local version mismatch](/t/ansible-local-version-mismatch/25215/3)

---

## Post 12 by @swalkinshaw — 2023-04-24T18:04:41Z

Here’s a recap since this thread has at least two different causes of the issue:

1. @klemenz original issue is because he’s running Windows and that defaults to the `ansible_local` provisioner. @klemenz we [require using WSL](https://roots.io/trellis/docs/installation/#local-development-requirements). If you use WSL, you can use Trellis CLI which will manage Ansible dependencies and should fix this issue.
2. @abartdigital’s issue _could_ be the same as @conductdesign’s but we don’t know without more details.

@klemenz feel free to follow-up in this thread. @abartdigital since the cause of the issue is almost certainly different, I’d recommend reading through [Ansible\_local version mismatch - #3 by conductdesign](https://discourse.roots.io/t/ansible-local-version-mismatch/25215/3) first and if re-installing Python doesn’t fix it, please create a new thread with more details.
