{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/10423","labels_url":"https://api.github.com/repos/ansible/ansible/issues/10423/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/10423/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/10423/events","html_url":"https://github.com/ansible/ansible/issues/10423","id":60575213,"number":10423,"title":"Allow value mapping on task \"register\"","user":{"login":"robzienert","id":108741,"avatar_url":"https://avatars.githubusercontent.com/u/108741?v=3","gravatar_id":"","url":"https://api.github.com/users/robzienert","html_url":"https://github.com/robzienert","followers_url":"https://api.github.com/users/robzienert/followers","following_url":"https://api.github.com/users/robzienert/following{/other_user}","gists_url":"https://api.github.com/users/robzienert/gists{/gist_id}","starred_url":"https://api.github.com/users/robzienert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robzienert/subscriptions","organizations_url":"https://api.github.com/users/robzienert/orgs","repos_url":"https://api.github.com/users/robzienert/repos","events_url":"https://api.github.com/users/robzienert/events{/privacy}","received_events_url":"https://api.github.com/users/robzienert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-10T21:49:30Z","updated_at":"2015-03-10T21:49:30Z","closed_at":null,"body":"In my playbook, I'd like to map the result of a module's output more granular than just assigning the full module result object to the variable, but rather just a property of that result. For example, the desired behavior:\r\n\r\n```\r\n# defaults/main.yml\r\n---\r\nartifact_s3_key: someStaticValue\r\n\r\n# tasks/main.yml\r\n---\r\n- name: search for latest artifact in s3\r\n  s3_search: bucket={{ bucket }} path={{ artifact_path }} latest=yes\r\n  register: name=artifact_s3_key map=_.key \r\n  when: dynamic_artifact_resolution\r\n\r\n- name: download from s3\r\n  s3: bucket={{ bucket }} object={{ artifact_path }} dest=/tmp/{{ artifact_path }} mode=get\r\n```\r\n\r\nUnfortunately, I can't do mapping and Ansible doesn't allow extension in this way to let me override its behavior here, so I'm forced to do something like:\r\n\r\n```\r\n# defaults/main.yml\r\n---\r\nartifact_s3:\r\n  key: someStaticValue\r\n\r\n# tasks/main.yml\r\n---\r\n- name: search\r\n  s3_search: ...\r\n  register: artifact_s3_key\r\n\r\n- name: download\r\n  s3: object={{ artifact_path.key }} ...\r\n```\r\n"}}