Can't deploy locally: TASK [wp-cli : Install WP-CLI]

I’ve just started using Trellis. I followed the docs and executed the command

trellis up

to deploy a test website (Mac M1 + Parallels) using Vagrant to a Parallels VM.

I get the following error during deployment:

TASK [wp-cli : Install WP-CLI] *************************************************
fatal: [default]: FAILED! => {"changed": false, "changed_when_result": "The conditional check 'wp_cli.stdout == 'wp-cli-' + wp_cli_version + '.phar'' failed. The error was: error while evaluating conditional (wp_cli.stdout == 'wp-cli-' + wp_cli_version + '.phar'): 'dict object' has no attribute 'stdout'. 'dict object' has no attribute 'stdout'", "msg": "Unsupported parameters for (ansible.legacy.command) module: warn. Supported parameters include: _raw_params, stdin_add_newline, chdir, argv, stdin, creates, executable, strip_empty_ends, removes, _uses_shell."}

I don’t understand what am I doing wrong, and I couldn’t find any similar topics either.

Could anyone help me, please?

ansible-core 2.14 was recently released and apparently it removed support for the warn option (which was previously deprecated).

You have two options:

  1. I just opened a PR to fix this: Remove deprecated warn usage by swalkinshaw · Pull Request #1450 · roots/trellis · GitHub - you can apply those changes manually to your project
  2. Trellis’ ansible-core dependency was already changed on master to restrict some newer versions: trellis/requirements.txt at c91c7793e578df413832a6845e7890daf278a344 · roots/trellis · GitHub

If you apply that change and re-run trellis init it should install an older version of ansible-core to avoid this issue.