Older project on new machine, vagrant up failure at: TASK [wordpress-install : Install Dependencies with Composer]

I’m trying to set up an older project on a new machine. Cloned down the project’s files, installed ansible galaxy roles (ansible-galaxy install -r requirements.yml) and started a vagrant up. I was hit with this error:

TASK [logrotate : nickhammond.logrotate | Setup logrotate.d scripts] ***********
fatal: [default]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'unicode object' has no attribute 'name'\n\nThe error appears to have been in '/Users/mtanner/Sites/[site].com/ansible/vendor/roles/logrotate/tasks/main.yml': line 5, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: nickhammond.logrotate | Setup logrotate.d scripts\n ^ here\n"}

This is with ansible 2.2.0.0. I saw on a different thread that I probably needed to downgrade my ansible version, so I downgraded to 2.0.2.0. Then, destroyed and did another vagrant up.

Now when it hits the same Task, it gives me a depreciation warning but continues. But a couple of lines down, it starts the wordpress setup tasks, and hits me repeatedly with the same depreciation warning for every Task:

[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{wordpress_sites}}').

And then after a bunch of lines, it fails:

TASK [wordpress-install : Install Dependencies with Composer] ****************** [DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{wordpress_sites}}'). This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. failed: [default] (item={'value': {u'site_install': True, u'multisite': {u'enabled': False, u'subdomains': False}, u'admin_user': u'[company]', u'cache': {u'duration': u'30s', u'enabled': False}, u'site_hosts': [u'[site].dev'], u'ssl': {u'enabled': False}, u'local_path': u'../site', u'site_title': u'[site]', u'env': {u'wp_env': u'development', u'disable_wp_cron': True, u'wp_siteurl': u'http://[site].dev/wp', u'db_name': u'[site]', u'db_user': u'[site]', u'wp_home': u'http://[site].dev'}, u'initial_permalink_structure': u'/%postname%/', u'admin_email': u'admin@example.dev'}, 'key': u'[site].com'}) => {"changed": true, "cmd": ["composer", "install"], "delta": "0:00:00.174780", "end": "2018-03-28 20:11:34.328356", "failed": true, "item": {"key": "[site].com", "value": {"admin_email": "admin@example.dev", "admin_user": "newbird", "cache": {"duration": "30s", "enabled": false}, "env": {"db_name": "[site]", "db_user": "[site]", "disable_wp_cron": true, "wp_env": "development", "wp_home": "http://[site].dev", "wp_siteurl": "http://[site].dev/wp"}, "initial_permalink_structure": "/%postname%/", "local_path": "../site", "multisite": {"enabled": false, "subdomains": false}, "site_hosts": ["[site].dev"], "site_install": true, "site_title": "[site]", "ssl": {"enabled": false}}}, "rc": 2, "start": "2018-03-28 20:11:34.153576", "stderr": "Do not run Composer as root/super user! See https://getcomposer.org/root for details\nLoading composer repositories with package information\nInstalling dependencies (including require-dev) from lock file\nYour requirements could not be resolved to an installable set of packages.\n\n Problem 1\n - Installation request for composer/installers v1.0.22 -> satisfiable by composer/installers[v1.0.22].\n - composer/installers v1.0.22 requires composer-plugin-api 1.0.0 -> no matching package found.\n\nPotential causes:\n - A typo in the package name\n - The package is not available in a stable-enough version according to your minimum-stability setting\n see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.\n - It's a private package and you forgot to add a custom repository to find it\n\nRead <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.", "stdout": "", "stdout_lines": [], "warnings": []}

The error mentions composer, so I went to the sage directory and ran composer install, but that didn’t fix anything. I’ve been on this for a few hours… Any dieas?

Quick search finds requires composer-plugin-api 1.0.0 -> no matching package found. · Issue #2324 · composer/composer · GitHub, suggesting updating composer (on the VM I suppose).

https://packagist.org/packages/composer/installers#v1.0.22 released 2015-10-29

Looks like Trellis fixed this two years ago https://github.com/roots/trellis/pull/510 but those only warnings, not failures, so the composer issue above seems to be the blocker.