I have a python script that in summary outputs only one line, a long URL. example: https://www.google.com/ . Now, after I execute the python script WITHIN ansible, i try to register the output to a variable, and then proceed to use get_url module to download the file from the URL.
- name: get url from python code
script: get_url.py
register: output
- debug: var=output
- name: Use URL to download file
get_url:
url: "((output}}"
dest: "/path/example/"
However, I get this error: Request failed: <urlopen error unknown url type It seems that the result is still being output as stdout: 'https....'
How do i grab the exact URL from that python output and use ansible get_url to download it ? The python result is only one line, and that is only the URL, nothing else.