{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/15836","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/15836/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/15836/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/15836/events","html_url":"https://github.com/ansible/ansible/pull/15836","id":154514485,"number":15836,"title":"docs: {{ net_mask | ipaddr('net') }}  example is wrong","user":{"login":"BuildTheRobots","id":5307527,"avatar_url":"https://avatars.githubusercontent.com/u/5307527?v=3","gravatar_id":"","url":"https://api.github.com/users/BuildTheRobots","html_url":"https://github.com/BuildTheRobots","followers_url":"https://api.github.com/users/BuildTheRobots/followers","following_url":"https://api.github.com/users/BuildTheRobots/following{/other_user}","gists_url":"https://api.github.com/users/BuildTheRobots/gists{/gist_id}","starred_url":"https://api.github.com/users/BuildTheRobots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BuildTheRobots/subscriptions","organizations_url":"https://api.github.com/users/BuildTheRobots/orgs","repos_url":"https://api.github.com/users/BuildTheRobots/repos","events_url":"https://api.github.com/users/BuildTheRobots/events{/privacy}","received_events_url":"https://api.github.com/users/BuildTheRobots/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/docs_pull_request","name":"docs_pull_request","color":"0052cc"},{"url":"https://api.github.com/repos/ansible/ansible/labels/needs_info","name":"needs_info","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-12T15:38:38Z","updated_at":"2016-05-18T14:50:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/15836","html_url":"https://github.com/ansible/ansible/pull/15836","diff_url":"https://github.com/ansible/ansible/pull/15836.diff","patch_url":"https://github.com/ansible/ansible/pull/15836.patch"},"body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Docs Pull Request\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.0.2.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\nExample in documentation is wrong for ipaddr('net')\r\n\r\nTo get \"ipaddress/cidr\" output the documentation recommends `ipaddr('net').\r\nOn my systems this gives me blank output.\r\nAfter trial and error using `ipaddr('host')` seems to give the correct transformation\r\n\r\n\r\n##### SYSINFO\r\ncentos 6.x amd64, latest updates as of today's date.\r\npython-netaddr.noarch  0.7.5-4.el6 "},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/220050583","html_url":"https://github.com/ansible/ansible/pull/15836#issuecomment-220050583","issue_url":"https://api.github.com/repos/ansible/ansible/issues/15836","id":220050583,"user":{"login":"BuildTheRobots","id":5307527,"avatar_url":"https://avatars.githubusercontent.com/u/5307527?v=3","gravatar_id":"","url":"https://api.github.com/users/BuildTheRobots","html_url":"https://github.com/BuildTheRobots","followers_url":"https://api.github.com/users/BuildTheRobots/followers","following_url":"https://api.github.com/users/BuildTheRobots/following{/other_user}","gists_url":"https://api.github.com/users/BuildTheRobots/gists{/gist_id}","starred_url":"https://api.github.com/users/BuildTheRobots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BuildTheRobots/subscriptions","organizations_url":"https://api.github.com/users/BuildTheRobots/orgs","repos_url":"https://api.github.com/users/BuildTheRobots/repos","events_url":"https://api.github.com/users/BuildTheRobots/events{/privacy}","received_events_url":"https://api.github.com/users/BuildTheRobots/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T14:50:03Z","updated_at":"2016-05-18T14:50:03Z","body":"This behaviour seems to change depending on if you feed it a network address or a host IP address. I don't know if this is supposed to be different or not, my feeling is it shouldn't be, but I might well be misunderstanding what's going on (this is my second week with ansible).\r\n\r\n\r\n`[root@bsc ansible]# ansible -m debug -a 'msg={{\"192.168.0.**0**/255.255.255.0\"|ipaddr(\"net\")}}' localhost\r\nlocalhost | SUCCESS => {\r\n    \"msg\": \"192.168.0.0/24\"\r\n}\r\n[root@bsc ansible]# ansible -m debug -a 'msg={{\"192.168.0.**0**/255.255.255.0\"|ipaddr(\"host\")}}' localhost\r\nlocalhost | SUCCESS => {\r\n    \"msg\": \"\"\r\n}\r\n[root@bsc ansible]# ansible -m debug -a 'msg={{\"192.168.0.**1**/255.255.255.0\"|ipaddr(\"net\")}}' localhost\r\nlocalhost | SUCCESS => {\r\n    \"msg\": \"\"\r\n}\r\n[root@bsc ansible]# ansible -m debug -a 'msg={{\"192.168.0.**1**/255.255.255.0\"|ipaddr(\"host\")}}' localhost\r\nlocalhost | SUCCESS => {\r\n    \"msg\": \"192.168.0.1/24\"\r\n}`"}}