to_json not working on variable

When running ansible v1.8.2, in the below playbook, to_json fails to handle a basic variable

`

  • name: a play that runs entirely on the ansible host
    hosts: localhost
    vars:
    users:
  • bob
  • joe
    tasks:

no problem

  • debug: msg=“{{users|to_yaml}}”

ERROR: an unexpected type error occurred. Error was Undefined is not JSON serializable

  • debug: msg=“{{users|to_json}}”

`

Could somebody please verify weather or not its just my problem?

I can confirm this, even threw in:
    - debug: var=users
which works fine but still error out on your last task

very weird, the following works:

- debug: msg="{{users|default('la')|to_json}}"