{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/14004","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/14004/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/14004/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/14004/events","html_url":"https://github.com/ansible/ansible/issues/14004","id":127546094,"number":14004,"title":"identifier validation for variable names","user":{"login":"adeck","id":6640582,"avatar_url":"https://avatars1.githubusercontent.com/u/6640582?v=4","gravatar_id":"","url":"https://api.github.com/users/adeck","html_url":"https://github.com/adeck","followers_url":"https://api.github.com/users/adeck/followers","following_url":"https://api.github.com/users/adeck/following{/other_user}","gists_url":"https://api.github.com/users/adeck/gists{/gist_id}","starred_url":"https://api.github.com/users/adeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adeck/subscriptions","organizations_url":"https://api.github.com/users/adeck/orgs","repos_url":"https://api.github.com/users/adeck/repos","events_url":"https://api.github.com/users/adeck/events{/privacy}","received_events_url":"https://api.github.com/users/adeck/received_events","type":"User","site_admin":false},"labels":[{"id":437720458,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.0","name":"affects_2.0","color":"5319e7","default":false},{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":48457795,"url":"https://api.github.com/repos/ansible/ansible/labels/feature_idea","name":"feature_idea","color":"006b75","default":false},{"id":54811101,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_info","name":"needs_info","color":"eb6420","default":false},{"id":572345061,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_template","name":"needs_template","color":"f9d0c4","default":false},{"id":636352796,"url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-01-19T21:45:38Z","updated_at":"2017-11-22T00:35:41Z","closed_at":null,"author_association":"NONE","body":"## Issue Type:\n\nBug Report\n## Ansible Version:\n\n> ansible 2.0.0.1\n>  config file = /etc/ansible/ansible.cfg\n>  configured module search path = Default w/o overrides\n## Ansible Configuration\n\nDidn't modify the default /etc/ansible/ansible.cfg, and I didn't create any other ansible.cfg files.\nInstalled using `make && make install`. Almost certainly irrelevant.\n## Environment\n\nIrrelevant.\n## Summary:\n\nVariable names / identifiers aren't validated at all. On the one hand, that's arguably just an undocumented feature- and it's quite fun to play with- but it also means that errors are thrown way later than they ought to be (if they're thrown at all), which would have been more confusing if I weren't intentionally testing this.\n## Steps To Reproduce:\n\nIf you put the following in a vars file and include the file, that raises zero red flags. Of course, most of these variables aren't actually usable after evaluation (with the delightful exception of `and[\"{{ hello }}\"]`):\n\n```\nhello: you\n\"{{ hello }}\": thou\n\nand:\n  \"{{ hello }}\": though\n\nptest:\nptest['var1']: hiya\nptest[var2]: gday\n\ntest::var: \"I am a variable\"\n\nmytest||var3: what\nmytest||var4: why\n\nmytest:\nmytest.var1: \"and a-one\"\nmytest.var2: \"and a-two\"\n```\n## Expected Results:\n\nA screen full of Angry Red Text along the lines of \"Ansible variables are basically just python identifiers, so the same rules apply (use [a-zA-Z_][a-zA-Z_0-9]\\* only)\".\n\nActual Results:\n\nWhen used in tasks, Ii got errors including (but not limited to):\n\n```\nfatal: [127.0.0.1]: FAILED! => {\"failed\": true, \"msg\": \"ERROR! template error while templating string: expected token 'variable_end', got ':'\"}\n\nfatal: [127.0.0.1]: FAILED! => {\"failed\": true, \"msg\": \"ERROR! 'var1' is undefined\"}\n\nfatal: [127.0.0.1]: FAILED! => {\"failed\": true, \"msg\": \"ERROR! template error while templating string: expected token 'name', got '|'\"}\n\nok: [127.0.0.1] => (item=you) => {\n    \"item\": \"you\", \n    \"you\": \"VARIABLE IS NOT DEFINED!\"\n}\n\nfatal: [127.0.0.1]: FAILED! => {\"failed\": true, \"msg\": \"ERROR! 'dict' object has no attribute u'you'\"}\n\nok: [127.0.0.1] => {\n    \"and\": {\n       \"{{ hello }}\": \"though\"\n    }\n}\n```\n\nAnd so on. All that was just a way for me to figure out a sane way to implement namespacing. But that's <del>a discussion</del> <ins>an unreasonable, over-the-top rant about nothing</ins> for another day / issue ticket.\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/346206214","html_url":"https://github.com/ansible/ansible/issues/14004#issuecomment-346206214","issue_url":"https://api.github.com/repos/ansible/ansible/issues/14004","id":346206214,"user":{"login":"ansibotdev","id":30841104,"avatar_url":"https://avatars2.githubusercontent.com/u/30841104?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibotdev","html_url":"https://github.com/ansibotdev","followers_url":"https://api.github.com/users/ansibotdev/followers","following_url":"https://api.github.com/users/ansibotdev/following{/other_user}","gists_url":"https://api.github.com/users/ansibotdev/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibotdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibotdev/subscriptions","organizations_url":"https://api.github.com/users/ansibotdev/orgs","repos_url":"https://api.github.com/users/ansibotdev/repos","events_url":"https://api.github.com/users/ansibotdev/events{/privacy}","received_events_url":"https://api.github.com/users/ansibotdev/received_events","type":"User","site_admin":false},"created_at":"2017-11-22T00:35:41Z","updated_at":"2017-11-22T00:35:41Z","author_association":"NONE","body":"@adeck You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.\n\n[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)\n<!--- boilerplate: needs_info_base --->"}}
{"actor":{"display_login":"ansibotdev"}}