Trellis Invalid vars plugin version Errror with Ansible

Just did a
sudo -H pip install ansible --upgrade --ignore-installed six
to upgrade Ansible as I got this error:

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

That went well, but now with my current Trellis setup I get these errors:

PLAY [Ensure necessary variables are defined] **********************************************************************
 [WARNING]: Failure using method (v2_playbook_on_play_start) in callback plugin
(<ansible.plugins.callback.vars.CallbackModule object at 0x10f938590>): get_vars() got an unexpected keyword
argument 'loader'

 [WARNING]: Skipping plugin (/Users/jasperfrumau/webdesign/domain/trellis/lib/trellis/plugins/vars/ as
it seems to be incomplete: __init__() takes exactly 2 arguments (1 given)

ERROR! Invalid vars plugin version from /Users/jasperfrumau/webdesign/domain/trellis/lib/trellis/plugins/vars/

Ideas how I can get around these new errors?

Seems to be related to this issue . So perhaps I need to either tweak my Trellis setup and require Ansible or upgrade the whole package to the latest…
Did see and it does seem the update to make Ansible work with Trellis requires quite a few changes.

Found @fullyint suggestion to downgrade here a better solution so did a
sudo pip install ansible==
and then I could deploy with my older Trellis setup
Only I did get

Trellis at "Accommodate deploy hook vars formatted as lists of includes"
Unable to find 'tmp_multisite_constants.php' in expected paths.
fatal: []: FAILED! => {"changed": false, "failed": true}
	to retry, use: --limit @/Users/jasperfrumau/webdesign/domain/trellis/deploy.retry

And on the server I do have that file:

admin@domain:/srv/www/$ ll
total 20
drwxr-xr-x 4 web www-data 4096 Apr  6  2017 ./
drwxr-xr-x 5 web www-data 4096 Oct  9 09:39 ../
drwxr-xr-x 6 web www-data 4096 Oct 16 08:45 source/
-rw-r--r-- 1 web www-data  202 Apr  6  2017 tmp_multisite_constants.php

So that is a bit odd…

1 Like

Oddly enough I managed on my MacMini a little later on. Same Trellis version, files and such. Only perhaps another Ansible setup:

jasper@~/webdesign/ $ ansible --version
      config file = /Users/jasper/webdesign/
      configured module search path = Default w/o overrides
      python version = 2.7.13 (default, Mar  5 2017, 15:42:57) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

And the ansible.cfg there has:

callback_plugins = ~/.ansible/plugins/callback_plugins/:/usr/share/ansible_plugins/callback_plugins:lib/trellis/plugins/callback
stdout_callback = output
filter_plugins = ~/.ansible/plugins/filter_plugins/:/usr/share/ansible_plugins/filter_plugins:lib/trellis/plugins/filter
force_color = True
force_handlers = True
inventory = hosts
nocows = 1
roles_path = vendor/roles
vars_plugins = ~/.ansible/plugins/vars_plugins/:/usr/share/ansible_plugins/vars_plugins:lib/trellis/plugins/vars

ssh_args = -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o,,ssh-ed25519,ssh-rsa
pipelining = True

whereas the MBP shows:

Jaspers-MBP-2016:~ jasperfrumau$ ansible --version
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.10 (default, Feb  7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

So that may be related to the plugin path issue…

Indeed, the original ERROR! Invalid vars plugin version suggests Ansible 2.4 installed, but a Trellis version that hasn’t been updated for Ansible 2.4 compatibility.

I haven’t ever found the --ignore-installed six option necessary (to reinstall six). Ansible 2.4 removed a six module that Trellis had been referring to. Thus some error messages about the six module indicate a need to update Trellis rather than an issue with the six module itself.

If you don’t want to update Trellis yet, changing to an older version of Ansible is fine. It would probably make sense to just change back to the version you had before because presumably it was working.

In the post above it appears you chose but notice that your version of Trellis is roughly at Accommodate deploy hook vars formatted as lists of includes. The indicates that Ansible 2.3 compatibility wasn’t added into Trellis till a later version, so your version will likely have trouble. You could update Trellis to some version that fits whatever version of Ansible you want to use, or try Ansible, which appears to be the version to work with your current Trellis, based on the various output above.

The Trellis Ansible 2.4 compatibility update added a message to help users always know which Ansible versions should work best with the given Trellis version.

  • add warning for Ansible versions greater than tested with Trellis
    It happens that people update Ansible but not Trellis, then run into problems, not realizing they need to update their Trellis for compatibility…
[WARNING]: You Ansible version is but this version of Trellis has
only been tested for compatability with Ansible -> It is
advisable to check for Trellis updates or downgrade your Ansible version.

Rather than the file potentially being missing on the server (dest), I think it may be missing from your local machine (the src). It should be in your trellis directory at roles/deploy/files/tmp_multisite_constants.php

If you didn’t experience this same missing file error when running Trellis on a different machine, I imagine one machine has the file and the other doesn’t. If the file is missing at all, it suggests an incomplete Trellis update to the affected machine, which could likely continue producing other symptoms. You may want to just copy over the Trellis project files from the working machine.

1 Like