How to run trellis up and force redeploy

Hi. I want to force a reprovision or a redeploy on my local system. But when I run trellis up vagrant says that the system is already provisioned and if I want to force provisioning use --provision. Note that it says this even if I change my Ansible config files in some way or even if provisioning failed half way through.

My only recourse it to remove the VM and completely rebuild from scratch. Needless to say this is a major pain and makes me not even want to bother with a local dev environment.

Note, I followed the troubleshooting guide and tried

SKIP_GALAXY=true ANSIBLE_TAGS=wordpress vagrant reload --provision

But I run into an error when vagrant tries to install Ansible, saying the version was not found.

1 Like

What about just running vagrant reload --provision. Does that do any good?

You seem to be using trellis-cli. Have you tried the trellis provision development
command?

vagrant reload --provision works great!

Is there a way to just do a redeploy and not a full provision?

Actually, it didn’t work, I thought it was working but I get this error, which I’m not sure how to fix

==> 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.

trellis provision development does seem to work, thanks!

I have to admit I’m a little confused about how to do a redeploy. For many things, if I just change my site on my local filesystem, the VM picks it up, which makes sense.

But I also am trying to run a custom post-install recipe on deploy, and I can’t seem to find a good way to test that locally without having to do a full re-provision, which take a good five minutes…

I guess I can test on a remote environment…

If you’re talking about post composer install you can run those scripts manually, ie composer run-script post-install will run all post install scripts I believe. Generally on local there is no concept of a “deploy” within the trellis paradigm; if I wanted to test that sort of thing I would do it on a remote staging environment.

Yep, OK, that’s starting make my experience make more sense. Appreciate your fast responses!