Provisioning server not working because 'ansible_ssh_extra_args' is undefined

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: []: FAILED! => {}
to retry, use: --limit @//[path-to-repo]/trellis/server.retry

PLAY RECAP *************************************************************************************************************************************************************************** : ok=0 changed=0 unreachable=0 failed=1
localhost : ok=0 changed=0 unreachable=0 failed=0

1 Like

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!

1 Like

That change is to fix ansible-lint warnings.
And, it requires ansible v2.8.x

Please upgrade ansible to v2.8.x

See also:


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/
Using module file /Library/Python/2.7/site-packages/ansible/modules/commands/
Pipelining is enabled.
<localhost> EXEC /bin/sh -c 'ANSIBLE_SSH_ARGS='"'"'-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s '"'"' /usr/bin/python && sleep 0'

Any idea why its stalling?

Saw the same error:

The conditional check ‘not (not ansible_ssh_extra_args)’ failed

Upgrading ansible to 2.8 did the trick for me…!


This topic was automatically closed after 42 days. New replies are no longer allowed.