{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/31105","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/31105/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/31105/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/31105/events","html_url":"https://github.com/ansible/ansible/issues/31105","id":261679341,"node_id":"MDU6SXNzdWUyNjE2NzkzNDE=","number":31105,"title":"RFE: flatten/simplify azure fact namespace","user":{"login":"wenottingham","id":5208768,"node_id":"MDQ6VXNlcjUyMDg3Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/5208768?v=4","gravatar_id":"","url":"https://api.github.com/users/wenottingham","html_url":"https://github.com/wenottingham","followers_url":"https://api.github.com/users/wenottingham/followers","following_url":"https://api.github.com/users/wenottingham/following{/other_user}","gists_url":"https://api.github.com/users/wenottingham/gists{/gist_id}","starred_url":"https://api.github.com/users/wenottingham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenottingham/subscriptions","organizations_url":"https://api.github.com/users/wenottingham/orgs","repos_url":"https://api.github.com/users/wenottingham/repos","events_url":"https://api.github.com/users/wenottingham/events{/privacy}","received_events_url":"https://api.github.com/users/wenottingham/received_events","type":"User","site_admin":false},"labels":[{"id":562292166,"node_id":"MDU6TGFiZWw1NjIyOTIxNjY=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.4","name":"affects_2.4","color":"ededed","default":false},{"id":379680468,"node_id":"MDU6TGFiZWwzNzk2ODA0Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/azure","name":"azure","color":"c5def5","default":false},{"id":61528803,"node_id":"MDU6TGFiZWw2MTUyODgwMw==","url":"https://api.github.com/repos/ansible/ansible/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":572364907,"node_id":"MDU6TGFiZWw1NzIzNjQ5MDc=","url":"https://api.github.com/repos/ansible/ansible/labels/deprecated","name":"deprecated","color":"fef2c0","default":false},{"id":852590921,"node_id":"MDU6TGFiZWw4NTI1OTA5MjE=","url":"https://api.github.com/repos/ansible/ansible/labels/feature","name":"feature","color":"006b75","default":false},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":669975544,"node_id":"MDU6TGFiZWw2Njk5NzU1NDQ=","url":"https://api.github.com/repos/ansible/ansible/labels/support:certified","name":"support:certified","color":"ededed","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-09-29T15:28:32Z","updated_at":"2018-08-10T06:41:12Z","closed_at":"2018-08-10T06:41:12Z","author_association":"MEMBER","body":"\r\n##### ISSUE TYPE\r\n - Feature Idea\r\n\r\n##### COMPONENT NAME\r\nazure_rm_virtualmachine\r\n\r\n(probably applies to all azure)\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.4.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/lib/python2.7/site-packages/ansible\r\n  executable location = /usr/bin/ansible\r\n  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]\r\n```\r\n\r\n##### CONFIGURATION\r\n\r\nnothing of note\r\n\r\n##### OS / ENVIRONMENT\r\n\r\nCentOS 7\r\n\r\n##### SUMMARY\r\n\r\nThe Azure fact namespace is needlessly convoluted compared to other fact/return namespaces.\r\n\r\n##### STEPS TO REPRODUCE\r\nTake a standard playbook that launches instances and waits for ssh to be available.\r\n\r\nEC2 example\r\n```\r\n  - name: Launch AWS instances\r\n    ec2:\r\n      state: present\r\n      count: 3\r\n...\r\n      wait: true\r\n    register: ec2_results\r\n\r\n  - name: Wait for SSH to come up\r\n    wait_for:\r\n      host: \"{{ item.public_ip }}\"\r\n      state: started\r\n      port: 22\r\n      timeout: 60\r\n    with_items:\r\n      - \"{{ ec2_results.instances }}\"\r\n```\r\n\r\nGCP example:\r\n\r\n```\r\n  - name: Launch GCP instances\r\n    gce:\r\n      state: present\r\n      num_instances: 3\r\n...\r\n    register: gce_results\r\n\r\n  - name: Wait for SSH to come up\r\n    wait_for:\r\n      host: \"{{ item.public_ip }}\"\r\n      state: started\r\n      port: 22\r\n      timeout: 60\r\n    with_items:\r\n      - \"{{ gce_results.instance_data }}\"\r\n```\r\n\r\nAzure example:\r\n\r\n```\r\n  - name: Launch Azure instances\r\n    azure_rm_virtualmachine:\r\n      state: present\r\n...\r\n    with_sequence: count=3\r\n    register: azure_results\r\n\r\n  - name: Wait for SSH to come up\r\n    wait_for:\r\n      host: \"{{ item.ansible_facts.azure_vm.properties.networkProfile.networkInterfaces[0].properties.ipConfigurations[0].properties.publicIPAddress.properties.ipAddress }}\"\r\n      state: started\r\n      port: 22\r\n      timeout: 60\r\n    with_items:\r\n      - \"{{ azure_results.results }}\"\r\n```\r\n\r\nThe Azure example works... but it's excessively long and prone to error when attempting to write.\r\n\r\n##### EXPECTED RESULTS\r\n\r\nAzure to be roughly analogous in complexity to other cloud providers.\r\n\r\n##### ACTUAL RESULTS\r\n\r\nMaximum verbosity of namespace\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/411990538","html_url":"https://github.com/ansible/ansible/issues/31105#issuecomment-411990538","issue_url":"https://api.github.com/repos/ansible/ansible/issues/31105","id":411990538,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTk5MDUzOA==","user":{"login":"yungezz","id":37337818,"node_id":"MDQ6VXNlcjM3MzM3ODE4","avatar_url":"https://avatars3.githubusercontent.com/u/37337818?v=4","gravatar_id":"","url":"https://api.github.com/users/yungezz","html_url":"https://github.com/yungezz","followers_url":"https://api.github.com/users/yungezz/followers","following_url":"https://api.github.com/users/yungezz/following{/other_user}","gists_url":"https://api.github.com/users/yungezz/gists{/gist_id}","starred_url":"https://api.github.com/users/yungezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yungezz/subscriptions","organizations_url":"https://api.github.com/users/yungezz/orgs","repos_url":"https://api.github.com/users/yungezz/repos","events_url":"https://api.github.com/users/yungezz/events{/privacy}","received_events_url":"https://api.github.com/users/yungezz/received_events","type":"User","site_admin":false},"created_at":"2018-08-10T06:41:12Z","updated_at":"2018-08-10T06:41:12Z","author_association":"CONTRIBUTOR","body":"from azure_virtualmachine_facts module, azure facts module will output  `curated`, try to  match input of module, due to same motivation in the issue. we'll use this as a coding guideline for new azure facts module in future. close the issue for now."}}
{"actor":{"display_login":"yungezz"}}