{"action":"created","issue":{"url":"https://api.github.com/repos/dmsimard/ara/issues/114","repository_url":"https://api.github.com/repos/dmsimard/ara","labels_url":"https://api.github.com/repos/dmsimard/ara/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/dmsimard/ara/issues/114/comments","events_url":"https://api.github.com/repos/dmsimard/ara/issues/114/events","html_url":"https://github.com/dmsimard/ara/issues/114","id":213196719,"number":114,"title":"ara record with ec2_facts","user":{"login":"AnthonyWC","id":6215805,"avatar_url":"https://avatars2.githubusercontent.com/u/6215805?v=3","gravatar_id":"","url":"https://api.github.com/users/AnthonyWC","html_url":"https://github.com/AnthonyWC","followers_url":"https://api.github.com/users/AnthonyWC/followers","following_url":"https://api.github.com/users/AnthonyWC/following{/other_user}","gists_url":"https://api.github.com/users/AnthonyWC/gists{/gist_id}","starred_url":"https://api.github.com/users/AnthonyWC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnthonyWC/subscriptions","organizations_url":"https://api.github.com/users/AnthonyWC/orgs","repos_url":"https://api.github.com/users/AnthonyWC/repos","events_url":"https://api.github.com/users/AnthonyWC/events{/privacy}","received_events_url":"https://api.github.com/users/AnthonyWC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-09T23:19:47Z","updated_at":"2017-03-09T23:36:29Z","closed_at":null,"body":"I am trying to use ec2_facts into ara record:\r\n\r\n```\r\n---\r\n- hosts: \"{{ HOST_TAG }}\"\r\n  gather_facts: false\r\n  become: no\r\n  tasks:\r\n  - name: Get instance ec2 facts\r\n    action: ec2_facts\r\n    register: ec2_facts\r\n\r\n- debug:\r\n     var: ec2_facts\r\n     verbosity: 3\r\n```\r\n\r\nHaven't used ansible for awhile but I tried the following:\r\n```\r\n  - name: Record to ara\r\n    ara_record:\r\n      key: \"{{ item.key }}\"\r\n      value: \"{{ item.value }}\"\r\n      type: \"dict\"\r\n    with_dict: \"{{ ec2_facts }}\"\r\n```\r\n\r\nWith the general format from register ec2_facts (from debug):\r\n```\r\nok: [172.17.64.22] => {\r\n    \"ec2_facts\": {\r\n        \"ansible_facts\": {\r\n            \"ansible_ec2_ami_id\": \"ami-#####\", \r\n            \"ansible_ec2_ami_launch_index\": \"0\", \r\n            \"ansible_ec2_ami_manifest_path\": \"(unknown)\", \r\n            \"ansible_ec2_block_device_mapping_ami\": \"/dev/sda1\", \r\n            \"ansible_ec2_block_device_mapping_ebs3\": \"sdb\", \r\n            \"ansible_ec2_block_device_mapping_ebs4\": \"xvdf\"\r\n     }\r\n}\r\nok: [172.17.64.23] => {\r\n    \"ec2_facts\": {\r\n        \"ansible_facts\": {\r\n            \"ansible_ec2_ami_id\": \"ami-######\", \r\n            \"ansible_ec2_ami_launch_index\": \"0\", \r\n            \"ansible_ec2_ami_manifest_path\": \"(unknown)\"\r\n\r\n  }\r\n}\r\n```\r\n\r\n```\r\nmsg: module (ara_record) is missing interpreter line\r\nfatal: [172.17.64.25]: FAILED! => {\"failed\": true, \"msg\": \"module (ara_record) is missing interpreter line\"}\r\n```"},"comment":{"url":"https://api.github.com/repos/dmsimard/ara/issues/comments/285519474","html_url":"https://github.com/dmsimard/ara/issues/114#issuecomment-285519474","issue_url":"https://api.github.com/repos/dmsimard/ara/issues/114","id":285519474,"user":{"login":"dmsimard","id":1291204,"avatar_url":"https://avatars1.githubusercontent.com/u/1291204?v=3","gravatar_id":"","url":"https://api.github.com/users/dmsimard","html_url":"https://github.com/dmsimard","followers_url":"https://api.github.com/users/dmsimard/followers","following_url":"https://api.github.com/users/dmsimard/following{/other_user}","gists_url":"https://api.github.com/users/dmsimard/gists{/gist_id}","starred_url":"https://api.github.com/users/dmsimard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmsimard/subscriptions","organizations_url":"https://api.github.com/users/dmsimard/orgs","repos_url":"https://api.github.com/users/dmsimard/repos","events_url":"https://api.github.com/users/dmsimard/events{/privacy}","received_events_url":"https://api.github.com/users/dmsimard/received_events","type":"User","site_admin":false},"created_at":"2017-03-09T23:36:29Z","updated_at":"2017-03-09T23:36:29Z","body":"Could you try something like this?\r\n\r\n```\r\n- ara_record:\r\n    key: \"ec2_facts\"\r\n    value: \"{{ ec2_facts }}\"\r\n    type: \"dict\"\r\n```\r\n\r\nOtherwise, if you're looking for ansible facts (which probably picks up quite a few ec2 things), those are stored by default in ARA if you are gathering facts throughout your playbook."}}
{"actor":{"display_login":"dmsimard"}}