{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/4809","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/4809/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/4809/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/4809/events","html_url":"https://github.com/ansible/ansible/issues/4809","id":22102007,"number":4809,"title":"Merge ansible_interfaces and ansible_$iface facts","user":{"login":"Apsu","id":1023042,"avatar_url":"https://avatars.githubusercontent.com/u/1023042?v=3","gravatar_id":"","url":"https://api.github.com/users/Apsu","html_url":"https://github.com/Apsu","followers_url":"https://api.github.com/users/Apsu/followers","following_url":"https://api.github.com/users/Apsu/following{/other_user}","gists_url":"https://api.github.com/users/Apsu/gists{/gist_id}","starred_url":"https://api.github.com/users/Apsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Apsu/subscriptions","organizations_url":"https://api.github.com/users/Apsu/orgs","repos_url":"https://api.github.com/users/Apsu/repos","events_url":"https://api.github.com/users/Apsu/events{/privacy}","received_events_url":"https://api.github.com/users/Apsu/received_events","type":"User","site_admin":false},"labels":[{"id":48457795,"url":"https://api.github.com/repos/ansible/ansible/labels/feature_idea","name":"feature_idea","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2013-11-05T06:34:50Z","updated_at":"2016-11-19T21:34:04Z","closed_at":"2013-11-08T05:28:54Z","body":"Currently the setup module specifies that ansible_interfaces will be a flat list of interface name strings and each interface will have an ansible_$iface dict of the discovered interface information. However, this makes programmatically using the interface information very ugly, especially if you may expect that a given group of hosts may have different interface layouts, be missing interfaces, have unpredictable names but predictable orders, etc.\n\nI propose a simple merging of the two ideas, such that the single fact will be structured like:\n\n```\nansible_interfaces: {\n  lo: {\n    key: value,\n    ...\n  },\n  eth0: {\n  ...\n  }\n}\n```\n\nThis allows you to not only check for the presence of a particular interface but also to iterate over them as you like, without having to attempt some sort of nonsense like {{ansible_{{item}}.ipv4.address}} that doesn't really work anyway.\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/261741125","html_url":"https://github.com/ansible/ansible/issues/4809#issuecomment-261741125","issue_url":"https://api.github.com/repos/ansible/ansible/issues/4809","id":261741125,"user":{"login":"tmartinx","id":218082,"avatar_url":"https://avatars.githubusercontent.com/u/218082?v=3","gravatar_id":"","url":"https://api.github.com/users/tmartinx","html_url":"https://github.com/tmartinx","followers_url":"https://api.github.com/users/tmartinx/followers","following_url":"https://api.github.com/users/tmartinx/following{/other_user}","gists_url":"https://api.github.com/users/tmartinx/gists{/gist_id}","starred_url":"https://api.github.com/users/tmartinx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmartinx/subscriptions","organizations_url":"https://api.github.com/users/tmartinx/orgs","repos_url":"https://api.github.com/users/tmartinx/repos","events_url":"https://api.github.com/users/tmartinx/events{/privacy}","received_events_url":"https://api.github.com/users/tmartinx/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T21:34:04Z","updated_at":"2016-11-19T21:34:04Z","body":"This is really a good idea! Not a chance to implement it? What about something that can explicitly enabled at run-time, that doesn't affect old stuff, not braking backwards compatibility... ?"}}
{"actor":{"display_login":"tmartinx"}}