{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/12206","labels_url":"https://api.github.com/repos/ansible/ansible/issues/12206/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/12206/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/12206/events","html_url":"https://github.com/ansible/ansible/issues/12206","id":104459429,"number":12206,"title":"boolean interpreted as dict, 2.0","user":{"login":"mattwillsher","id":1581499,"avatar_url":"https://avatars.githubusercontent.com/u/1581499?v=3","gravatar_id":"","url":"https://api.github.com/users/mattwillsher","html_url":"https://github.com/mattwillsher","followers_url":"https://api.github.com/users/mattwillsher/followers","following_url":"https://api.github.com/users/mattwillsher/following{/other_user}","gists_url":"https://api.github.com/users/mattwillsher/gists{/gist_id}","starred_url":"https://api.github.com/users/mattwillsher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattwillsher/subscriptions","organizations_url":"https://api.github.com/users/mattwillsher/orgs","repos_url":"https://api.github.com/users/mattwillsher/repos","events_url":"https://api.github.com/users/mattwillsher/events{/privacy}","received_events_url":"https://api.github.com/users/mattwillsher/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-09-02T11:29:01Z","updated_at":"2015-09-02T18:00:24Z","closed_at":"2015-09-02T17:55:29Z","body":"I have a dict:\r\n```yaml\r\nusers:\r\n  - name: matt\r\n    comment: 'Matt Willsher'\r\n    is_admin: True\r\n    ssh_keys:\r\n      - ecdsa-sha2-nistp256 AAAAE2\r\n```\r\n\r\n1.9.2 debug:\r\n\r\n```\r\nok: [sam.wilsys.net] => {\r\n    \"var\": {\r\n        \"users\": [\r\n            {\r\n                \"comment\": \"Matt Willsher\",\r\n                \"is_admin\": true,\r\n                \"name\": \"matt\",\r\n                \"ssh_keys\": [\r\n                    \"ecdsa-sha2-nistp256 AAAAE2\"\r\n                ]\r\n            }\r\n        ]\r\n    }\r\n}\r\n```\r\n\r\n2.0 output:\r\n\r\n```\r\nok: [sam.wilsys.net] => {\r\n    \"changed\": false,\r\n    \"users\": [\r\n        {\r\n            \"comment\": \"Matt Willsher\",\r\n            \"is_admin\": {},\r\n            \"name\": \"matt\",\r\n            \"ssh_keys\": [\r\n                \"ecdsa-sha2-nistp256 AAAAE2\"\r\n            ]\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\nThen:\r\n```\r\nfailed: [sam.wilsys.net] => (item={u'comment': u'Matt Willsher', u'is_admin': {}, u'name': u'matt', u'ssh_keys': [u'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOgLXY1vHW5weJpl5XUm7yZ261OJrv3Pq1R743zS2Ssw', u'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGFdUSXkWRPKbHZtPMexORfQxuav9zVpHwFmifY92sTIE3uy5CbmvaAch3+sf/Qg3oBUCR2mhp729uEyGuaZAZc=']}) => {\"failed\": true, \"item\": {\"comment\": \"Matt Willsher\", \"is_admin\": {}, \"name\": \"matt\", \"ssh_keys\": [\"ecdsa-sha2-nistp256 AAAAE2\"]}, \"msg\": \"argument createhome is of type <type 'dict'> and we were unable to convert to bool\"}\r\n```\r\n\r\nThe  code\r\n\r\n```yaml\r\n- name: Create users\r\n  user:\r\n    name: '{{ item.name }}'\r\n    state: '{{ item.state | default(\"present\") }}'\r\n    uid: '{{ item.uid | default(omit) }}'\r\n    group: '{{ item.group | default(item.name) }}'\r\n    groups: '{{ item.groups | default(\"\") | join(\",\") }}'\r\n    shell: '{{ item.shell | default(users_default_shell) }}'\r\n    comment: '{{ item.comment | default(\"Unknown User\") }}'\r\n    password: '{{ item.password | default(users_default_password) }}'\r\n    home: '{{ item.home | default(\"/home/\"+item.name) }}'\r\n    createhome: '{{ item.createhome | default(users_create_homedirs) }}'\r\n    system: '{{ item.system | default(omit) }}'\r\n    append: yes\r\n  with_items: users\r\n  when: >\r\n    not ( item.name == ansible_ssh_user and\r\n    item.state|default('present') == 'absent' )\r\n```\r\n\r\nusers_create_homedirs is set as yes is the defaults/main.yml\r\n\r\nThe code works as expected in 1.9\r\n\r\n```\r\n$ ansible-playbook --version\r\nansible-playbook 2.0.0 (devel e8d7fafc52) last updated 2015/09/02 09:05:09 (GMT +100)\r\n  lib/ansible/modules/core: (detached HEAD ef1f31c652) last updated 2015/08/31 21:19:36 (GMT +100)\r\n  lib/ansible/modules/extras: (detached HEAD 5b39e19387) last updated 2015/08/31 21:19:36 (GMT +100)\r\n  config file = /Users/matt/Development/ansible/ansible.cfg\r\n  configured module search path = None\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/137192055","html_url":"https://github.com/ansible/ansible/issues/12206#issuecomment-137192055","issue_url":"https://api.github.com/repos/ansible/ansible/issues/12206","id":137192055,"user":{"login":"mattwillsher","id":1581499,"avatar_url":"https://avatars.githubusercontent.com/u/1581499?v=3","gravatar_id":"","url":"https://api.github.com/users/mattwillsher","html_url":"https://github.com/mattwillsher","followers_url":"https://api.github.com/users/mattwillsher/followers","following_url":"https://api.github.com/users/mattwillsher/following{/other_user}","gists_url":"https://api.github.com/users/mattwillsher/gists{/gist_id}","starred_url":"https://api.github.com/users/mattwillsher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattwillsher/subscriptions","organizations_url":"https://api.github.com/users/mattwillsher/orgs","repos_url":"https://api.github.com/users/mattwillsher/repos","events_url":"https://api.github.com/users/mattwillsher/events{/privacy}","received_events_url":"https://api.github.com/users/mattwillsher/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T18:00:24Z","updated_at":"2015-09-02T18:00:24Z","body":"Likewise, now works for me. Thanks!"}}