V2 default values not picked up?

Hi,

I upgraded to 2.0.0.1 (from 1.9.4) this morning and ran one of my playbooks to see if things worked and it lit up like a christmas tree. Most of that was just warnings (and the fact that ansible_ssh_port is not called that any more…), but this thing seems a little more serious (unless I’m missing something)

This is on Fedora 23

This works in 1.9.4:

`

  • hosts: localhost
    connection: local
    gather_facts: false

tasks:

  • name: debug
    debug: msg={{ansible_port|default(22)}}
    `

`
PLAY [localhost] **************************************************************

TASK: [debug] *****************************************************************
ok: [localhost] => {
“msg”: “22”
}

`

But doesnt work in 2.0.0.1. Its like the default filter is ignored.

TASK [debug] ******************************************************************* ok: [localhost] => { "msg": "" }

Any ideas?

That’s odd, ansible_ssh_port is still used, it’s just an alias to ansible_port now.

The issue above may be the result of us not adding in all internal variables to the variable dictionary, so go ahead and open an issue for this on github (or search to see if someone else has run into this).