TASK [connection : Specify preferred HostKeyAlgorithms for unknown hosts] ************************************************************************************************************
System info:
Ansible 2.7.12; Darwin
Trellis Head
The conditional check ‘not (not ansible_ssh_extra_args)’ failed. The error
was: error while evaluating conditional (not (not ansible_ssh_extra_args)):
‘ansible_ssh_extra_args’ is undefined
The error appears to have been in ‘/[path-to-repo]/trellis/roles/connection/tasks/main.yml’: line 9, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
name: Specify preferred HostKeyAlgorithms for unknown hosts
^ here
fatal: [209.97.142.103]: FAILED! => {}
to retry, use: --limit @//[path-to-repo]/trellis/server.retry
EDIT: My coworker was having the same issue as OP and I, so I came back here and saw the new comments. I told him to try using Ansible 2.8 and that worked for him. So… try that before the probably-kinda-dumb stuff I’m about to say below
I was having the exact same error, word for word. I took a look at the git logs for Trellis and saw that very recently trellis/roles/connection/tasks/main.yml mentioned in the error output was modified.
My brain isn’t big enough to understand why the file was changed, all I know is reverting to the commit before this one fixed the issue for me. Or if you want to do it manually you can just replace not (not ansible_ssh_extra_args) with ansible_ssh_extra_args | default('') == '' and you should be good to go!
Having a problem here related to this as well…
Spun up a new Trellis instance and attempted to provision the server when I got this error and found this thread.
Updated Ansible to 2.8 and tried to provision again. Now it just hangs here:
TASK [connection : Check whether Ansible can connect as root] *********************
task path: /Volumes/LaCie/_development/_trellis/_projects/trellis.newproject.build/trellis/roles/connection/tasks/main.yml:18
Using module file /Library/Python/2.7/site-packages/ansible/modules/commands/command.py
Pipelining is enabled.
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: joshwhite
<localhost> EXEC /bin/sh -c 'ANSIBLE_SSH_ARGS='"'"'-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s '"'"' /usr/bin/python && sleep 0'