Roots Discourse

Problems running new trellis install and Ansible version

I’m migrating from an old trellis project to a new one.

I just copied the wordpress_sites and bedrock folder to the new trellis directory.

running ansible --version returns

ansible 2.0.2.0
  config file = /Volumes/projects/mysite.com/trellis/ansible.cfg
  configured module search path = Default w/o overrides

so vagrant provision returns

ERROR! Trellis no longer supports Ansible 2.0.2.0.
Please upgrade to Ansible 2.7.12 or higher.

I tried with trellis-cli but trellis provision development returns

TASK [python_interpreter : Get Ubuntu release] *********************************
System info:
  Ansible 2.8.5; Darwin
  Trellis version (per changelog): "Ansible 2.8.x support"
---------------------------------------------------
non-zero return code
sudo: a password is required

fatal: [192.168.50.5]: FAILED! => {"changed": false, "rc": 1, "stderr_lines": ["sudo: a password is required"], "stdout": "", "stdout_lines": []}

I tried several ways to remove and upgrade ansible, both with brew and with pip install, but system ansible is still 2.0.2.0

which ansible returns

/usr/local/opt/ansible@2.0/bin/ansible

do you have any clues?

/usr/local/opt/ansible@2.0/bin/ansible is a weird path and I’m not sure how you originally installed Ansible :thinking:

I’d definitely try to hunt that down and uninstall it though.

I tried with trellis-cli but trellis provision development

Yeah right now provisioning a Vagrant box only works via vagrant provision. I should really fix that the “provision development” edge case. In the meantime, you can try trellis exec vagrant provision. That will activate trellis-cli’s virtualenv with the proper Ansible version.

This worked, thanks!

I couldn’t find anything about the weird path thing. But for now I can keep working!