location header from uri response

5 views
Skip to first unread message

Adam Gardner

unread,
Aug 15, 2016, 10:19:27 AM8/15/16
to Ansible Project

I'm using the uri module to call a REST API. The result of this is shown below. I now want to save the location portion into a variable to use later in my script.


How do I do that?


I've tried:


register: msg // register: content // register: status


I'm using the uri as a pre_task - if that makes any difference?


I've also trying using:


  tasks:

   - debug: var=msg.location // - debug: var=content.location // - debug: var=\"{{ status.location}}\" // -debug: var=\"{{ status.location | from_json }}\"


Basically every combination of the obvious.







Reply all
Reply to author
Forward
0 new messages