{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3640","repository_url":"https://api.github.com/repos/ansible/ansible-modules-extras","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3640/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3640/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3640/events","html_url":"https://github.com/ansible/ansible-modules-extras/issues/3640","id":193267010,"number":3640,"title":"can not use variable in responses key of expect module","user":{"login":"hanks","id":759107,"avatar_url":"https://avatars.githubusercontent.com/u/759107?v=3","gravatar_id":"","url":"https://api.github.com/users/hanks","html_url":"https://github.com/hanks","followers_url":"https://api.github.com/users/hanks/followers","following_url":"https://api.github.com/users/hanks/following{/other_user}","gists_url":"https://api.github.com/users/hanks/gists{/gist_id}","starred_url":"https://api.github.com/users/hanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanks/subscriptions","organizations_url":"https://api.github.com/users/hanks/orgs","repos_url":"https://api.github.com/users/hanks/repos","events_url":"https://api.github.com/users/hanks/events{/privacy}","received_events_url":"https://api.github.com/users/hanks/received_events","type":"User","site_admin":false},"labels":[{"id":437719880,"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/affects_2.2","name":"affects_2.2","color":"5319e7","default":false},{"id":132898023,"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":415779102,"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/waiting_on_maintainer","name":"waiting_on_maintainer","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-03T05:25:58Z","updated_at":"2016-12-05T15:44:26Z","closed_at":"2016-12-05T15:44:26Z","body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\nexpect\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.2.0.0\r\n  config file = \r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\n<!---\r\nMention the OS you are running Ansible from, and the OS you are\r\nmanaging, or say “N/A” for anything that is not platform-specific.\r\n-->\r\nmacOS 10.11.3\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\ncan not use variable in responses key of expect module\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\n- name: expect test\r\n   expect: \r\n     command: xxxx\r\n     response:\r\n       \"{{ path }}\": \"yes\"\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\nIt should check the prompt with the `path` value, and input `yes`\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with high verbosity (-vvvv) -->\r\nNo response for the prompt\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/264888118","html_url":"https://github.com/ansible/ansible-modules-extras/issues/3640#issuecomment-264888118","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3640","id":264888118,"user":{"login":"sivel","id":39340,"avatar_url":"https://avatars.githubusercontent.com/u/39340?v=3","gravatar_id":"","url":"https://api.github.com/users/sivel","html_url":"https://github.com/sivel","followers_url":"https://api.github.com/users/sivel/followers","following_url":"https://api.github.com/users/sivel/following{/other_user}","gists_url":"https://api.github.com/users/sivel/gists{/gist_id}","starred_url":"https://api.github.com/users/sivel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivel/subscriptions","organizations_url":"https://api.github.com/users/sivel/orgs","repos_url":"https://api.github.com/users/sivel/repos","events_url":"https://api.github.com/users/sivel/events{/privacy}","received_events_url":"https://api.github.com/users/sivel/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T15:44:26Z","updated_at":"2016-12-05T15:44:26Z","body":"This is not specific to the expect module.  Using variables as keys is unsupported throughout ansible.\r\n\r\nMaybe you could instead define a variable like:\r\n\r\n```\r\nvars:\r\n    path_responses:\r\n        \"/foo/bar/baz\": \"yes\"\r\n```\r\n\r\nAnd then supply that to responses like:\r\n\r\n```\r\nresponses: \"{{ path_responses }}\"\r\n```\r\n\r\nIf you have further questions please stop by IRC or the mailing list:\r\n\r\n   * IRC: #ansible on irc.freenode.net\r\n   * mailing list: https://groups.google.com/forum/#!forum/ansible-project"}}
{"actor":{"display_login":"sivel"}}