Trellis Invalid vars plugin version Errror with Ansible 2.4.0.0

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 2.0.2.0.
Please upgrade to Ansible 2.2.0.0 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/version.py) 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/version.py

Ideas how I can get around these new errors?

Seems to be related to this issue https://github.com/roots/trellis/pull/895 . So perhaps I need to either tweak my Trellis setup and require Ansible 2.4.0.0 or upgrade the whole package to the latest…
Did see https://github.com/roots/trellis/pull/895/commits/d96a58f4e2c31b261c7b03cdf2341d54dd1c6110 and it does seem the update to make Ansible 2.4.0.0 work with Trellis requires quite a few changes.

Found @fullyint suggestion to downgrade here a better solution so did a
sudo pip install ansible==2.3.2.0
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: [xxx.xxx.xxx.xxx]: 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/domain.com/shared$ 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/domain.com/trellis $ ansible --version
    ansible 2.3.1.0
      config file = /Users/jasper/webdesign/domain.com/trellis/ansible.cfg
      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:

[defaults]
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_connection]
ssh_args = -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o HostKeyAlgorithms=ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
pipelining = True

whereas the MBP shows:

Jaspers-MBP-2016:~ jasperfrumau$ ansible --version
ansible 2.3.2.0
  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 2.3.2.0 but notice that your version of Trellis is roughly at Accommodate deploy hook vars formatted as lists of includes. The CHANGELOG.md indicates that Ansible 2.3 compatibility wasn’t added into Trellis till a later version, so your version 2.3.2.0 will likely have trouble. You could update Trellis to some version that fits whatever version of Ansible you want to use, or try Ansible 2.2.0.0, 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 2.5.0.0 but this version of Trellis has
only been tested for compatability with Ansible 2.4.0.0 -> 2.4.2.0. 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