{"action":"created","issue":{"url":"https://api.github.com/repos/networktocode/ntc-ansible/issues/94","labels_url":"https://api.github.com/repos/networktocode/ntc-ansible/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/networktocode/ntc-ansible/issues/94/comments","events_url":"https://api.github.com/repos/networktocode/ntc-ansible/issues/94/events","html_url":"https://github.com/networktocode/ntc-ansible/issues/94","id":126743909,"number":94,"title":"ERROR! 'ntc_show_command' is not a valid attribute for a Play","user":{"login":"spirrello","id":7174260,"avatar_url":"https://avatars.githubusercontent.com/u/7174260?v=3","gravatar_id":"","url":"https://api.github.com/users/spirrello","html_url":"https://github.com/spirrello","followers_url":"https://api.github.com/users/spirrello/followers","following_url":"https://api.github.com/users/spirrello/following{/other_user}","gists_url":"https://api.github.com/users/spirrello/gists{/gist_id}","starred_url":"https://api.github.com/users/spirrello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spirrello/subscriptions","organizations_url":"https://api.github.com/users/spirrello/orgs","repos_url":"https://api.github.com/users/spirrello/repos","events_url":"https://api.github.com/users/spirrello/events{/privacy}","received_events_url":"https://api.github.com/users/spirrello/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-14T20:43:03Z","updated_at":"2016-01-15T20:18:33Z","closed_at":null,"body":"Hi,\r\n\r\nAfter cloning ntc-ansible, i tried to launch the following playbook using the example provided but I'm getting the following error.  Can you help?\r\n\r\n$ ansible-playbook get_vlan.yml\r\n [WARNING]: provided hosts list is empty, only localhost is available\r\n\r\nERROR! 'ntc_show_command' is not a valid attribute for a Play\r\n\r\nThe error appears to have been in '/Users/SPirrello/Google Drive/Work/scripts/ntc-ansible/get_vlan.yml': line 2, column 3, but may\r\nbe elsewhere in the file depending on the exact syntax problem.\r\n\r\nThe offending line appears to be:\r\n\r\n- ntc_show_command:\r\n  ^ here\r\n\r\n\r\n$ cat get_vlan.yml\r\n\r\n- ntc_show_command:\r\n    connection=ssh\r\n    platform=cisco_nxos\r\n    command='show vlan'\r\n    host={{ 10.192.1.1 }}\r\n    username={{ my_login }}\r\n    password={{ my_password }}"},"comment":{"url":"https://api.github.com/repos/networktocode/ntc-ansible/issues/comments/172079515","html_url":"https://github.com/networktocode/ntc-ansible/issues/94#issuecomment-172079515","issue_url":"https://api.github.com/repos/networktocode/ntc-ansible/issues/94","id":172079515,"user":{"login":"spirrello","id":7174260,"avatar_url":"https://avatars.githubusercontent.com/u/7174260?v=3","gravatar_id":"","url":"https://api.github.com/users/spirrello","html_url":"https://github.com/spirrello","followers_url":"https://api.github.com/users/spirrello/followers","following_url":"https://api.github.com/users/spirrello/following{/other_user}","gists_url":"https://api.github.com/users/spirrello/gists{/gist_id}","starred_url":"https://api.github.com/users/spirrello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spirrello/subscriptions","organizations_url":"https://api.github.com/users/spirrello/orgs","repos_url":"https://api.github.com/users/spirrello/repos","events_url":"https://api.github.com/users/spirrello/events{/privacy}","received_events_url":"https://api.github.com/users/spirrello/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T20:18:33Z","updated_at":"2016-01-15T20:18:33Z","body":"I'll try this out today.  Thanks for the quick response!\n\nOn Thu, Jan 14, 2016 at 5:43 PM, Jason Edelman <notifications@github.com>\nwrote:\n\n> Hi @spirrello <https://github.com/spirrello>\n>\n> Your get_vlan.yml needs more than the task.\n>\n> It needs to look like this (using a different format for readability):\n>\n> ---\n>\n> - name: GET STRUCTURED DATA BACK FROM CLI DEVICES\n>   hosts: all\n>   connection: local\n>   gather_facts: False\n>\n>   tasks:\n>\n>     - name: GET VLANS IN REAL TIME\n>       ntc_show_command:\n>          connection: ssh\n>          platform: cisco_nxos\n>          command: show vlan\n>          host: \"{{ inventory_hostname }}\"\n>          username: \"{{ my_login }}\"\n>          password: \"{{ my_password }}\"\n>       register: result\n>\n>     - debug: var=result\n>\n> Don't have the IP address in curly braces...curly braces mean it's a\n> variable.\n>\n> You also need an inventory file with at least one host in. Given your\n> example it could look like this:\n>\n> [all:vars]\n> my_login=XXX\n> my_password=ABC\n>\n> [nexus]\n> 10.192.1.1\n>\n>\n> And if you didn't set your env variable for the inventory file, when you\n> run it, it should be:\n>\n> ansible-playbook -i inventory_file get_vlan.yml\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/networktocode/ntc-ansible/issues/94#issuecomment-171805447>\n> .\n>\n"}}